diff options
author | unknown <bell@sanja.is.com.ua> | 2002-12-07 16:00:39 +0200 |
---|---|---|
committer | unknown <bell@sanja.is.com.ua> | 2002-12-07 16:00:39 +0200 |
commit | 71622d51c39ee8a670d80201545c523d38390c5f (patch) | |
tree | 589392bd88299b6d6ae1605cf6808499e8bbcb7c /sql/item_row.cc | |
parent | 265bf238951c3a123c4d6f7fea600175a399cf96 (diff) | |
download | mariadb-git-71622d51c39ee8a670d80201545c523d38390c5f.tar.gz |
Row item fixing (SCRUM related)
Inserted comment
sql/item_row.cc:
Row item fixing
sql/item_row.h:
Row item fixing
sql/sql_select.cc:
Inserted comment
Diffstat (limited to 'sql/item_row.cc')
-rw-r--r-- | sql/item_row.cc | 23 |
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) |