Commit 7e9944d3 authored by konstantin@mysql.com's avatar konstantin@mysql.com

cleanup: #ifdef DELETE_ITEMS removed

parent 8f1b5b48
...@@ -1779,17 +1779,9 @@ Item *resolve_const_item(Item *item,Item *comp_item) ...@@ -1779,17 +1779,9 @@ Item *resolve_const_item(Item *item,Item *comp_item)
String tmp(buff,sizeof(buff),&my_charset_bin),*result; String tmp(buff,sizeof(buff),&my_charset_bin),*result;
result=item->val_str(&tmp); result=item->val_str(&tmp);
if (item->null_value) if (item->null_value)
{
#ifdef DELETE_ITEMS
delete item;
#endif
return new Item_null(name); return new Item_null(name);
}
uint length=result->length(); uint length=result->length();
char *tmp_str=sql_strmake(result->ptr(),length); char *tmp_str=sql_strmake(result->ptr(),length);
#ifdef DELETE_ITEMS
delete item;
#endif
return new Item_string(name,tmp_str,length,result->charset()); return new Item_string(name,tmp_str,length,result->charset());
} }
if (res_type == INT_RESULT) if (res_type == INT_RESULT)
...@@ -1797,9 +1789,6 @@ Item *resolve_const_item(Item *item,Item *comp_item) ...@@ -1797,9 +1789,6 @@ Item *resolve_const_item(Item *item,Item *comp_item)
longlong result=item->val_int(); longlong result=item->val_int();
uint length=item->max_length; uint length=item->max_length;
bool null_value=item->null_value; bool null_value=item->null_value;
#ifdef DELETE_ITEMS
delete item;
#endif
return (null_value ? (Item*) new Item_null(name) : return (null_value ? (Item*) new Item_null(name) :
(Item*) new Item_int(name,result,length)); (Item*) new Item_int(name,result,length));
} }
...@@ -1808,9 +1797,6 @@ Item *resolve_const_item(Item *item,Item *comp_item) ...@@ -1808,9 +1797,6 @@ Item *resolve_const_item(Item *item,Item *comp_item)
double result=item->val(); double result=item->val();
uint length=item->max_length,decimals=item->decimals; uint length=item->max_length,decimals=item->decimals;
bool null_value=item->null_value; bool null_value=item->null_value;
#ifdef DELETE_ITEMS
delete item;
#endif
return (null_value ? (Item*) new Item_null(name) : return (null_value ? (Item*) new Item_null(name) :
(Item*) new Item_real(name,result,decimals,length)); (Item*) new Item_real(name,result,decimals,length));
} }
......
...@@ -1703,9 +1703,6 @@ Item_cond::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) ...@@ -1703,9 +1703,6 @@ Item_cond::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref)
{ // Identical function { // Identical function
li.replace(((Item_cond*) item)->list); li.replace(((Item_cond*) item)->list);
((Item_cond*) item)->list.empty(); ((Item_cond*) item)->list.empty();
#ifdef DELETE_ITEMS
delete (Item_cond*) item;
#endif
item= *li.ref(); // new current item item= *li.ref(); // new current item
} }
if (abort_on_null) if (abort_on_null)
......
...@@ -1899,10 +1899,6 @@ mysql_execute_command(THD *thd) ...@@ -1899,10 +1899,6 @@ mysql_execute_command(THD *thd)
if (!(result=new select_send())) if (!(result=new select_send()))
{ {
res= -1; res= -1;
#ifdef DELETE_ITEMS
delete select_lex->having;
delete select_lex->where;
#endif
break; break;
} }
} }
......
...@@ -4395,17 +4395,9 @@ remove_eq_conds(COND *cond,Item::cond_result *cond_value) ...@@ -4395,17 +4395,9 @@ remove_eq_conds(COND *cond,Item::cond_result *cond_value)
{ {
Item *new_item=remove_eq_conds(item,&tmp_cond_value); Item *new_item=remove_eq_conds(item,&tmp_cond_value);
if (!new_item) if (!new_item)
{
#ifdef DELETE_ITEMS
delete item; // This may be shared
#endif
li.remove(); li.remove();
}
else if (item != new_item) else if (item != new_item)
{ {
#ifdef DELETE_ITEMS
delete item; // This may be shared
#endif
VOID(li.replace(new_item)); VOID(li.replace(new_item));
should_fix_fields=1; should_fix_fields=1;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment