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

SBR failure upon executing a prepared statement with input placeholder under anonymous block

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: N/A
    • Fix Version/s: 10.1.1
    • Component/s: None
    • Labels:
      None

      Description

      
      --source include/master-slave.inc
      --source include/have_binlog_format_statement.inc
      
      CREATE TABLE t1 (a INT PRIMARY KEY);
      
      PREPARE stmt FROM "BEGIN NOT ATOMIC
        INSERT INTO t1 VALUES (?);
      END";
      SET @val = 1;
      EXECUTE stmt USING @val;
      DEALLOCATE PREPARE stmt;
      
      DROP TABLE t1;
      
      --sync_slave_with_master
      

      Binlog:

      CREATE TABLE t1 (a INT PRIMARY KEY)
      /*!*/;
      # at 449
      #140819 12:06:18 server id 1  end_log_pos 487   GTID 0-1-2
      /*!100001 SET @@session.gtid_seq_no=2*//*!*/;
      BEGIN
      /*!*/;
      # at 487
      #140819 12:06:18 server id 1  end_log_pos 575   Query   thread_id=8     exec_time=0     error_code=0
      SET TIMESTAMP=1408435578/*!*/;
      SET @@session.sql_mode=11936128518282651045/*!*/;
      INSERT INTO t1 VALUES (?)
      /*!*/;
      # at 575
      #140819 12:06:18 server id 1  end_log_pos 644   Query   thread_id=8     exec_time=0     error_code=0
      SET TIMESTAMP=1408435578/*!*/;
      COMMIT
      /*!*/;
      # at 644
      #140819 12:06:18 server id 1  end_log_pos 682   GTID 0-1-3
      /*!100001 SET @@session.gtid_seq_no=3*//*!*/;
      # at 682
      #140819 12:06:18 server id 1  end_log_pos 786   Query   thread_id=8     exec_time=0     error_code=0
      SET TIMESTAMP=1408435578/*!*/;
      SET @@session.sql_mode=0/*!*/;
      DROP TABLE `t1` /* generated by server */
      

      SQL thread failure:

      Last_Errno	1064
      Last_Error	Error 'You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '?)' at line 1' on query. Default database: 'test'. Query: 'INSERT INTO t1 VALUES (?)'
      
      commit 6502f42f679e605fcdbd6c8b49d2813f553001b0
      Author: Sergei Golubchik <serg@mariadb.org>
      Date:   Mon Aug 18 14:28:48 2014 +0200
      

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              There are no comments yet on this issue.

                People

                • Assignee:
                  serg Sergei Golubchik
                  Reporter:
                  elenst Elena Stepanova
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:

                    Time Tracking

                    Estimated:
                    Original Estimate - Not Specified
                    Not Specified
                    Remaining:
                    Remaining Estimate - 0 minutes
                    0m
                    Logged:
                    Time Spent - 1 day, 1 hour
                    1d 1h