Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-42412

XMLTYPE method call on SP variable is binlogged verbatim in statement format, replica fails with "FUNCTION x.getRootElement does not exist"

    XMLWordPrintable

Details

    Description

      SP variable references are rewritten to NAME_CONST() in the statement binlog. XMLTYPE method items aren't, so the replica gets the original text and has no variable x.

      --source include/have_binlog_format_statement.inc
      --source include/master-slave.inc
      CREATE TABLE t2 (a TEXT);
      --delimiter $$
      CREATE PROCEDURE p1()
      BEGIN
        DECLARE x XMLTYPE DEFAULT '<root>9</root>';
        INSERT INTO t2 VALUES (x.getRootElement());
      END$$
      --delimiter ;
      CALL p1();
      --connection slave
      --let $slave_sql_errno= 1305
      --source include/wait_for_slave_sql_error.inc
      --let $status_items= Last_SQL_Error
      --source include/show_slave_status.inc

      Last_SQL_Error = 'Error 'FUNCTION x.getRootElement does not exist' on query. Default database: 'test'. Query: 'INSERT INTO t2 VALUES (x.getRootElement())''

      Attachments

        Issue Links

          Activity

            People

              holyfoot Alexey Botchkov
              alice Alice Sherepa
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.