mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge 192.168.0.100:mysql/mysql-5.0
into neptunus.(none):/home/msvensson/mysql/mysql-5.1 client/mysqltest.c: Auto merged include/config-win.h: Auto merged include/m_ctype.h: Auto merged mysql-test/mysql-test-run.pl: Auto merged mysql-test/r/subselect.result: Auto merged sql/item_func.cc: Auto merged sql/opt_range.cc: Auto merged strings/ctype-bin.c: Auto merged strings/ctype-euc_kr.c: Auto merged strings/ctype-gb2312.c: Auto merged strings/ctype-ucs2.c: Auto merged
This commit is contained in:
@ -4799,9 +4799,18 @@ static SEL_TREE *get_mm_tree(RANGE_OPT_PARAM *param,COND *cond)
|
||||
/* Here when simple cond */
|
||||
if (cond->const_item())
|
||||
{
|
||||
if (cond->val_int())
|
||||
DBUG_RETURN(new SEL_TREE(SEL_TREE::ALWAYS));
|
||||
DBUG_RETURN(new SEL_TREE(SEL_TREE::IMPOSSIBLE));
|
||||
/*
|
||||
During the cond->val_int() evaluation we can come across a subselect
|
||||
item which may allocate memory on the thd->mem_root and assumes
|
||||
all the memory allocated has the same life span as the subselect
|
||||
item itself. So we have to restore the thread's mem_root here.
|
||||
*/
|
||||
MEM_ROOT *tmp_root= param->mem_root;
|
||||
param->thd->mem_root= param->old_root;
|
||||
tree= cond->val_int() ? new(tmp_root) SEL_TREE(SEL_TREE::ALWAYS) :
|
||||
new(tmp_root) SEL_TREE(SEL_TREE::IMPOSSIBLE);
|
||||
param->thd->mem_root= tmp_root;
|
||||
DBUG_RETURN(tree);
|
||||
}
|
||||
|
||||
table_map ref_tables= 0;
|
||||
|
Reference in New Issue
Block a user