summaryrefslogtreecommitdiff
path: root/sql/item_func.cc
diff options
context:
space:
mode:
authoraelkin@mysql.com <>2006-05-07 16:02:55 +0300
committeraelkin@mysql.com <>2006-05-07 16:02:55 +0300
commit899cf9b584d7c9951501593b393dde0c38e2998b (patch)
treea6fd0adbad01befc53c4602f866e4bc6c80acb87 /sql/item_func.cc
parentf6c95ee81aa8a3e94f7f011a721d25b0663eddca (diff)
parent7dcd1383a8e8e293ec80fd654ec060fa997d76f0 (diff)
downloadmariadb-git-899cf9b584d7c9951501593b393dde0c38e2998b.tar.gz
Merge mysql.com:/usr_rh9/home/elkin.rh9/4.1
into mysql.com:/usr_rh9/home/elkin.rh9/MySQL/Merge/5.0-bug19136
Diffstat (limited to 'sql/item_func.cc')
-rw-r--r--sql/item_func.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/sql/item_func.cc b/sql/item_func.cc
index 3359c632aff..21aa7ed2a1b 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -3946,14 +3946,24 @@ int get_var_with_binlog(THD *thd, enum_sql_command sql_command,
sql_set_variables(), we could instead manually call check() and update();
this would save memory and time; but calling sql_set_variables() makes
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;
+ 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,
new Item_null())));
/* Create the variable */
if (sql_set_variables(thd, &tmp_var_list))
+ {
+ thd->lex= sav_lex;
goto err;
+ }
+ thd->lex= sav_lex;
if (!(var_entry= get_variable(&thd->user_vars, name, 0)))
goto err;
}