mirror of
https://github.com/MariaDB/server.git
synced 2025-01-29 02:05:57 +01:00
Bug#19136: Manual 5.0->5.1 merge
sql/item_func.cc: Auto merged sql/sql_select.cc: Auto merged
This commit is contained in:
commit
704a69eb91
3 changed files with 12 additions and 0 deletions
|
@ -78,5 +78,6 @@ abcn1
|
||||||
abcn1n2
|
abcn1n2
|
||||||
abc\def
|
abc\def
|
||||||
This is a test
|
This is a test
|
||||||
|
insert into t1 select * FROM (select @var1 union select @var2) AS t2;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
stop slave;
|
stop slave;
|
||||||
|
|
|
@ -55,6 +55,7 @@ SELECT * FROM t1 ORDER BY n;
|
||||||
sync_slave_with_master;
|
sync_slave_with_master;
|
||||||
SELECT * FROM t1 ORDER BY n;
|
SELECT * FROM t1 ORDER BY n;
|
||||||
connection master;
|
connection master;
|
||||||
|
insert into t1 select * FROM (select @var1 union select @var2) AS t2;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
sync_slave_with_master;
|
sync_slave_with_master;
|
||||||
stop slave;
|
stop slave;
|
||||||
|
|
|
@ -3948,14 +3948,24 @@ int get_var_with_binlog(THD *thd, enum_sql_command sql_command,
|
||||||
sql_set_variables(), we could instead manually call check() and update();
|
sql_set_variables(), we could instead manually call check() and update();
|
||||||
this would save memory and time; but calling sql_set_variables() makes
|
this would save memory and time; but calling sql_set_variables() makes
|
||||||
one unique place to maintain (sql_set_variables()).
|
one unique place to maintain (sql_set_variables()).
|
||||||
|
|
||||||
|
Manipulation with lex is necessary since free_underlaid_joins
|
||||||
|
is going to release memory belonging to the main query.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
List<set_var_base> tmp_var_list;
|
List<set_var_base> tmp_var_list;
|
||||||
|
LEX *sav_lex= thd->lex, lex_tmp;
|
||||||
|
thd->lex= &lex_tmp;
|
||||||
|
lex_start(thd, NULL, 0);
|
||||||
tmp_var_list.push_back(new set_var_user(new Item_func_set_user_var(name,
|
tmp_var_list.push_back(new set_var_user(new Item_func_set_user_var(name,
|
||||||
new Item_null())));
|
new Item_null())));
|
||||||
/* Create the variable */
|
/* Create the variable */
|
||||||
if (sql_set_variables(thd, &tmp_var_list))
|
if (sql_set_variables(thd, &tmp_var_list))
|
||||||
|
{
|
||||||
|
thd->lex= sav_lex;
|
||||||
goto err;
|
goto err;
|
||||||
|
}
|
||||||
|
thd->lex= sav_lex;
|
||||||
if (!(var_entry= get_variable(&thd->user_vars, name, 0)))
|
if (!(var_entry= get_variable(&thd->user_vars, name, 0)))
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue