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

Support ON as variable value

XMLWordPrintable

      ERROR   2022-03-21 20:05:40,241 0       io.debezium.connector.mysql.MySqlStreamingChangeEventSource     [blc-127.0.0.1:3306]    Error during binlog processing. Last offset stored = \{transaction_id=null, ts_sec=1647918340, file=master.000002, pos=26566, gtids=3b0f51ee-a08e-11ec-86ff-000c29221572:1-105, server_id=999, event=1}, binlog reader near position = master.000002/26566
      ERROR   2022-03-21 20:05:40,242 1       io.debezium.pipeline.ErrorHandler       [blc-127.0.0.1:3306]    Producer failure
      io.debezium.DebeziumException: Error processing binlog event
              at io.debezium.connector.mysql.MySqlStreamingChangeEventSource.handleEvent(MySqlStreamingChangeEventSource.java:369)
              at io.debezium.connector.mysql.MySqlStreamingChangeEventSource.lambda$execute$25(MySqlStreamingChangeEventSource.java:860)
              at com.github.shyiko.mysql.binlog.BinaryLogClient.notifyEventListeners(BinaryLogClient.java:1125)
              at com.github.shyiko.mysql.binlog.BinaryLogClient.listenForEventPackets(BinaryLogClient.java:973)
              at com.github.shyiko.mysql.binlog.BinaryLogClient.connect(BinaryLogClient.java:599)
              at com.github.shyiko.mysql.binlog.BinaryLogClient$7.run(BinaryLogClient.java:857)
              at java.base/java.lang.Thread.run(Thread.java:829)
      Caused by: io.debezium.text.ParsingException: DDL statement couldn't be parsed. Please open a Jira issue with the statement 'CREATE DEFINER=`leapdb`@`localhost` PROCEDURE `leapdb`.`create_child_views`(IN v_mview_id INT)
      BEGIN
        DECLARE v_new_mview_id INT;
        DECLARE v_needs_dependent_view BOOLEAN DEFAULT FALSE;
      
      
        SELECT count(*)
          INTO v_needs_dependent_view
          FROM leapdb.mview_expression
         WHERE mview_id = v_mview_id
           AND mview_expr_type in ('PERCENTILE','MIN','MAX','COUNT_DISTINCT', 'STDDEV_POP','VAR_POP', 'STDDEV_SAMP','VAR_SAMP','GROUP_CONCAT','BIT_AND','BIT_OR','BIT_XOR');
      
         
         SET v_new_mview_id := leapdb.get_id(leapdb.get_setting('mvlog_db'), concat('mv$', v_mview_id));
         IF v_new_mview_id is not null and v_new_mview_id != 0 THEN
           set @fv_force := 1;
           set @fv_silent := 1;
           CALL leapdb.drop(v_new_mview_id);
           DELETE from leapdb.mview_expression where mview_id = v_new_mview_id;
           DELETE from leapdb.mview_table where mview_id = v_new_mview_id;
           DELETE from leapdb.mview where mview_id = v_new_mview_id;
           SET v_new_mview_id := NULL;
         END IF;
      
        IF v_needs_dependent_view is not null and v_needs_dependent_view > 0 THEN
      
            
            CALL leapdb.create(leapdb.get_setting('mvlog_db'), concat('mv$',v_mview_id),'INCREMENTAL');
            SET v_new_mview_id := LAST_INSERT_ID();
            UPDATE leapdb.mview set parent_mview_id = v_mview_id where mview_id = v_new_mview_id;
      
      
            
            REPLACE INTO leapdb.mview_table
            (mview_table_id, mview_id, mview_table_name, mview_table_schema, mview_table_alias, mview_join_condition, mview_join_order)
            SELECT NULL,
                   v_new_mview_id,
                   mview_table_name,
                   mview_table_schema,
                   mview_table_alias,
                   mview_join_condition,
                   mview_join_order
              FROM leapdb.mview_table
             WHERE mview_id = v_mview_id;
      
      
            
            REPLACE INTO leapdb.mview_expression
            (mview_expression_id, mview_id, mview_expr_type, mview_expression, mview_alias, mview_expr_order)
            SELECT NULL,
                   v_new_mview_id,
                   if(mview_expr_type not in ('PERCENTILE','MIN','MAX','COUNT_DISTINCT','STDDEV_POP','STDDEV_SAMP','VAR_POP','VAR_SAMP','BIT_AND','BIT_OR','BIT_XOR','GROUP_CONCAT'), mview_expr_type, 'GROUP'),
                   IF(mview_expr_type = 'GROUP_CONCAT', leapdb.extract_gc_col(mview_expression), mview_expression),
                   mview_alias,         
                   mview_expr_order
              FROM leapdb.mview_expression
             WHERE mview_id = v_mview_id
               AND mview_expr_type in ('GROUP','WHERE','PERCENTILE','MIN','MAX','COUNT_DISTINCT', 'STDDEV_POP','STDDEV_SAMP','VAR_SAMP','VAR_POP','BIT_AND','BIT_OR','BIT_XOR','GROUP_CONCAT');
      
             
             CALL leapdb.add_expr(v_new_mview_id, 'COUNT', '*', 'CNT');
      
             
      
             
             SET max_sp_recursion_depth=255;
             SET unique_checks=off;
             CALL leapdb.enable(v_new_mview_id);
             SET unique_checks=on;
      
        END IF;
      END'
      no viable alternative at input 'CREATE DEFINER=`leapdb`@`localhost` PROCEDURE `leapdb`.`create_child_views`(IN v_mview_id INT)\nBEGIN\n  DECLARE v_new_mview_id INT;\n  DECLARE v_needs_dependent_view BOOLEAN DEFAULT FALSE;\n\n\n  SELECT count(*)\n    INTO v_needs_dependent_view\n    FROM leapdb.mview_expression\n   WHERE mview_id = v_mview_id\n     AND mview_expr_type in ('PERCENTILE','MIN','MAX','COUNT_DISTINCT', 'STDDEV_POP','VAR_POP', 'STDDEV_SAMP','VAR_SAMP','GROUP_CONCAT','BIT_AND','BIT_OR','BIT_XOR');\n\n   \n   SET v_new_mview_id := leapdb.get_id(leapdb.get_setting('mvlog_db'), concat('mv$', v_mview_id));\n   IF v_new_mview_id is not null and v_new_mview_id != 0 THEN\n     set @fv_force := 1;\n     set @fv_silent := 1;\n     CALL leapdb.drop(v_new_mview_id);\n     DELETE from leapdb.mview_expression where mview_id = v_new_mview_id;\n     DELETE from leapdb.mview_table where mview_id = v_new_mview_id;\n     DELETE from leapdb.mview where mview_id = v_new_mview_id;\n     SET v_new_mview_id := NULL;\n   END IF;\n\n  IF v_needs_dependent_view is not null and v_needs_dependent_view > 0 THEN\n\n      \n      CALL leapdb.create(leapdb.get_setting('mvlog_db'), concat('mv$',v_mview_id),'INCREMENTAL');\n      SET v_new_mview_id := LAST_INSERT_ID();\n      UPDATE leapdb.mview set parent_mview_id = v_mview_id where mview_id = v_new_mview_id;\n\n\n      \n      REPLACE INTO leapdb.mview_table\n      (mview_table_id, mview_id, mview_table_name, mview_table_schema, mview_table_alias, mview_join_condition, mview_join_order)\n      SELECT NULL,\n             v_new_mview_id,\n             mview_table_name,\n             mview_table_schema,\n             mview_table_alias,\n             mview_join_condition,\n             mview_join_order\n        FROM leapdb.mview_table\n       WHERE mview_id = v_mview_id;\n\n\n      \n      REPLACE INTO leapdb.mview_expression\n      (mview_expression_id, mview_id, mview_expr_type, mview_expression, mview_alias, mview_expr_order)\n      SELECT NULL,\n\t     v_new_mview_id,\n             if(mview_expr_type not in ('PERCENTILE','MIN','MAX','COUNT_DISTINCT','STDDEV_POP','STDDEV_SAMP','VAR_POP','VAR_SAMP','BIT_AND','BIT_OR','BIT_XOR','GROUP_CONCAT'), mview_expr_type, 'GROUP'),\n             IF(mview_expr_type = 'GROUP_CONCAT', leapdb.extract_gc_col(mview_expression), mview_expression),\n             mview_alias,         \n             mview_expr_order\n        FROM leapdb.mview_expression\n       WHERE mview_id = v_mview_id\n         AND mview_expr_type in ('GROUP','WHERE','PERCENTILE','MIN','MAX','COUNT_DISTINCT', 'STDDEV_POP','STDDEV_SAMP','VAR_SAMP','VAR_POP','BIT_AND','BIT_OR','BIT_XOR','GROUP_CONCAT');\n\n       \n       CALL leapdb.add_expr(v_new_mview_id, 'COUNT', '*', 'CNT');\n\n       \n\n       \n       SET max_sp_recursion_depth=255;\n       SET unique_checks=off;\n       CALL leapdb.enable(v_new_mview_id);\n       SET unique_checks=on;'
              at io.debezium.antlr.ParsingErrorListener.syntaxError(ParsingErrorListener.java:43)
              at org.antlr.v4.runtime.ProxyErrorListener.syntaxError(ProxyErrorListener.java:41)
              at org.antlr.v4.runtime.Parser.notifyErrorListeners(Parser.java:544)
              at org.antlr.v4.runtime.DefaultErrorStrategy.reportNoViableAlternative(DefaultErrorStrategy.java:310)
              at org.antlr.v4.runtime.DefaultErrorStrategy.reportError(DefaultErrorStrategy.java:136)
              at io.debezium.ddl.parser.mysql.generated.MySqlParser.sqlStatements(MySqlParser.java:1223)
              at io.debezium.ddl.parser.mysql.generated.MySqlParser.root(MySqlParser.java:945)
              at io.debezium.connector.mysql.antlr.MySqlAntlrDdlParser.parseTree(MySqlAntlrDdlParser.java:73)
              at io.debezium.connector.mysql.antlr.MySqlAntlrDdlParser.parseTree(MySqlAntlrDdlParser.java:45)
              at io.debezium.antlr.AntlrDdlParser.parse(AntlrDdlParser.java:82)
              at io.debezium.connector.mysql.MySqlDatabaseSchema.parseDdl(MySqlDatabaseSchema.java:223)
              at io.debezium.connector.mysql.MySqlDatabaseSchema.parseStreamingDdl(MySqlDatabaseSchema.java:209)
              at io.debezium.connector.mysql.MySqlStreamingChangeEventSource.handleQueryEvent(MySqlStreamingChangeEventSource.java:576)
              at io.debezium.connector.mysql.MySqlStreamingChangeEventSource.lambda$execute$14(MySqlStreamingChangeEventSource.java:832)
              at io.debezium.connector.mysql.MySqlStreamingChangeEventSource.handleEvent(MySqlStreamingChangeEventSource.java:349)
              ... 6 more
      Caused by: org.antlr.v4.runtime.NoViableAltException
              at org.antlr.v4.runtime.atn.ParserATNSimulator.noViableAlt(ParserATNSimulator.java:2026)
              at org.antlr.v4.runtime.atn.ParserATNSimulator.execATN(ParserATNSimulator.java:467)
              at org.antlr.v4.runtime.atn.ParserATNSimulator.adaptivePredict(ParserATNSimulator.java:393)
              at io.debezium.ddl.parser.mysql.generated.MySqlParser.sqlStatements(MySqlParser.java:1021)
              ... 15 more
      ERROR   2022-03-21 20:05:40,268 27      io.debezium.embedded.EmbeddedEngine     [pool-1-thread-1]       Stopping connector after error in the application's handler method: null
      java.lang.NullPointerException
              at com.leapdb.cdc.LeapCDC.sendRecord(LeapCDC.java:321)
              at io.debezium.embedded.EmbeddedEngine$1.handleBatch(EmbeddedEngine.java:473)
              at io.debezium.embedded.EmbeddedEngine.run(EmbeddedEngine.java:821)
              at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
              at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
              at java.base/java.lang.Thread.run(Thread.java:829)
      Engine terminated
      Requesting embedded engine to shut down
      

              vjuranek@redhat.com Vojtech Juranek
              greenlion@gmail.com Justin Swanhart (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: