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, 28 insertions, 0 deletions
diff --git a/sql/item_row.cc b/sql/item_row.cc
index 3548a6b9b75..b38cffd1ad5 100644
--- a/sql/item_row.cc
+++ b/sql/item_row.cc
@@ -45,7 +45,14 @@ Item_row::Item_row(List<Item> &arg):
//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);
+ if (!items)
+ {
+ arg_count= 0;
+ return;
+ }
+ }
else
items= 0;
List_iterator_fast<Item> li(arg);
@@ -58,6 +65,27 @@ Item_row::Item_row(List<Item> &arg):
}
}
+
+Item_row::Item_row(Item *item):
+ Item(),
+ used_tables_cache(0),
+ not_null_tables_cache(0),
+ arg_count(item->cols()),
+ const_item_cache(1),
+ with_null(0)
+{
+ items= (Item**) sql_alloc(sizeof(Item*) * arg_count);
+ if (!items)
+ {
+ arg_count= 0;
+ return;
+ }
+ for (uint i= 0; i < arg_count; i++)
+ {
+ items[i]= item->element_index(i);
+ }
+}
+
void Item_row::illegal_method_call(const char *method)
{
DBUG_ENTER("Item_row::illegal_method_call");