-
Notifications
You must be signed in to change notification settings - Fork 1k
Add some TableMapEvent helper methods #482
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
Conversation
LGTM |
@csuzhangxc PTAL, if there're not any problems, we can merge this PR ASAP |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rest LGTM
replication/row_event.go
Outdated
func (e *TableMapEvent) realType(i int) byte { | ||
|
||
typ := e.ColumnType[i] | ||
meta := e.ColumnMeta[i] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about putting this line above L748?
|
||
case MYSQL_TYPE_GEOMETRY: | ||
if e.flavor == "mariadb" { | ||
return true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about highlight this special behavior as the comments of this func (IsCharacterColumn
)?
Move some code in TableMapEvent.realType
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This pr adds some type-related helper methods for
TableMapEvent
. #479They should behave the same as
Table_map_log_event::print_columns
(mysqlbinlog --print-table-metadata
).And a
flavor
field is added toBinlogParser
and passed toTableMapEvent
to distinguish mysql/mariadb, since there are some differences slightly in checking types.