summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2022-05-18 13:11:16 +0200
committerSergei Golubchik <serg@mariadb.org>2022-05-18 13:11:16 +0200
commit0ba528fe56f6c637d9fbc9d177a62610038fd519 (patch)
treee6df324715a545f1f9a82e7ed5cb37eca32d9fbd /mysql-test
parent84984b79f27399d015c43a51d2b1967838119d34 (diff)
downloadmariadb-git-10.2.tar.gz
MDEV-28606 Server crashes in st_select_lex::add_table_to_list instead of error 1066: Not unique table/aliasmariadb-10.2.44bb-10.2-release10.2
10.2-only fix, 10.3+ uses LEX_STRING's and checks the length first
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/parser.result8
-rw-r--r--mysql-test/t/parser.test9
2 files changed, 17 insertions, 0 deletions
diff --git a/mysql-test/r/parser.result b/mysql-test/r/parser.result
index e8bf9d12a33..870bbfbf904 100644
--- a/mysql-test/r/parser.result
+++ b/mysql-test/r/parser.result
@@ -1409,5 +1409,13 @@ Database Collation latin1_swedish_ci
drop function a;
set timestamp=default;
#
+# MDEV-28606 Server crashes in st_select_lex::add_table_to_list instead of error 1066: Not unique table/alias
+#
+create table t1 (i int) ;
+insert into t1 values (1),(2),(3) ;
+with cte1 as (select i from t1) select i from cte1 natural join cte1;
+ERROR 42000: Not unique table/alias: 'cte1'
+drop table t1;
+#
# End of 10.2 tests
#
diff --git a/mysql-test/t/parser.test b/mysql-test/t/parser.test
index 095d274724b..4d35a53ecf6 100644
--- a/mysql-test/t/parser.test
+++ b/mysql-test/t/parser.test
@@ -1433,5 +1433,14 @@ drop function a;
set timestamp=default;
--echo #
+--echo # MDEV-28606 Server crashes in st_select_lex::add_table_to_list instead of error 1066: Not unique table/alias
+--echo #
+create table t1 (i int) ;
+insert into t1 values (1),(2),(3) ;
+--error 1066
+with cte1 as (select i from t1) select i from cte1 natural join cte1;
+drop table t1;
+
+--echo #
--echo # End of 10.2 tests
--echo #