1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Merge mysql.com:/home/timka/mysql/src/5.0-virgin

into  mysql.com:/home/timka/mysql/src/5.0-2486
This commit is contained in:
unknown
2005-09-08 21:02:19 +03:00
3 changed files with 58 additions and 7 deletions

View File

@ -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;

View File

@ -2465,3 +2465,25 @@ insert into t2 values ('b'),('c'),('d');
select a from t1 natural join t2;
select * from t1 natural join t2 where a = 'b';
drop table t1, t2;
#
# Bug #12977 Compare table names with qualifying field tables only
# for base tables, search all nested join operands of natural joins.
#
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);
-- error 1052
SELECT t1.id,t3.id FROM t1 JOIN t2 ON (t2.id=t1.id) LEFT JOIN t3 USING (id);
-- error 1052
SELECT t1.id,t3.id FROM t1 JOIN t2 ON (t2.notacolumn=t1.id) LEFT JOIN t3 USING (id);
-- error 1052
SELECT id,t3.id FROM t1 JOIN t2 ON (t2.id=t1.id) LEFT JOIN t3 USING (id);
-- error 1052
SELECT id,t3.id FROM (t1 JOIN t2 ON (t2.id=t1.id)) LEFT JOIN t3 USING (id);
drop table t1, t2, t3;