diff options
author | Sergey Glukhov <Sergey.Glukhov@sun.com> | 2010-04-06 12:26:59 +0500 |
---|---|---|
committer | Sergey Glukhov <Sergey.Glukhov@sun.com> | 2010-04-06 12:26:59 +0500 |
commit | 35f6b544c46026b9283cb3a06d874c84e8bbee8b (patch) | |
tree | c6cf4c4795b6ba6e4c9b221d9c0a948b9d3ef093 /sql/item_subselect.cc | |
parent | 7f7880a132559ec443a13d4bcbec48c91e099376 (diff) | |
download | mariadb-git-35f6b544c46026b9283cb3a06d874c84e8bbee8b.tar.gz |
Bug#52120 create view cause Assertion failed: 0, file .\item_subselect.cc, line 817
We should disable const subselect item evaluation because
subselect transformation does not happen in view_prepare_mode
and thus val_...() methods can not be called.
Diffstat (limited to 'sql/item_subselect.cc')
-rw-r--r-- | sql/item_subselect.cc | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index f89ca2d7955..f3fcbc4db68 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -122,6 +122,21 @@ void Item_subselect::cleanup() DBUG_VOID_RETURN; } + +/* + We cannot use generic Item::safe_charset_converter() because + Subselect transformation does not happen in view_prepare_mode + and thus we can not evaluate val_...() for const items. +*/ + +Item *Item_subselect::safe_charset_converter(CHARSET_INFO *tocs) +{ + Item_func_conv_charset *conv= + new Item_func_conv_charset(this, tocs, thd->lex->view_prepare_mode ? 0 : 1); + return conv->safe ? conv : NULL; +} + + void Item_singlerow_subselect::cleanup() { DBUG_ENTER("Item_singlerow_subselect::cleanup"); |