Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
cdc-3.2.0
Description
The original MySQL Table
CREATE TABLE full_types_0 ( id BIGINT, tiny1_c TINYINT(1) DEFAULT '0' COMMENT 'test tinyint1', boolean_c BOOLEAN DEFAULT '0' COMMENT 'test boolean' PRIMARY KEY (id) ) DEFAULT CHARSET=utf8;INSERT INTO full_types_0 VALUES (1 true, true ); CREATE TABLE full_types_1 ( id BIGINT, tiny1_c TINYINT(1) DEFAULT '0' COMMENT 'test tinyint1', boolean_c BOOLEAN DEFAULT '0' COMMENT 'test boolean' PRIMARY KEY (id) ) DEFAULT CHARSET=utf8;INSERT INTO full_types_1 VALUES (1 true, true );
The exception error:
Caused by: java.lang.NumberFormatException: For input string: "true"
The reason:
MySQL cdc uses SHOW CREATE TABLE command to build its Flink SQL table' schema for existing MySQL table, uses create table DDL statement in binlog to build its Flink SQL table' schema for newly-added table. But BOOLEAN type is a magic type in MySQL world, you can not obtain BOOLEAN type anymore via show create table command, you can only obtain BOOLEAN type in original create table DDL statement.