summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2019-07-24 13:20:36 +0200
committerOleksandr Byelkin <sanja@mariadb.com>2019-07-24 13:20:36 +0200
commitbccd9d0e3a96ec026d01d24abac1cea7959f0d02 (patch)
tree169d3fba99fcd8490bf879d8f26e0c21c4d75a7f
parent819c40d694071e56adb62ded97561717edb59f23 (diff)
downloadmariadb-git-bb-10.4-MDEV-20108.tar.gz
MDEV-20108: [ERROR] mysqld got signal 11 in st_select_lex::add_table_to_listbb-10.4-MDEV-20108
Use the same select as for usual table list.
-rw-r--r--mysql-test/main/parser.result13
-rw-r--r--mysql-test/main/parser.test14
-rw-r--r--sql/sql_yacc.yy2
3 files changed, 28 insertions, 1 deletions
diff --git a/mysql-test/main/parser.result b/mysql-test/main/parser.result
index 2e2342161fc..2b4a0bb7163 100644
--- a/mysql-test/main/parser.result
+++ b/mysql-test/main/parser.result
@@ -1784,4 +1784,17 @@ a
select * from t1 for update;
a
drop table t1;
+#
+# MDEV-20108: [ERROR] mysqld got signal 11 in
+# st_select_lex::add_table_to_list
+#
+CREATE TABLE t1 (c1 INT NULL);
+CREATE TABLE t2 (c1 INT NULL);
+SET STATEMENT max_statement_time=900 FOR LOCK TABLES `t1` WRITE;
+select * from t1;
+c1
+select * from t2;
+ERROR HY000: Table 't2' was not locked with LOCK TABLES
+SET STATEMENT max_statement_time=900 FOR unlock tables;
+drop table t1, t2;
# End of 10.4 tests
diff --git a/mysql-test/main/parser.test b/mysql-test/main/parser.test
index 35a2334eec2..b3cfcfb4fcc 100644
--- a/mysql-test/main/parser.test
+++ b/mysql-test/main/parser.test
@@ -1552,4 +1552,18 @@ create table t1 (a int);
select * from t1 for update;
drop table t1;
+--echo #
+--echo # MDEV-20108: [ERROR] mysqld got signal 11 in
+--echo # st_select_lex::add_table_to_list
+--echo #
+CREATE TABLE t1 (c1 INT NULL);
+CREATE TABLE t2 (c1 INT NULL);
+
+SET STATEMENT max_statement_time=900 FOR LOCK TABLES `t1` WRITE;
+select * from t1;
+--error ER_TABLE_NOT_LOCKED
+select * from t2;
+SET STATEMENT max_statement_time=900 FOR unlock tables;
+drop table t1, t2;
+
--echo # End of 10.4 tests
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index 5dd1011c07e..104d47f7cad 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -16715,7 +16715,7 @@ table_lock:
? MDL_SHARED_WRITE
: MDL_SHARED_NO_READ_WRITE;
- if (unlikely(!Select->
+ if (unlikely(!Lex->current_select_or_default()->
add_table_to_list(thd, $1, $2, table_options,
lock_type, mdl_type)))
MYSQL_YYABORT;