summaryrefslogtreecommitdiff
path: root/sql/item_row.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/item_row.cc')
-rw-r--r--sql/item_row.cc28
1 files changed, 8 insertions, 20 deletions
diff --git a/sql/item_row.cc b/sql/item_row.cc
index b54653f4183..ba4ac19b880 100644
--- a/sql/item_row.cc
+++ b/sql/item_row.cc
@@ -54,7 +54,14 @@ bool Item_row::fix_fields(THD *thd, TABLE_LIST *tabl, Item **ref)
if (items[i]->fix_fields(thd, tabl, items+i))
return 1;
used_tables_cache |= items[i]->used_tables();
- const_item_cache&= items[i]->const_item();
+ if (const_item_cache&= items[i]->const_item() && !with_null)
+ if (items[i]->cols() > 1)
+ with_null|= items[i]->null_inside();
+ else
+ {
+ items[i]->val_int();
+ with_null|= items[i]->null_value;
+ }
maybe_null|= items[i]->maybe_null;
}
return 0;
@@ -82,25 +89,6 @@ bool Item_row::check_cols(uint c)
return 0;
}
-bool Item_row::null_inside()
-{
- for (uint i= 0; i < arg_count; i++)
- {
- if (items[i]->cols() > 1)
- {
- if (items[i]->null_inside())
- return 1;
- }
- else
- {
- items[i]->val_int();
- if (items[i]->null_value)
- return 1;
- }
- }
- return 0;
-}
-
void Item_row::bring_value()
{
for (uint i= 0; i < arg_count; i++)