diff options
author | Igor Babaev <igor@askmonty.org> | 2022-04-30 13:25:34 -0700 |
---|---|---|
committer | Igor Babaev <igor@askmonty.org> | 2022-04-30 13:25:34 -0700 |
commit | 6e7c6fcfd1f1ac131c423c1ba084d61abad10e8b (patch) | |
tree | 78ee695af4446d8273827f761f84ad4c66f82fde /mysql-test/main | |
parent | c8228369f6dad5cfd17c5a9d9ea1c5c3ecd30fe7 (diff) | |
download | mariadb-git-6e7c6fcfd1f1ac131c423c1ba084d61abad10e8b.tar.gz |
MDEV-28448 Assertion failure for SELECT with subquery using ON expression
This patch corrects the fix for MDEV-26412.
Note that when parsing an ON expression the pointer to the current select
is always in select_stack[select_stack_top - 1]. So the pointer to the
outer select (if any) is in select_stack[select_stack_top - 2].
The query manifesting this bug is added to the test case of MDEV-26412.
Diffstat (limited to 'mysql-test/main')
-rw-r--r-- | mysql-test/main/insert.result | 4 | ||||
-rw-r--r-- | mysql-test/main/insert.test | 5 |
2 files changed, 9 insertions, 0 deletions
diff --git a/mysql-test/main/insert.result b/mysql-test/main/insert.result index 1062ddd6a94..af7dcbedd1f 100644 --- a/mysql-test/main/insert.result +++ b/mysql-test/main/insert.result @@ -766,4 +766,8 @@ replace t4 select * from t1 left join t2 on (select t1.i from t3); ERROR 42S22: Unknown column 't1.i' in 'field list' drop table t1,t2,t3,t4; +create table t (a int); +select 1 in (select count(*) from t t1 join (t t2 join t t3 on (t1.a != 0))); +ERROR 42S22: Unknown column 't1.a' in 'on clause' +drop table t; # End of 10.4 tests diff --git a/mysql-test/main/insert.test b/mysql-test/main/insert.test index 9fd0933cc7c..27d44918bbb 100644 --- a/mysql-test/main/insert.test +++ b/mysql-test/main/insert.test @@ -633,4 +633,9 @@ replace t4 drop table t1,t2,t3,t4; +create table t (a int); +--error ER_BAD_FIELD_ERROR +select 1 in (select count(*) from t t1 join (t t2 join t t3 on (t1.a != 0))); +drop table t; + --echo # End of 10.4 tests |