Skip to content

Commit bccd9d0

Browse files
committed
MDEV-20108: [ERROR] mysqld got signal 11 in st_select_lex::add_table_to_list
Use the same select as for usual table list.
1 parent 819c40d commit bccd9d0

File tree

3 files changed

+28
-1
lines changed

3 files changed

+28
-1
lines changed

mysql-test/main/parser.result

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1784,4 +1784,17 @@ a
17841784
select * from t1 for update;
17851785
a
17861786
drop table t1;
1787+
#
1788+
# MDEV-20108: [ERROR] mysqld got signal 11 in
1789+
# st_select_lex::add_table_to_list
1790+
#
1791+
CREATE TABLE t1 (c1 INT NULL);
1792+
CREATE TABLE t2 (c1 INT NULL);
1793+
SET STATEMENT max_statement_time=900 FOR LOCK TABLES `t1` WRITE;
1794+
select * from t1;
1795+
c1
1796+
select * from t2;
1797+
ERROR HY000: Table 't2' was not locked with LOCK TABLES
1798+
SET STATEMENT max_statement_time=900 FOR unlock tables;
1799+
drop table t1, t2;
17871800
# End of 10.4 tests

mysql-test/main/parser.test

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1552,4 +1552,18 @@ create table t1 (a int);
15521552
select * from t1 for update;
15531553
drop table t1;
15541554

1555+
--echo #
1556+
--echo # MDEV-20108: [ERROR] mysqld got signal 11 in
1557+
--echo # st_select_lex::add_table_to_list
1558+
--echo #
1559+
CREATE TABLE t1 (c1 INT NULL);
1560+
CREATE TABLE t2 (c1 INT NULL);
1561+
1562+
SET STATEMENT max_statement_time=900 FOR LOCK TABLES `t1` WRITE;
1563+
select * from t1;
1564+
--error ER_TABLE_NOT_LOCKED
1565+
select * from t2;
1566+
SET STATEMENT max_statement_time=900 FOR unlock tables;
1567+
drop table t1, t2;
1568+
15551569
--echo # End of 10.4 tests

sql/sql_yacc.yy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16715,7 +16715,7 @@ table_lock:
1671516715
? MDL_SHARED_WRITE
1671616716
: MDL_SHARED_NO_READ_WRITE;
1671716717

16718-
if (unlikely(!Select->
16718+
if (unlikely(!Lex->current_select_or_default()->
1671916719
add_table_to_list(thd, $1, $2, table_options,
1672016720
lock_type, mdl_type)))
1672116721
MYSQL_YYABORT;

0 commit comments

Comments
 (0)