mirror of
https://github.com/MariaDB/server.git
synced 2025-08-07 00:04:31 +03:00
Fix for a bug #1226.
Happens when braces are used on a single select, which leads to the uninitialized global parameters structure.
This commit is contained in:
@@ -1368,4 +1368,10 @@ insert into t1 values ('tttt');
|
|||||||
select * from t1 where ('a','b')=(select 'a','b' from t1 union select 'a','b' from t1);
|
select * from t1 where ('a','b')=(select 'a','b' from t1 union select 'a','b' from t1);
|
||||||
s1
|
s1
|
||||||
tttt
|
tttt
|
||||||
|
explain (select * from t1);
|
||||||
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
|
1 SIMPLE t1 system NULL NULL NULL NULL 1
|
||||||
|
(select * from t1);
|
||||||
|
s1
|
||||||
|
tttt
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
@@ -931,4 +931,6 @@ create table t1 (s1 char(5));
|
|||||||
select (select 'a','b' from t1 union select 'a','b' from t1) from t1;
|
select (select 'a','b' from t1 union select 'a','b' from t1) from t1;
|
||||||
insert into t1 values ('tttt');
|
insert into t1 values ('tttt');
|
||||||
select * from t1 where ('a','b')=(select 'a','b' from t1 union select 'a','b' from t1);
|
select * from t1 where ('a','b')=(select 'a','b' from t1 union select 'a','b' from t1);
|
||||||
|
explain (select * from t1);
|
||||||
|
(select * from t1);
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
@@ -2012,6 +2012,7 @@ select_init:
|
|||||||
YYABORT;
|
YYABORT;
|
||||||
}
|
}
|
||||||
/* select in braces, can't contain global parameters */
|
/* select in braces, can't contain global parameters */
|
||||||
|
if (sel->master_unit()->fake_select_lex)
|
||||||
sel->master_unit()->global_parameters=
|
sel->master_unit()->global_parameters=
|
||||||
sel->master_unit()->fake_select_lex;
|
sel->master_unit()->fake_select_lex;
|
||||||
} union_opt;
|
} union_opt;
|
||||||
|
Reference in New Issue
Block a user