Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sir,how I can know which table structure is changed? #246

Closed
introspection3 opened this issue Nov 7, 2018 · 2 comments
Closed

sir,how I can know which table structure is changed? #246

introspection3 opened this issue Nov 7, 2018 · 2 comments

Comments

@introspection3
Copy link

No description provided.

@bluebike
Copy link

bluebike commented Nov 7, 2018

From TABLE_MAP-events you can see column count + "partial" data types of table after alter.
From QUERY-DDL-events which you can parse changes.

Problem is that there is no easy way to see from binlog the (whole) current structure of table (in given position) because TABLE_MAP-event doesn't contain field names.

Mysql-server can handle this situation, because it parses and executes ALTER,CREATE,DROP (DDL) statements.

But to handle table changes you have few ways:

  1. Try to parse all QUERY ALTER,CREATE,DROP statements.
  2. Look from master after seeing the alter event... as soon as possible that what is the state of table.
    But this is fragile, because there can be multiple alters in row.
  3. Have a "sidecar" mysql/mariadb server where you execute just DDL-statements.
    In case ROW based logging almost all QUERY-statements should be grants or DDL statements
    (I have thought this idea much). This could even library version of server I think.

@shyiko
Copy link
Owner

shyiko commented May 12, 2019

#251 might also be of the interest.

@shyiko shyiko closed this as completed May 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants