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

When there are spaces in the Default value of the numeric type in a new table DDL under the same Mysql Host; MySQL can be executed successfully,But debezium return some exception

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Trivial Trivial
    • None
    • 1.6.4.Final
    • core-library
    • None
    • False
    • None
    • False

      When There are spaces in the Default value of the numeric type in a new table DDL under the same Mysql Host; MySQL can be executed successfully,But debezium return Some Exception

      Bug report

      This is the Mysql DDL,and mysql can be executed successfully

       

      create table rich_people_1
      (
          id    int auto_increment primary key,
          name  varchar(255) null,
          age   bigint  DEFAULT ' 0 ',
          hobby varchar(255) null
      );
      

      After the debezium programer run,It return this exception:

       

      An exception occurred in the change event producer. This connector will be stopped.
      	at io.debezium.pipeline.ErrorHandler.setProducerThrowable(ErrorHandler.java:42) ~[?:?]
      	at io.debezium.connector.mysql.MySqlStreamingChangeEventSource.handleEvent(MySqlStreamingChangeEventSource.java:369) ~[?:?]
      	at com.github.shyiko.mysql.binlog.BinaryLogClient.notifyEventListeners(BinaryLogClient.java:1118) ~[?:?]
      	at com.github.shyiko.mysql.binlog.BinaryLogClient.listenForEventPackets(BinaryLogClient.java:966) ~[?:?]
      	at com.github.shyiko.mysql.binlog.BinaryLogClient.connect(BinaryLogClient.java:606) ~[?:?]
      	at com.github.shyiko.mysql.binlog.BinaryLogClient$7.run(BinaryLogClient.java:850) ~[?:?]
      	at java.lang.Thread.run(Thread.java:877) ~[?:1.8.0_302]
      Caused by: io.debezium.DebeziumException: Error processing binlog event
      	... 6 more
      Caused by: java.lang.NumberFormatException: For input string: " 0 "
      	at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) ~[?:1.8.0_302]
      	at java.lang.Long.parseLong(Long.java:578) ~[?:1.8.0_302]
      	at java.lang.Long.valueOf(Long.java:803) ~[?:1.8.0_302]
      	at io.debezium.jdbc.JdbcValueConverters.lambda$convertBigInt$42(JdbcValueConverters.java:919) ~[?:?]
      	at io.debezium.jdbc.JdbcValueConverters.convertValue(JdbcValueConverters.java:1288) ~[?:?]
      	at io.debezium.jdbc.JdbcValueConverters.convertBigInt(JdbcValueConverters.java:907) ~[?:?]
      	at io.debezium.jdbc.JdbcValueConverters.lambda$converter$6(JdbcValueConverters.java:297) ~[?:?]
      	at io.debezium.connector.mysql.MySqlDefaultValueConverter.setColumnDefaultValue(MySqlDefaultValueConverter.java:405) ~[?:?]
      	at io.debezium.connector.mysql.antlr.listener.CreateTableParserListener.convertDefaultValueToSchemaType(CreateTableParserListener.java:147) ~[?:?]
      	at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) ~[?:1.8.0_302]
      	at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) ~[?:1.8.0_302]
      	at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1384) ~[?:1.8.0_302]
      	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482) ~[?:1.8.0_302]
      	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472) ~[?:1.8.0_302]
      	at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708) ~[?:1.8.0_302]
      	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:1.8.0_302]
      	at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:566) ~[?:1.8.0_302]
      	at io.debezium.connector.mysql.antlr.listener.CreateTableParserListener.lambda$exitColumnCreateTable$1(CreateTableParserListener.java:75) ~[?:?]
      	at io.debezium.connector.mysql.antlr.MySqlAntlrDdlParser.runIfNotNull(MySqlAntlrDdlParser.java:357) ~[?:?]
      	at io.debezium.connector.mysql.antlr.listener.CreateTableParserListener.exitColumnCreateTable(CreateTableParserListener.java:55) ~[?:?]
      	at io.debezium.ddl.parser.mysql.generated.MySqlParser$ColumnCreateTableContext.exitRule(MySqlParser.java:4733) ~[?:?]
      	at io.debezium.antlr.ProxyParseTreeListenerUtil.delegateExitRule(ProxyParseTreeListenerUtil.java:64) ~[?:?]
      	at io.debezium.connector.mysql.antlr.listener.MySqlAntlrDdlParserListener.exitEveryRule(MySqlAntlrDdlParserListener.java:106) ~[?:?]
      	at 

       

      What Debezium connector do you use and what version?

      1.6.4.Final

      What is the connector configuration?

       

      What is the captured database version and mode of depoyment?

      (E.g. on-premises, with a specific cloud provider, etc.)

      Mysql 5.7

      What behaviour do you expect?

      debezium can trim the space before convert String to Bigint

      What behaviour do you see?

      <Your answer>

      Do you see the same behaviour using the latest relesead Debezium version?

      (Ideally, also verify with latest Alpha/Beta/CR version)

      yes ,the latest version still has this bug

      Do you have the connector logs, ideally from start till finish?

      (You might be asked later to provide DEBUG/TRACE level log)

      <Your answer>

      How to reproduce the issue using our tutorial deployment?

      <Your answer>

      Feature request or enhancement

      For feature requests or enhancements, provide this information, please:

      Which use case/requirement will be addressed by the proposed feature?

      <Your answer>

      Implementation ideas (optional)

      <Your answer>

              Unassigned Unassigned
              youyangkou Gerry kou (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: