mariadb/mysql-test/suite/rpl/t/create_or_replace2.test

42 lines
975 B
Text

--source include/have_innodb.inc
--source include/have_binlog_format_row_or_statement.inc
--source include/have_metadata_lock_info.inc
--source include/master-slave.inc
--echo #
--echo # MDEV-6525 ; Problems with CREATE OR REPLACE under lock
--echo #
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
CREATE FUNCTION f1() RETURNS INT RETURN ( SELECT MAX(a) FROM t1 );
--connect (con1,localhost,root,,test)
CREATE TEMPORARY TABLE tmp (b INT) ENGINE=InnoDB;
LOCK TABLE t1 WRITE;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
CREATE OR REPLACE TABLE t1 LIKE tmp;
SHOW CREATE TABLE t1;
--connection default
set session lock_wait_timeout=1;
--error 1205
SELECT f1();
set session lock_wait_timeout=@@global.lock_wait_timeout;
--send SELECT f1()
--connection con1
# This is here just in case, any timeout should be ok
--sleep 1
unlock tables;
--connection default
--error 1054
--reap
--disconnect con1
# Cleanup
drop function f1;
drop table t1;
--source include/rpl_end.inc