Debian Codegraph @

mysql-test/suite/binlog/r/binlog_spurious_ddl_errors.result

raw
1 SET @old_binlog_format= @@global.binlog_format;
2 INSTALL PLUGIN example SONAME 'ha_example';
3 ################################################################################
4 # Verifies if ER_BINLOG_STMT_MODE_AND_ROW_ENGINE happens by setting the binlog
5 # format to STATEMENT and the transaction isolation level to READ COMMITTED as
6 # such changes force Innodb to accept changes in the row format.
7 #
8 # When CREATE TABLE, ALTER TABLE, CREATE INDEX and CREATE TRIGGER are executed
9 # any error should be triggered.
10 #
11 # In contrast, CREATE TABLE ... SELECT should trigger the following error:
12 # ER_BINLOG_STMT_MODE_AND_ROW_ENGINE.
13 ################################################################################
14 SET binlog_format = STATEMENT;
15 SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
16 CREATE TABLE t_row (a VARCHAR(100)) ENGINE = InnoDB;
17 ALTER TABLE t_row ADD COLUMN b INT;
18 CREATE TRIGGER trig_row BEFORE INSERT ON t_row FOR EACH ROW INSERT INTO t_stmt VALUES (1);
19 CREATE INDEX i ON t_row(a);
20 CREATE TABLE t_row_new ENGINE = InnoDB SELECT * FROM t_row;
21 ERROR HY000: Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-based logging.
22 DROP TABLE t_row;
23
24
25 ################################################################################
26 # Verifies if ER_BINLOG_ROW_MODE_AND_STMT_ENGINE happens by setting the binlog
27 # format to ROW and using a engine, i.e. EXAMPLE, that only supports STATEMENT.
28 #
29 # When CREATE TABLE, ALTER TABLE, CREATE INDEX and CREATE TRIGGER are executed
30 # the error ER_BINLOG_ROW_MODE_AND_STMT_ENGINE is not triggered. Note that other
31 # errors are triggered due to restrictions in the engine.
32 #
33 # In contrast, CREATE TABLE ... SELECT should trigger the following error:
34 # ER_BINLOG_ROW_MODE_AND_STMT_ENGINE.
35 ################################################################################
36 SET binlog_format = ROW;
37 CREATE TABLE t_stmt (a VARCHAR(100)) ENGINE = EXAMPLE;
38 ALTER TABLE t_stmt ADD COLUMN b INT;
39 CREATE TRIGGER trig_stmt BEFORE INSERT ON t_stmt FOR EACH ROW INSERT INTO t_stmt VALUES (1);
40 CREATE INDEX i ON t_stmt(a);
41 ERROR 42000: Specified key was too long; max key length is 0 bytes
42 CREATE TABLE t_stmt_new ENGINE = EXAMPLE SELECT * FROM t_stmt;
43 ERROR HY000: Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = ROW and at least one table uses a storage engine limited to statement-based logging
44 DROP TABLE t_stmt;
45
46
47 ################################################################################
48 # CLEAN UP #
49 ################################################################################
50 flush tables;
51 UNINSTALL PLUGIN example;
52 SET @@global.binlog_format = @old_binlog_format;
53 SET @@session.binlog_format = @old_binlog_format;