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

Should Allow NonAsciiCharacter in SQL

XMLWordPrintable

    • False
    • False
    • Undefined
    • Hide
      CREATE TABLE connector_test.business_order_1 (
        `id` int(11) NOT NULL AUTO_INCREMENT,
        `code` varchar(32) NOT NULL COMMENT 'order code',
        PRIMARY KEY (`id`),
        KEY `order_code_index` (`code`) COMMENT 'order index'
      ) ENGINE=InnoDB AUTO_INCREMENT=2000022760 DEFAULT CHARSET=utf8 COMMENT='order table';
      
      CREATE TABLE connector_test.business_order_2 (
        `id` int(11) NOT NULL AUTO_INCREMENT,
        `code` varchar(32) NOT NULL COMMENT 'order code',
        PRIMARY KEY (`id`),
        KEY `order_code_index` (`code`) COMMENT 'order index'
      ) ENGINE=InnoDB AUTO_INCREMENT=2000022760 DEFAULT CHARSET=utf8 COMMENT='order table';
      
      
      CREATE TEMPORARY TABLE connector_test.temp1
      SELECT
             bo.id 'id',
             bo.code '测试'
      from
             business_order_1 bo
      ;
      
      CREATE TEMPORARY TABLE connector_test.temp2
      SELECT
             bo.id 'id',
             bo.code '测试'
      from
             business_order_2 bo
      ;
      
      SELECT
          t1.测试
      FROM temp1 t1
      LEFT JOIN
           temp2 t2 on t1.id = t2.id;
      
      
      

       

      
      @Test
      public void shouldAllowNonASSIICCharacters() {
          mysql = build
                  .with(DatabaseHistory.SKIP_UNPARSEABLE_DDL_STATEMENTS, false)
                  .storeDatabaseHistoryInFile(TEST_FILE_PATH)
                  .serverName(SERVER_NAME)
                  .createSchemas();
          mysql.start();
          source.setBinlogStartPoint("binlog-001", 400);
          mysql.applyDdl(source, "db1", readFile("ddl/mysql-dbz-xxx.ddl"), this::printStatements);
      
          assertTableIncluded("connector_test.business_order_1");
          assertTableIncluded("connector_test.business_order_2");
          assertHistoryRecorded();
      }
      
      
      

       

      Show
      CREATE TABLE connector_test.business_order_1 ( `id` int (11) NOT NULL AUTO_INCREMENT, `code` varchar(32) NOT NULL COMMENT 'order code' , PRIMARY KEY (`id`), KEY `order_code_index` (`code`) COMMENT 'order index' ) ENGINE=InnoDB AUTO_INCREMENT=2000022760 DEFAULT CHARSET=utf8 COMMENT= 'order table' ; CREATE TABLE connector_test.business_order_2 ( `id` int (11) NOT NULL AUTO_INCREMENT, `code` varchar(32) NOT NULL COMMENT 'order code' , PRIMARY KEY (`id`), KEY `order_code_index` (`code`) COMMENT 'order index' ) ENGINE=InnoDB AUTO_INCREMENT=2000022760 DEFAULT CHARSET=utf8 COMMENT= 'order table' ; CREATE TEMPORARY TABLE connector_test.temp1 SELECT bo.id 'id' , bo.code '测试' from business_order_1 bo ; CREATE TEMPORARY TABLE connector_test.temp2 SELECT bo.id 'id' , bo.code '测试' from business_order_2 bo ; SELECT t1.测试 FROM temp1 t1 LEFT JOIN temp2 t2 on t1.id = t2.id;   @Test public void shouldAllowNonASSIICCharacters() { mysql = build .with(DatabaseHistory.SKIP_UNPARSEABLE_DDL_STATEMENTS, false ) .storeDatabaseHistoryInFile(TEST_FILE_PATH) .serverName(SERVER_NAME) .createSchemas(); mysql.start(); source.setBinlogStartPoint( "binlog-001" , 400); mysql.applyDdl(source, "db1" , readFile( "ddl/mysql-dbz-xxx.ddl" ), this ::printStatements); assertTableIncluded( "connector_test.business_order_1" ); assertTableIncluded( "connector_test.business_order_2" ); assertHistoryRecorded(); }  

      When DDL contain some non-asscii characters , DEBEZIUM will produce error message

              Unassigned Unassigned
              michael_hit001 michael wong (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: