summaryrefslogtreecommitdiff
path: root/sql/item_row.cc
diff options
context:
space:
mode:
authorbell@sanja.is.com.ua <>2002-12-07 16:00:39 +0200
committerbell@sanja.is.com.ua <>2002-12-07 16:00:39 +0200
commitb1beb31400540e16f3294e18e7f664c641093dbc (patch)
tree589392bd88299b6d6ae1605cf6808499e8bbcb7c /sql/item_row.cc
parented8cc2a844738386ae3eef3b3b01c0e784a0b3f6 (diff)
downloadmariadb-git-b1beb31400540e16f3294e18e7f664c641093dbc.tar.gz
Row item fixing (SCRUM related)
Inserted comment
Diffstat (limited to 'sql/item_row.cc')
-rw-r--r--sql/item_row.cc23
1 files changed, 20 insertions, 3 deletions
diff --git a/sql/item_row.cc b/sql/item_row.cc
index 464a8fd0ec5..e073f8e24e7 100644
--- a/sql/item_row.cc
+++ b/sql/item_row.cc
@@ -18,8 +18,10 @@
#include "assert.h"
Item_row::Item_row(List<Item> &arg):
- Item(), array_holder(1)
+ Item(), array_holder(1), used_tables_cache(0), const_item_cache(1)
{
+
+ //TODO: think placing 2-3 component items in item (as it done for function)
if ((arg_count= arg.elements))
items= (Item**) sql_alloc(sizeof(Item*)*arg_count);
else
@@ -45,16 +47,31 @@ void Item_row::illegal_method_call(const char *method)
bool Item_row::fix_fields(THD *thd, TABLE_LIST *tabl, Item **ref)
{
- tables= 0;
+ null_value= 0;
+ maybe_null= 0;
for (uint i= 0; i < arg_count; i++)
{
if (items[i]->fix_fields(thd, tabl, items+i))
return 1;
- tables |= items[i]->used_tables();
+ used_tables_cache |= items[i]->used_tables();
+ const_item_cache&= items[i]->const_item();
+ maybe_null|= items[i]->maybe_null;
}
return 0;
}
+void Item_row::update_used_tables()
+{
+ used_tables_cache= 0;
+ const_item_cache= 1;
+ for (uint i= 0; i < arg_count; i++)
+ {
+ items[i]->update_used_tables();
+ used_tables_cache|= items[i]->used_tables();
+ const_item_cache&= items[i]->const_item();
+ }
+}
+
bool Item_row::check_cols(uint c)
{
if (c != arg_count)