go-mysql-org / go-mysql

a powerful mysql toolset with Go
MIT License
4.62k stars 987 forks source link

TableMapEvent 中 ColumnName 获取列名称是空数据。mysql是5.7版本 #806

Open baozinihao opened 1 year ago

baozinihao commented 1 year ago

=======TableMapEvent====== TableID: 109 TableID size: 6 Flags: 1 Schema: golang Table: test Column count: 5 Column type: 00000000 03 0f 0f 03 03 |.....| NULL bitmap: 00000000 06 |.| Signedness bitmap: Default charset: [] Column charset: [] Set str value: [] Enum str value: [] Column name: [] Geometry type: [] Primary key: [] Primary key prefix: [] Enum/set default charset: [] Enum/set column charset: [] UnsignedMap: map[int]bool(nil) CollationMap: map[int]uint64(nil) EnumSetCollationMap: map[int]uint64(nil) EnumStrValueMap: map[int][]string(nil) SetStrValueMap: map[int][]string(nil) GeometryTypeMap: map[int]uint64(nil) Columns: <n/a> type=3 unsigned=<n/a> null=no <n/a> type=15 collation=<n/a> null=yes <n/a> type=15 collation=<n/a> null=yes <n/a> type=3 unsigned=<n/a> null=no <n/a> type=3 unsigned=<n/a> null=no

afocus commented 1 year ago

8.0 too

dveeden commented 1 year ago

Do you have exact versions for both 5.7, 8.0 and the go-mysql version? This might make it easier to reproduce.

What does the same entry look like in mysqlbinlog?

lance6716 commented 1 year ago

You can refer to https://dev.mysql.com/blog-archive/more-metadata-is-written-into-binary-log/

dveeden commented 1 year ago

Ah so to reproduce this one needs to set binlog_row_metadata=full?

xpfo-go commented 1 year ago

Ah so to reproduce this one needs to set binlog_row_metadata=full?

I had the same problem, set binlog_row_metadata=full solve this problem. many thanks.

herouu commented 6 months ago

Ah so to reproduce this one needs to set binlog_row_metadata=full?

thanks,setting this resolve it