mirror of
https://github.com/MariaDB/server.git
synced 2025-09-02 09:41:40 +03:00
MDEV-6924 : Server crashed on CREATE TABLE ... SELECT
Do not allow server to start if binlog_format is set to a format other than ROW. Also restrict the change of GLOBAL/SESSION binlog_format value at runtime.
This commit is contained in:
23
mysql-test/suite/galera/r/create.result
Normal file
23
mysql-test/suite/galera/r/create.result
Normal file
@@ -0,0 +1,23 @@
|
||||
#
|
||||
# MDEV-6924 : Server crashed on CREATE TABLE ... SELECT
|
||||
#
|
||||
SET @wsrep_forced_binlog_format_saved=@@GLOBAL.wsrep_forced_binlog_format;
|
||||
SET @@GLOBAL.wsrep_forced_binlog_format=STATEMENT;
|
||||
SHOW VARIABLES LIKE '%log%bin%';
|
||||
Variable_name Value
|
||||
log_bin OFF
|
||||
log_bin_trust_function_creators ON
|
||||
sql_log_bin ON
|
||||
USE test;
|
||||
CREATE TABLE t1(i INT) ENGINE=INNODB;
|
||||
INSERT INTO t1 VALUES(1);
|
||||
CREATE TEMPORARY TABLE `t1_temp` AS SELECT * FROM `t1` WHERE i = 1;
|
||||
SELECT * FROM t1;
|
||||
i
|
||||
1
|
||||
SELECT * FROM t1_temp;
|
||||
i
|
||||
1
|
||||
DROP TABLE t1;
|
||||
SET @@GLOBAL.wsrep_forced_binlog_format=@wsrep_forced_binlog_format_saved;
|
||||
# End of tests
|
26
mysql-test/suite/galera/t/create.test
Normal file
26
mysql-test/suite/galera/t/create.test
Normal file
@@ -0,0 +1,26 @@
|
||||
--source include/galera_cluster.inc
|
||||
--source include/have_innodb.inc
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-6924 : Server crashed on CREATE TABLE ... SELECT
|
||||
--echo #
|
||||
|
||||
SET @wsrep_forced_binlog_format_saved=@@GLOBAL.wsrep_forced_binlog_format;
|
||||
SET @@GLOBAL.wsrep_forced_binlog_format=STATEMENT;
|
||||
|
||||
# @@log_bin must be OFF
|
||||
SHOW VARIABLES LIKE '%log%bin%';
|
||||
|
||||
USE test;
|
||||
CREATE TABLE t1(i INT) ENGINE=INNODB;
|
||||
INSERT INTO t1 VALUES(1);
|
||||
CREATE TEMPORARY TABLE `t1_temp` AS SELECT * FROM `t1` WHERE i = 1;
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1_temp;
|
||||
|
||||
# Cleanup
|
||||
DROP TABLE t1;
|
||||
SET @@GLOBAL.wsrep_forced_binlog_format=@wsrep_forced_binlog_format_saved;
|
||||
|
||||
--echo # End of tests
|
||||
|
@@ -1,5 +1,6 @@
|
||||
call mtr.add_suppression("WSREP: cannot get fake InnoDB transaction ID");
|
||||
call mtr.add_suppression("WSREP: Could not open saved state file for reading:.*");
|
||||
call mtr.add_suppression("WSREP: MariaDB Galera does not support binlog format.*");
|
||||
SHOW VARIABLES LIKE 'binlog_format';
|
||||
Variable_name Value
|
||||
binlog_format ROW
|
||||
@@ -33,3 +34,18 @@ CREATE TABLE IF NOT EXISTS test.t3 AS SELECT * FROM information_schema.routines
|
||||
DROP TABLE IF EXISTS test.t1;
|
||||
DROP TABLE IF EXISTS test.t2;
|
||||
DROP TABLE IF EXISTS test.t3;
|
||||
SET @@GLOBAL.binlog_format=STATEMENT;
|
||||
ERROR 42000: Variable 'binlog_format' can't be set to the value of 'STATEMENT'
|
||||
SHOW GLOBAL VARIABLES LIKE 'binlog_format';
|
||||
Variable_name Value
|
||||
binlog_format ROW
|
||||
SET @@GLOBAL.binlog_format=MIXED;
|
||||
ERROR 42000: Variable 'binlog_format' can't be set to the value of 'MIXED'
|
||||
SHOW GLOBAL VARIABLES LIKE 'binlog_format';
|
||||
Variable_name Value
|
||||
binlog_format ROW
|
||||
SET @@GLOBAL.binlog_format=ROW;
|
||||
SHOW GLOBAL VARIABLES LIKE 'binlog_format';
|
||||
Variable_name Value
|
||||
binlog_format ROW
|
||||
# End of test.
|
||||
|
@@ -5,6 +5,7 @@
|
||||
#
|
||||
call mtr.add_suppression("WSREP: cannot get fake InnoDB transaction ID");
|
||||
call mtr.add_suppression("WSREP: Could not open saved state file for reading:.*");
|
||||
call mtr.add_suppression("WSREP: MariaDB Galera does not support binlog format.*");
|
||||
|
||||
SHOW VARIABLES LIKE 'binlog_format';
|
||||
-- error ER_WRONG_VALUE_FOR_VAR
|
||||
@@ -25,3 +26,15 @@ DROP TABLE IF EXISTS test.t1;
|
||||
DROP TABLE IF EXISTS test.t2;
|
||||
DROP TABLE IF EXISTS test.t3;
|
||||
|
||||
-- error ER_WRONG_VALUE_FOR_VAR
|
||||
SET @@GLOBAL.binlog_format=STATEMENT;
|
||||
SHOW GLOBAL VARIABLES LIKE 'binlog_format';
|
||||
|
||||
-- error ER_WRONG_VALUE_FOR_VAR
|
||||
SET @@GLOBAL.binlog_format=MIXED;
|
||||
SHOW GLOBAL VARIABLES LIKE 'binlog_format';
|
||||
|
||||
SET @@GLOBAL.binlog_format=ROW;
|
||||
SHOW GLOBAL VARIABLES LIKE 'binlog_format';
|
||||
|
||||
--echo # End of test.
|
||||
|
@@ -1,4 +1,5 @@
|
||||
--source include/have_wsrep.inc
|
||||
--source include/have_binlog_format_row.inc
|
||||
|
||||
--echo
|
||||
--echo #
|
||||
|
Reference in New Issue
Block a user