diff options
author | Oleksandr Byelkin <sanja@mariadb.com> | 2017-02-18 17:47:31 +0100 |
---|---|---|
committer | Oleksandr Byelkin <sanja@mariadb.com> | 2017-10-13 19:32:38 +0200 |
commit | 235b68299bc112f9cb7be97af8d01bf904919a6b (patch) | |
tree | d108e57b12187165b353220c85e088c68df2b005 /sql/item_row.cc | |
parent | 2bab29ebba7a641d43a98737fd1c160971357cd4 (diff) | |
download | mariadb-git-235b68299bc112f9cb7be97af8d01bf904919a6b.tar.gz |
MDEV-9619: Assertion `null_ref_table' failed in virtual table_map Item_direct_view_ref::used_tables() const on 2nd execution of PS
Refer left expression indirectly in case it changes from execution to execution.
Diffstat (limited to 'sql/item_row.cc')
-rw-r--r-- | sql/item_row.cc | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/sql/item_row.cc b/sql/item_row.cc index ee1d17213ee..9e81c053b69 100644 --- a/sql/item_row.cc +++ b/sql/item_row.cc @@ -44,7 +44,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<Item> li(arg); @@ -53,7 +60,28 @@ Item_row::Item_row(List<Item> &arg): while ((item= li++)) { items[i]= item; - i++; + i++; + } +} + + +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); } } |