Uploaded image for project: 'Debezium'
  1. Debezium
  2. DBZ-1689

Support boolean as default for INT(1) column in MySQL

XMLWordPrintable

    • Hide

      Run next statement:

      CREATE TABLE TestTable (
        TestColumn INT(1) NOT NULL 
      );
      
      ALTER TABLE Test ADD COLUMN TestColumn INT(1) NOT NULL DEFAULT FALSE;
      
      Show
      Run next statement: CREATE TABLE TestTable ( TestColumn INT (1) NOT NULL ); ALTER TABLE Test ADD COLUMN TestColumn INT(1) NOT NULL DEFAULT FALSE;

      Mysql: Getting ERROR `Failed due to error: connect.errors.ConnectException: For input string: "false"` in case of using INT(1) DEFAULT FALSE INT(1) DEFAULT FALSE in a DDL statement

      Dec 18 11:32:27 ip-10-49-83-101 connect-distributed: [2019-12-18 11:32:27,683] ERROR WorkerSourceTask{id=debezium-norwayexams-connectorJuly22v222-0} Task threw an uncaught and unrecoverable
       exception (org.apache.kafka.connect.runtime.WorkerTask:177)
      Dec 18 11:32:27 ip-10-49-83-101 connect-distributed: org.apache.kafka.connect.errors.ConnectException: java.lang.NumberFormatException: For input string: "FALSE"
      Dec 18 11:32:27 ip-10-49-83-101 connect-distributed: at io.debezium.connector.mysql.MySqlConnectorTask.start(MySqlConnectorTask.java:275)
      Dec 18 11:32:27 ip-10-49-83-101 connect-distributed: at io.debezium.connector.common.BaseSourceTask.start(BaseSourceTask.java:49)
      Dec 18 11:32:27 ip-10-49-83-101 connect-distributed: at org.apache.kafka.connect.runtime.WorkerSourceTask.execute(WorkerSourceTask.java:198)
      Dec 18 11:32:27 ip-10-49-83-101 connect-distributed: at org.apache.kafka.connect.runtime.WorkerTask.doRun(WorkerTask.java:175)
      Dec 18 11:32:27 ip-10-49-83-101 connect-distributed: at org.apache.kafka.connect.runtime.WorkerTask.run(WorkerTask.java:219)
      Dec 18 11:32:27 ip-10-49-83-101 connect-distributed: at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      Dec 18 11:32:27 ip-10-49-83-101 connect-distributed: at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      Dec 18 11:32:27 ip-10-49-83-101 connect-distributed: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      Dec 18 11:32:27 ip-10-49-83-101 connect-distributed: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      Dec 18 11:32:27 ip-10-49-83-101 connect-distributed: at java.lang.Thread.run(Thread.java:748)
      Dec 18 11:32:27 ip-10-49-83-101 connect-distributed: Caused by: java.lang.NumberFormatException: For input string: "FALSE"
      Dec 18 11:32:27 ip-10-49-83-101 connect-distributed: at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
      Dec 18 11:32:27 ip-10-49-83-101 connect-distributed: at java.lang.Integer.parseInt(Integer.java:580)
      Dec 18 11:32:27 ip-10-49-83-101 connect-distributed: at java.lang.Integer.valueOf(Integer.java:766)
      Dec 18 11:32:27 ip-10-49-83-101 connect-distributed: at io.debezium.jdbc.JdbcValueConverters.lambda$convertInteger$39(JdbcValueConverters.java:801)
      Dec 18 11:32:27 ip-10-49-83-101 connect-distributed: at io.debezium.jdbc.JdbcValueConverters.convertValue(JdbcValueConverters.java:1211)
      Dec 18 11:32:27 ip-10-49-83-101 connect-distributed: at io.debezium.jdbc.JdbcValueConverters.convertInteger(JdbcValueConverters.java:789)
      Dec 18 11:32:27 ip-10-49-83-101 connect-distributed: at io.debezium.jdbc.JdbcValueConverters.lambda$converter$5(JdbcValueConverters.java:285)
      Dec 18 11:32:27 ip-10-49-83-101 connect-distributed: at io.debezium.connector.mysql.MySqlDefaultValueConverter.setColumnDefaultValue(MySqlDefaultValueConverter.java:282)
      Dec 18 11:32:27 ip-10-49-83-101 connect-distributed: at io.debezium.connector.mysql.antlr.listener.ColumnDefinitionParserListener.convertDefaultValueToSchemaType(ColumnDefinitionParserListe
      ner.java:306)
      Dec 18 11:32:27 ip-10-49-83-101 connect-distributed: at io.debezium.connector.mysql.antlr.listener.ColumnDefinitionParserListener.enterDefaultValue(ColumnDefinitionParserListener.java:155)
      Dec 18 11:32:27 ip-10-49-83-101 connect-distributed: at io.debezium.ddl.parser.mysql.generated.MySqlParser$DefaultValueContext.enterRule(MySqlParser.java:47591)
      Dec 18 11:32:27 ip-10-49-83-101 connect-distributed: at io.debezium.antlr.ProxyParseTreeListenerUtil.delegateEnterRule(ProxyParseTreeListenerUtil.java:46)
      Dec 18 11:32:27 ip-10-49-83-101 connect-distributed: at io.debezium.connector.mysql.antlr.listener.MySqlAntlrDdlParserListener.enterEveryRule(MySqlAntlrDdlParserListener.java:89)
      Dec 18 11:32:27 ip-10-49-83-101 connect-distributed: at org.antlr.v4.runtime.tree.ParseTreeWalker.enterRule(ParseTreeWalker.java:41)
      Dec 18 11:32:27 ip-10-49-83-101 connect-distributed: at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:25)
      Dec 18 11:32:27 ip-10-49-83-101 connect-distributed: at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:28)
      Dec 18 11:32:27 ip-10-49-83-101 connect-distributed: at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:28)
      Dec 18 11:32:27 ip-10-49-83-101 connect-distributed: at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:28)
      Dec 18 11:32:27 ip-10-49-83-101 connect-distributed: at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:28)
      Dec 18 11:32:27 ip-10-49-83-101 connect-distributed: at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:28)
      Dec 18 11:32:27 ip-10-49-83-101 connect-distributed: at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:28)
      Dec 18 11:32:27 ip-10-49-83-101 connect-distributed: at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:28)
      Dec 18 11:32:27 ip-10-49-83-101 connect-distributed: at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:28)
      Dec 18 11:32:27 ip-10-49-83-101 connect-distributed: at io.debezium.antlr.AntlrDdlParser.parse(AntlrDdlParser.java:85)
      Dec 18 11:32:27 ip-10-49-83-101 connect-distributed: at io.debezium.relational.history.AbstractDatabaseHistory.lambda$recover$1(AbstractDatabaseHistory.java:112)
      Dec 18 11:32:27 ip-10-49-83-101 connect-distributed: at io.debezium.relational.history.KafkaDatabaseHistory.recoverRecords(KafkaDatabaseHistory.java:248)
      Dec 18 11:32:27 ip-10-49-83-101 connect-distributed: at io.debezium.relational.history.AbstractDatabaseHistory.recover(AbstractDatabaseHistory.java:79)
      Dec 18 11:32:27 ip-10-49-83-101 connect-distributed: at io.debezium.connector.mysql.MySqlSchema.loadHistory(MySqlSchema.java:251)
      Dec 18 11:32:27 ip-10-49-83-101 connect-distributed: at io.debezium.connector.mysql.MySqlTaskContext.loadHistory(MySqlTaskContext.java:163)
      Dec 18 11:32:27 ip-10-49-83-101 connect-distributed: at io.debezium.connector.mysql.MySqlConnectorTask.start(MySqlConnectorTask.java:105)
      Dec 18 11:32:27 ip-10-49-83-101 connect-distributed: ... 9 more
      

              Unassigned Unassigned
              vasilyulianko Vasily Ulianko (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: