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

Unit-test for binary-column data corruption (#157) #158

Conversation

kolbitsch-lastline
Copy link

There seems to be a bug in the propagation of data from the binlog
streamer to the binlog writer when using fixed-length BINARY columns.

This commit adds an integration test that currently works only under
very specific conditions, and prepares the code for the fix to the data
propagation logic.

Clemens Kolbitsch added 2 commits March 9, 2020 17:53
There seems to be a bug in the propagation of data from the binlog
streamer to the binlog writer when using fixed-length BINARY columns.

This commit adds an integration test that currently works only under
very specific conditions, and prepares the code for the fix to the data
propagation logic.

Change-Id: Icef7ae558a38af4088280bb633f331711b835502
THIS PULL REQUEST IS NOT INTENDED TO BE MERGED, JUST FOR INTERNAL
DISCUSSION. WE WILL NEED TO MODIFY THE UPSTREAM VERSION OF THE
VENDOR'ED MODULE INSTEAD OF MODIFYING THE IMPORTED VERSION!

This commit addresses a data corruption bug in the binlog streaming
phase, where the binlog writer incorrectly propagates values in
fixed-length BINARY columns that have trailing 0s in the original value.
These trailing 0s are removed from the binlog by the SQL master and
therefore do not show up in the WHERE clause for update/delete
statements executed by the binlog writer.

Change-Id: I7cd01c953ef2027e4f4fa71a62c5d7b30caa83c5
@@ -167,6 +140,91 @@ func TestCopyDataWithNullInColumn(t *testing.T) {
testcase.Run()
}

func TestCopyDataInFixedSizeBinaryColumn(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The golang integration tests are deprecated. Can you write the tests in the ruby integration test instead? Specifically it can go under https://github.com/Shopify/ghostferry/blob/master/test/integration/types_test.rb.

@shuhaowu
Copy link
Contributor

shuhaowu commented Apr 9, 2020

I assume this is superceded by #159. Reopen if necessary.

@shuhaowu shuhaowu closed this Apr 9, 2020
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

Successfully merging this pull request may close these issues.

2 participants