summaryrefslogtreecommitdiff
path: root/sql/item_row.cc
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2017-10-18 15:14:39 +0200
committerSergei Golubchik <serg@mariadb.org>2017-10-18 15:14:39 +0200
commitda4503e956ee067947e504c6e73052d9d906742c (patch)
treea70bbc33f0411ef29c347a570d8253445d8013e4 /sql/item_row.cc
parentbabbf8c6fc6da92cd1b2bb23f04e996f84b0ca1a (diff)
parentb000e169562697aa072600695d4f0c0412f94f4f (diff)
downloadmariadb-git-da4503e956ee067947e504c6e73052d9d906742c.tar.gz
Merge branch '5.5' into 10.0
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");