summaryrefslogtreecommitdiff
path: root/sql/item_cmpfunc.cc
diff options
context:
space:
mode:
authorMartin Hansson <martin.hansson@sun.com>2010-08-05 12:42:14 +0200
committerMartin Hansson <martin.hansson@sun.com>2010-08-05 12:42:14 +0200
commit0c81dcf332bd9b3e2a68354efab9bf6ea96df2d3 (patch)
treebb3b6af5591fcd6199bd2bd4a7a5001fb383fdf7 /sql/item_cmpfunc.cc
parentb1a8b3aa6eb3f8f8c2df218e4eb25e4af710b66a (diff)
downloadmariadb-git-0c81dcf332bd9b3e2a68354efab9bf6ea96df2d3.tar.gz
Bug#54568: create view cause Assertion failed: 0,
file .\item_subselect.cc, line 836 IN quantified predicates are never executed directly. They are rather wrapped inside nodes called IN Optimizers (Item_in_optimizer) which take care of the execution. However, this is not done during query preparation. Unfortunately the LIKE predicate pre-evaluates constant right-hand side arguments even during name resolution. Likely this is meant as an optimization. Fixed by not pre-evaluating LIKE arguments in view prepare mode.
Diffstat (limited to 'sql/item_cmpfunc.cc')
-rw-r--r--sql/item_cmpfunc.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index e91aba63023..fe4616f64d7 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -4606,7 +4606,7 @@ bool Item_func_like::fix_fields(THD *thd, Item **ref)
return TRUE;
}
- if (escape_item->const_item())
+ if (escape_item->const_item() && !thd->lex->view_prepare_mode)
{
/* If we are on execution stage */
String *escape_str= escape_item->val_str(&cmp.value1);