diff options
author | unknown <gkodinov/kgeorge@magare.gmz> | 2007-11-20 19:18:21 +0200 |
---|---|---|
committer | unknown <gkodinov/kgeorge@magare.gmz> | 2007-11-20 19:18:21 +0200 |
commit | 870d46819e517ec9dcd7b0e077147c69dbafa929 (patch) | |
tree | b567ffec12a992784efcb1e8e99b2b7d6c19a69f /tests | |
parent | 86744a32d659463c5cc0b56537c23efe14c480b5 (diff) | |
download | mariadb-git-870d46819e517ec9dcd7b0e077147c69dbafa929.tar.gz |
Bug #32400: Complex SELECT query returns correct result
only on some occasions
Referencing an element from the SELECT list in a WHERE
clause is not permitted. The namespace of the WHERE
clause is the table columns only. This was not enforced
correctly when resolving outer references in sub-queries.
Fixed by not allowing references to aliases in a
sub-query in WHERE.
mysql-test/include/ps_query.inc:
Bug #32400: fixed old test queries
mysql-test/r/ps_2myisam.result:
Bug #32400: fixed old test queries
mysql-test/r/ps_3innodb.result:
Bug #32400: fixed old test queries
mysql-test/r/ps_4heap.result:
Bug #32400: fixed old test queries
mysql-test/r/ps_5merge.result:
Bug #32400: fixed old test queries
mysql-test/r/ps_6bdb.result:
Bug #32400: fixed old test queries
mysql-test/r/ps_7ndb.result:
Bug #32400: fixed old test queries
mysql-test/r/subselect.result:
Bug #32400: test case
mysql-test/t/subselect.test:
Bug #32400: test case
sql/item.cc:
Bug #32400: don't allow references to aliases in WHERE
tests/mysql_client_test.c:
Bug #32400: fixed old test queries
Diffstat (limited to 'tests')
-rw-r--r-- | tests/mysql_client_test.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index 65e18da97f1..823878db23d 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -9283,7 +9283,7 @@ static void test_subqueries_ref() { MYSQL_STMT *stmt; int rc, i; - const char *query= "SELECT a as ccc from t1 where a+1=(SELECT 1+ccc from t1 where ccc+1=a+1 and a=1)"; + const char *query= "SELECT a as ccc from t1 outr where a+1=(SELECT 1+outr.a from t1 where outr.a+1=a+1 and a=1)"; myheader("test_subqueries_ref"); |