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-bug-12943 sql/sql_parse.cc: Auto merged mysql-test/r/select.result: merge BUG#12943 mysql-test/t/select.test: merge BUG#12943
This commit is contained in:
@ -2922,3 +2922,23 @@ a b b
|
||||
select * from t1 inner join t2 using (a);
|
||||
a b b
|
||||
1 10 10
|
||||
create table t1 (a int, c int);
|
||||
create table t2 (b int);
|
||||
create table t3 (b int, a int);
|
||||
create table t4 (c int);
|
||||
insert into t1 values (1,1);
|
||||
insert into t2 values (1);
|
||||
insert into t3 values (1,1);
|
||||
insert into t4 values (1);
|
||||
select * from t1 join t2 join t3 on (t2.b = t3.b and t1.a = t3.a);
|
||||
a c b b a
|
||||
1 1 1 1 1
|
||||
select * from t1, t2 join t3 on (t2.b = t3.b and t1.a = t3.a);
|
||||
ERROR 42S22: Unknown column 't1.a' in 'on clause'
|
||||
select * from t1 join t2 join t3 join t4 on (t1.a = t4.c and t2.b = t4.c);
|
||||
a c b b a c
|
||||
1 1 1 1 1 1
|
||||
select * from t1 join t2 join t4 using (c);
|
||||
c a b
|
||||
1 1 1
|
||||
drop table t1, t2, t3, t4;
|
||||
|
@ -2499,3 +2499,24 @@ insert into t2 values (1,10);
|
||||
# both queries should produce the same result
|
||||
select * from t1 inner join t2 using (A);
|
||||
select * from t1 inner join t2 using (a);
|
||||
# Bug #12943 Incorrect nesting of [INNER| CROSS] JOIN due to unspecified
|
||||
# associativity in the parser.
|
||||
#
|
||||
|
||||
create table t1 (a int, c int);
|
||||
create table t2 (b int);
|
||||
create table t3 (b int, a int);
|
||||
create table t4 (c int);
|
||||
insert into t1 values (1,1);
|
||||
insert into t2 values (1);
|
||||
insert into t3 values (1,1);
|
||||
insert into t4 values (1);
|
||||
|
||||
select * from t1 join t2 join t3 on (t2.b = t3.b and t1.a = t3.a);
|
||||
# Notice that ',' has lower priority than 'join', thus we have that:
|
||||
# t1, t2 join t3 <==> t1, (t2 join t3).
|
||||
-- error 1054
|
||||
select * from t1, t2 join t3 on (t2.b = t3.b and t1.a = t3.a);
|
||||
select * from t1 join t2 join t3 join t4 on (t1.a = t4.c and t2.b = t4.c);
|
||||
select * from t1 join t2 join t4 using (c);
|
||||
drop table t1, t2, t3, t4;
|
||||
|
Reference in New Issue
Block a user