Commit d85e7a5e authored by kevg's avatar kevg Committed by Aleksey Midenkov

SQL: NATUAL JOIN on view + table [fixes #148]

parent 0e010389
......@@ -418,6 +418,13 @@ select * from v1;
a
1
drop view v1;
create or replace table t1 (a int) with system versioning;
insert into t1 values (1);
create view vt1 as select a from t1;
select * from t1 natural join vt1;
a
1
drop view vt1;
drop table t1, t2;
call verify_vtq;
No A B C D
......
......@@ -142,6 +142,12 @@ create view v1 as select * from t2 inner join t1 using (a);
select * from v1;
drop view v1;
create or replace table t1 (a int) with system versioning;
insert into t1 values (1);
create view vt1 as select a from t1;
select * from t1 natural join vt1;
drop view vt1;
drop table t1, t2;
call verify_vtq;
......
......@@ -832,7 +832,8 @@ int vers_setup_select(THD *thd, TABLE_LIST *tables, COND **where_expr,
Item *row_start= NULL;
Item *row_end= NULL;
if (table->is_derived() && !table->is_recursive_with_table())
if ((table->is_derived() && !table->is_recursive_with_table()) ||
table->join_columns)
{
row_start= newx Item_field(thd, &slex->context, NULL, NULL,
fstart->field_name);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment