osheroff / mysql-binlog-connector-java

MySQL Binary Log connector
641 stars 161 forks source link

fix bug signedness order change to All Column Order #121

Closed sean-k1 closed 9 months ago

sean-k1 commented 11 months ago

I was implementing optional_metadata field in table_map_event for python-mysql-replication.

Changes

Reason

optional metadata type SIGNEDNESS case The order of indices in the Inputstream corresponds to the order of numeric columns So we need to map the index to all columns index(include non numeric type columns)

Examples

SIGNEDNESS bit map now result is signedness={0, 2}, but we expect result should be signedness={0, 3}, Because test3 table column col1 and col4 are unsigned

AS-IS

TO-BE

dongwook-chan commented 11 months ago

PTAL, @osheroff I desperately need this feature. Optional meta data in table map events holds invaluable data and users will benefit so much from correctly parsing it. I can't wait this PR to be merged!

osheroff commented 11 months ago

hi, sorry for the delay, can you please write an integration test that shows the issue clearly? Your patch looks ok -- although it'd be better if we could avoid another for-all-columns loop and the ArrayList allocation -- but I'd like to be able to verify this against a running server.

thnx

sean-k1 commented 10 months ago

@osheroff hello

If we add a function to the TableMapEventMetadataDeserializer class that takes ColumnType information as a parameter and that determines if it's numeric, we can eliminate the part where we allocate an ArrayList. But this codes.. It seems like this may not be the best structure for writing test code. If this approach is better, I'll modify code

and i added integration Test too

sean-k1 commented 10 months ago

@osheroff Can you check my PR?

dongwook-chan commented 10 months ago

@osheroff PTAL

sean-k1 commented 10 months ago

@osheroff It takes a month 🥲

dongwook-chan commented 9 months ago

@osheroff I know you're busy but I think it's high time you appoint additional maintainer. I think @sean-k1 is one of the most competent candidates. He has conducted a comprehensive walkthrough of the project and understands every aspect of it. And on top of everything, he is a maintainer and active contributor of python-mysql-replication. He is an expert in MySQL replication.