mirror of
https://github.com/MariaDB/server.git
synced 2025-08-07 00:04:31 +03:00
fix for a bug with two natural joins.
This commit is contained in:
@@ -652,3 +652,15 @@ fooID barID fooID
|
|||||||
20 2 NULL
|
20 2 NULL
|
||||||
30 3 30
|
30 3 30
|
||||||
drop table t1,t2;
|
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;
|
||||||
|
@@ -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 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;
|
select * from t2 left join t1 ignore index(primary) on t1.fooID = t2.fooID and t1.fooID = 30;
|
||||||
drop table t1,t2;
|
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;
|
||||||
|
@@ -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
|
/* These don't actually affect the way the query is really evaluated, but
|
||||||
they silence a few warnings for shift/reduce conflicts. */
|
they silence a few warnings for shift/reduce conflicts. */
|
||||||
%left ','
|
%left ','
|
||||||
%left STRAIGHT_JOIN JOIN_SYM
|
%left STRAIGHT_JOIN JOIN_SYM NATURAL
|
||||||
%nonassoc CROSS INNER_SYM NATURAL LEFT RIGHT
|
%nonassoc CROSS INNER_SYM LEFT RIGHT
|
||||||
|
|
||||||
%type <lex_str>
|
%type <lex_str>
|
||||||
IDENT TEXT_STRING REAL_NUM FLOAT_NUM NUM LONG_NUM HEX_NUM LEX_HOSTNAME
|
IDENT TEXT_STRING REAL_NUM FLOAT_NUM NUM LONG_NUM HEX_NUM LEX_HOSTNAME
|
||||||
|
Reference in New Issue
Block a user