diff options
author | unknown <timour@mysql.com> | 2005-09-08 11:29:52 +0300 |
---|---|---|
committer | unknown <timour@mysql.com> | 2005-09-08 11:29:52 +0300 |
commit | 9adffe29269cd56b83ae87d27ed37ff0029fcf9f (patch) | |
tree | 9c6f66c5b1961b031f1636cfb37e427a620dbe9b /mysql-test/r/select.result | |
parent | 027476e542c8fe45b4998400b2bc129776057a10 (diff) | |
download | mariadb-git-9adffe29269cd56b83ae87d27ed37ff0029fcf9f.tar.gz |
Fix for BUG#12977.
mysql-test/r/select.result:
Test for BUG#12977.
mysql-test/t/select.test:
Test for BUG#12977.
sql/sql_base.cc:
- Compare table qualifier of qualified fields only with tables that
are not natural joins or their operands.
- For qualified fields perform recursive search in all operands of
natural joins that are nested joins.
- Symmetrically detect ambiguous columns for both operands of
NATURAL/USING joins.
Diffstat (limited to 'mysql-test/r/select.result')
-rw-r--r-- | mysql-test/r/select.result | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index 0d5c1aed485..24c89039566 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -2897,3 +2897,18 @@ select * from t1 natural join t2 where a = 'b'; a b drop table t1, t2; +CREATE TABLE t1 (`id` TINYINT); +CREATE TABLE t2 (`id` TINYINT); +CREATE TABLE t3 (`id` TINYINT); +INSERT INTO t1 VALUES (1),(2),(3); +INSERT INTO t2 VALUES (2); +INSERT INTO t3 VALUES (3); +SELECT t1.id,t3.id FROM t1 JOIN t2 ON (t2.id=t1.id) LEFT JOIN t3 USING (id); +ERROR 23000: Column 'id' in from clause is ambiguous +SELECT t1.id,t3.id FROM t1 JOIN t2 ON (t2.notacolumn=t1.id) LEFT JOIN t3 USING (id); +ERROR 23000: Column 'id' in from clause is ambiguous +SELECT id,t3.id FROM t1 JOIN t2 ON (t2.id=t1.id) LEFT JOIN t3 USING (id); +ERROR 23000: Column 'id' in from clause is ambiguous +SELECT id,t3.id FROM (t1 JOIN t2 ON (t2.id=t1.id)) LEFT JOIN t3 USING (id); +ERROR 23000: Column 'id' in from clause is ambiguous +drop table t1, t2, t3; |