summaryrefslogtreecommitdiff
path: root/sql/item_row.cc
diff options
context:
space:
mode:
authorSergey Glukhov <Sergey.Glukhov@sun.com>2010-02-12 13:44:20 +0400
committerSergey Glukhov <Sergey.Glukhov@sun.com>2010-02-12 13:44:20 +0400
commit18303b70c6ea06292d1c3f604f1afdc722e85329 (patch)
treeeb5fe8ec07789d4b60868b31919ad12b97c01348 /sql/item_row.cc
parent0ee625fa1f2cbd9d26aa5945446102f7dd9ec7f3 (diff)
downloadmariadb-git-18303b70c6ea06292d1c3f604f1afdc722e85329.tar.gz
Bug#48294 assertion when creating a view based on some row() construct in select query
In case of 'CREATE VIEW' subselect transformation does not happen(see JOIN::prepare). During fix_fields Item_row may call is_null() method for its arugmens which leads to item calculation(wrong subselect in our case as transformation did not happen before). This is_null() call does not make sence for 'CREATE VIEW'. Note: Only Item_row is affected because other items don't call is_null() during fix_fields() for arguments.
Diffstat (limited to 'sql/item_row.cc')
-rw-r--r--sql/item_row.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/sql/item_row.cc b/sql/item_row.cc
index 28de03bf049..29b37eb2bc0 100644
--- a/sql/item_row.cc
+++ b/sql/item_row.cc
@@ -71,7 +71,12 @@ bool Item_row::fix_fields(THD *thd, Item **ref)
Item *item= *arg;
used_tables_cache |= item->used_tables();
const_item_cache&= item->const_item() && !with_null;
- if (const_item_cache)
+ /*
+ Some subqueries transformations aren't done in the view_prepare_mode thus
+ is_null() will fail. So we skip is_null() calculation for CREATE VIEW as
+ not necessary.
+ */
+ if (const_item_cache && !thd->lex->view_prepare_mode)
{
if (item->cols() > 1)
with_null|= item->null_inside();