1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

fix for a bug with two natural joins.

This commit is contained in:
Sinisa@sinisa.nasamreza.org
2003-04-16 13:39:39 +03:00
parent 0e76eab9d4
commit 0f61926325
3 changed files with 23 additions and 2 deletions

View File

@ -652,3 +652,15 @@ fooID barID fooID
20 2 NULL
30 3 30
drop table t1,t2;
drop table if exists t3;
create table t1 (i int);
create table t2 (i int);
create table t3 (i int);
insert into t1 values(1),(2);
insert into t2 values(2),(3);
insert into t3 values(2),(4);
select * from t1 natural left join t2 natural left join t3;
i i i
1 NULL NULL
2 2 2
drop table t1,t2,t3;

View File

@ -416,3 +416,12 @@ explain select * from t2 left join t1 on t1.fooID = t2.fooID and t1.fooID = 30;
select * from t2 left join t1 on t1.fooID = t2.fooID and t1.fooID = 30;
select * from t2 left join t1 ignore index(primary) on t1.fooID = t2.fooID and t1.fooID = 30;
drop table t1,t2;
drop table if exists t3;
create table t1 (i int);
create table t2 (i int);
create table t3 (i int);
insert into t1 values(1),(2);
insert into t2 values(2),(3);
insert into t3 values(2),(4);
select * from t1 natural left join t2 natural left join t3;
drop table t1,t2,t3;

View File

@ -495,8 +495,8 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize);
/* These don't actually affect the way the query is really evaluated, but
they silence a few warnings for shift/reduce conflicts. */
%left ','
%left STRAIGHT_JOIN JOIN_SYM
%nonassoc CROSS INNER_SYM NATURAL LEFT RIGHT
%left STRAIGHT_JOIN JOIN_SYM NATURAL
%nonassoc CROSS INNER_SYM LEFT RIGHT
%type <lex_str>
IDENT TEXT_STRING REAL_NUM FLOAT_NUM NUM LONG_NUM HEX_NUM LEX_HOSTNAME