Merge branch '10.4-MDEV-22222' of https://github.com/codership/mariadb-server into 10.4-MDEV-22222

This commit is contained in:
Julius Goryavsky 2020-07-03 16:17:59 +02:00
commit 1bf863a91a
3 changed files with 39 additions and 0 deletions

View File

@ -0,0 +1,12 @@
connection node_2;
connection node_1;
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
START TRANSACTION;
INSERT INTO t1 VALUES (1);
LOCK TABLES t2 READ;
ERROR 42S02: Table 'test.t2' doesn't exist
START TRANSACTION;
INSERT INTO t1 VALUES (1);
LOCK TABLES t1 READ;
UNLOCK TABLES;
DROP TABLE t1;

View File

@ -0,0 +1,21 @@
#
# Check `LOCK TABLES` command with or without existing table in database.
# Test case for MDEV-22222 / MDEV-22223
#
--source include/galera_cluster.inc
--source include/have_innodb.inc
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
START TRANSACTION;
INSERT INTO t1 VALUES (1);
--error ER_NO_SUCH_TABLE
LOCK TABLES t2 READ;
START TRANSACTION;
INSERT INTO t1 VALUES (1);
LOCK TABLES t1 READ;
UNLOCK TABLES;
DROP TABLE t1;

View File

@ -4990,6 +4990,12 @@ mysql_execute_command(THD *thd)
if (res)
goto error;
#ifdef WITH_WSREP
/* Clean up the previous transaction on implicit commit. */
if (wsrep_on(thd) && !wsrep_not_committed(thd) && wsrep_after_statement(thd))
goto error;
#endif
/* We can't have any kind of table locks while backup is active */
if (thd->current_backup_stage != BACKUP_FINISHED)
{