mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +03:00
MDEV-5602: CREATE OR REPLACE obtains stricter locks than the connection had before
mysql-test/r/create_or_replace.result: Added test case mysql-test/t/create_or_replace.test: Added test case sql/sql_base.cc: Downgrade locks in LOCK TABLES + CREATE TABLE OR REPLACE sql/sql_table.cc: Downgrade locks in LOCK TABLES + CREATE TABLE OR REPLACE
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
#
|
||||
|
||||
--source include/have_innodb.inc
|
||||
--source include/have_metadata_lock_info.inc
|
||||
--disable_warnings
|
||||
drop table if exists t1,t2,t3;
|
||||
--enable_warnings
|
||||
@@ -265,6 +266,27 @@ create or replace table t1 (a int);
|
||||
drop table t1;
|
||||
drop view t1;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-5602 CREATE OR REPLACE obtains stricter locks than the
|
||||
--echo # connection had before
|
||||
--echo #
|
||||
|
||||
create table t1 (a int);
|
||||
lock table t1 write, t2 read;
|
||||
--replace_column 1 #
|
||||
select * from information_schema.metadata_lock_info;
|
||||
create or replace table t1 (i int);
|
||||
--replace_column 1 #
|
||||
select * from information_schema.metadata_lock_info;
|
||||
create or replace table t1 like t2;
|
||||
--replace_column 1 #
|
||||
select * from information_schema.metadata_lock_info;
|
||||
create or replace table t1 select 1 as f1;
|
||||
--replace_column 1 #
|
||||
select * from information_schema.metadata_lock_info;
|
||||
drop table t1;
|
||||
unlock tables;
|
||||
|
||||
#
|
||||
# Cleanup
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user