1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

MDEV-19273: Server crash in MDL_ticket::has_stronger_or_equal_type or Assertion `thd->mdl_context.is_lock_owner(MDL_key::TABLE, table->db.str, table->table_name.str, MDL_SHARED)' failed in mysql_rm_table_no_locks

Early report error in case of DROP SEQUENCE <non-sequence>

Do not use error variable for other purposes except error.
This commit is contained in:
Oleksandr Byelkin
2020-03-22 11:33:53 +01:00
parent bc2dc83cb5
commit 86fc37b668
5 changed files with 169 additions and 14 deletions

View File

@ -300,4 +300,63 @@ update t1 set p_first_name='Yunxi' where p_id=1;
drop view v2;
drop table t1,t2;
drop sequence s1;
#
# MDEV-19273:Server crash in MDL_ticket::has_stronger_or_equal_type or
# Assertion `thd->mdl_context.is_lock_owner(MDL_key::TABLE,
# table->db.str, table->table_name.str, MDL_SHARED)' failed
# in mysql_rm_table_no_locks
#
CREATE TABLE t1 (a INT);
CREATE TEMPORARY TABLE tmp (b INT);
LOCK TABLE t1 READ;
DROP SEQUENCE tmp;
ERROR 42S02: 'test.tmp' is not a SEQUENCE
DROP TEMPORARY SEQUENCE tmp;
ERROR 42S02: 'test.tmp' is not a SEQUENCE
DROP SEQUENCE t1;
ERROR HY000: Table 't1' was locked with a READ lock and can't be updated
DROP TEMPORARY SEQUENCE t1;
ERROR 42S02: Unknown SEQUENCE: 'test.t1'
UNLOCK TABLES;
DROP SEQUENCE t1;
ERROR 42S02: 'test.t1' is not a SEQUENCE
DROP TEMPORARY SEQUENCE t1;
ERROR 42S02: Unknown SEQUENCE: 'test.t1'
DROP TABLE t1;
CREATE TABLE t (a INT);
CREATE TEMPORARY TABLE s (f INT);
CREATE SEQUENCE s;
LOCK TABLE t WRITE;
DROP SEQUENCE s;
ERROR 42S02: 'test.s' is not a SEQUENCE
DROP TEMPORARY SEQUENCE s;
ERROR 42S02: 'test.s' is not a SEQUENCE
UNLOCK TABLES;
CREATE TEMPORARY SEQUENCE s;
LOCK TABLE t WRITE;
DROP TEMPORARY SEQUENCE s;
UNLOCK TABLES;
DROP TEMPORARY TABLE s;
DROP SEQUENCE s;
create table s(a INT);
CREATE TEMPORARY TABLE s (f INT);
LOCK TABLE t WRITE;
DROP TEMPORARY TABLE s;
CREATE TEMPORARY TABLE s (f INT);
DROP TABLE s;
DROP TABLE s;
ERROR HY000: Table 's' was not locked with LOCK TABLES
UNLOCK TABLES;
DROP TABLE s;
CREATE VIEW v1 as SELECT * FROM t;
CREATE SEQUENCE s;
DROP SEQUENCE IF EXISTS v1;
Warnings:
Note 4091 Unknown SEQUENCE: 'test.v1'
DROP VIEW IF EXISTS s;
Warnings:
Note 4092 Unknown VIEW: 'test.s'
DROP VIEW v1;
DROP SEQUENCE s;
DROP TABLE t;
# End of 10.3 tests