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

DBZ-6225 Treat BOOLEAN as TINYINT(1) consistently #4371

Closed
wants to merge 2 commits into from

Conversation

Naros
Copy link
Member

@Naros Naros commented Mar 18, 2023

https://issues.redhat.com/browse/DBZ-6225

The snapshot phase uses the JDBC driver metadata to resolve the column mappings; however, during streaming, if a CREATE TABLE ddl statement is used, the column mapping is based on that of the DDL, which was not treating a BOOLEAN column as TINYINT(1); instead, it treated the column as BOOLEAN, which is incorrect for MySQL.

The snapshot phase uses the JDBC driver metadata to resolve the column
mappings; however during streaming if a CREATE TABLE ddl statement is
used, the column mapping is based on that of the DDL, which was not
treating a BOOLEAN column as TINYINT(1); instead it treated the column
as BOOLEAN, which is incorrect for MySQL.
@Naros Naros marked this pull request as draft March 18, 2023 22:17
@Naros Naros marked this pull request as ready for review March 19, 2023 16:18
@Naros
Copy link
Member Author

Naros commented Mar 19, 2023

About the test changes let's take the test method parseBooleanDefaultValue. If we create such a table using the following SQL and then check the contents of the table we'll find that the column a contains 9 rather than true.

CREATE TABLE test (a boolean not null default '9');
INSERT INTO test values ();

The test changes effectively mirror what we expect in the table and mirror what we ultimately would be emitted as part of the change event since BOOLEAN is technically a synonym for TINYINT(1), which isn't necessarily 0/1 or false/true.

@Naros
Copy link
Member Author

Naros commented Mar 20, 2023

Superseded by referenced PR.

@Naros Naros closed this Mar 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant