fixed uncachable union (bug #150)
mysql-test/r/union.result: sect of uncachable union mysql-test/t/union.test: sect of uncachable union sql/sql_lex.h: fixed uncachable union
This commit is contained in:
parent
13d28097e7
commit
6da897e04b
@ -269,3 +269,7 @@ id select_type table type possible_keys key key_len ref rows Extra
|
|||||||
drop table t1,t2;
|
drop table t1,t2;
|
||||||
(select 1) union (select 2) order by 0;
|
(select 1) union (select 2) order by 0;
|
||||||
Unknown column '0' in 'order clause'
|
Unknown column '0' in 'order clause'
|
||||||
|
SELECT @a:=1 UNION SELECT @a:=@a+1;
|
||||||
|
@a:=1
|
||||||
|
1
|
||||||
|
2
|
||||||
|
@ -144,3 +144,5 @@ explain (select * from t1 where a=1) union (select * from t1 where b=1);
|
|||||||
drop table t1,t2;
|
drop table t1,t2;
|
||||||
--error 1054
|
--error 1054
|
||||||
(select 1) union (select 2) order by 0;
|
(select 1) union (select 2) order by 0;
|
||||||
|
|
||||||
|
SELECT @a:=1 UNION SELECT @a:=@a+1;
|
||||||
|
@ -501,11 +501,13 @@ typedef struct st_lex
|
|||||||
but we should merk all subselects as uncacheable from current till
|
but we should merk all subselects as uncacheable from current till
|
||||||
most upper
|
most upper
|
||||||
*/
|
*/
|
||||||
for (SELECT_LEX_NODE *sl= current_select;
|
SELECT_LEX_NODE *sl;
|
||||||
sl != &select_lex;
|
SELECT_LEX_UNIT *un;
|
||||||
sl= sl->outer_select())
|
for (sl= current_select, un= sl->master_unit();
|
||||||
|
un != &unit;
|
||||||
|
sl= sl->outer_select(), un= sl->master_unit())
|
||||||
{
|
{
|
||||||
sl->uncacheable = sl->master_unit()->uncacheable= 1;
|
sl->uncacheable = un->uncacheable= 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} LEX;
|
} LEX;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user