1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

MDEV-19198 - DBUG assert in CREATE IF NOT EXIST under LOCK TABLES WRITE

Fixed the ASSERT to take care of the case when table already existed.
This commit is contained in:
Monty
2021-04-29 17:40:32 +03:00
committed by Sergei Golubchik
parent 0bc3a0801c
commit 0b59320d3d
3 changed files with 51 additions and 8 deletions

View File

@ -535,3 +535,25 @@ DROP TABLE t;
#
# End of 10.5 tests
#
#
# MDEV-19198 Assertion `(create_info->tmp_table()) || ....`
# failed in mysql_create_like_table
#
CREATE TABLE t1 (c INT);
CREATE TABLE t2 (c INT);
LOCK TABLES t1 WRITE, t2 READ;
CREATE TABLE IF NOT EXISTS t1 LIKE t2;
Warnings:
Note 1050 Table 't1' already exists
UNLOCK TABLES;
LOCK TABLES t1 READ , t2 READ;
CREATE TABLE IF NOT EXISTS t1 LIKE t2;
ERROR HY000: Table 't1' was locked with a READ lock and can't be updated
UNLOCK TABLES;
CREATE TABLE IF NOT EXISTS t1 LIKE t2;
Warnings:
Note 1050 Table 't1' already exists
DROP TABLES t1,t2;
#
# End of 10.6 tests
#