summaryrefslogtreecommitdiff
path: root/sql/item.cc
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.org>2016-12-21 15:39:45 +0400
committerAlexander Barkov <bar@mariadb.org>2016-12-21 15:39:45 +0400
commit5e051bfa15d201228b103d7f536436a61cde8707 (patch)
tree904f8e37abed9e3996012ecb3e6b62a76049ff60 /sql/item.cc
parentef82fd8ca33f0ecab06ddfa11b51dd5ea9019653 (diff)
downloadmariadb-git-5e051bfa15d201228b103d7f536436a61cde8707.tar.gz
MDEV-10386 Assertion `fixed == 1' failed in virtual String* Item_func_conv_charset::val_str(String*)
The patch b96c196f1cd5d77e524cbf952539bdd33c65ffc1 added a new call for safe_charset_converter() without a corresponding fix_fields(). In case of a sub-query the created Item remained in non-fixed state. The problem did not show up with literal derived expressions, only subselects were affected. This patch adds a corresponding fix_fields() to the previously added safe_charset_converter().
Diffstat (limited to 'sql/item.cc')
-rw-r--r--sql/item.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/item.cc b/sql/item.cc
index fc9eb31bf5b..1df91dc2534 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -1164,7 +1164,8 @@ Item *Item_cache::safe_charset_converter(CHARSET_INFO *tocs)
if (conv == example)
return this;
Item_cache *cache;
- if (!conv || !(cache= new Item_cache_str(conv)))
+ if (!conv || conv->fix_fields(current_thd, (Item **) NULL) ||
+ !(cache= new Item_cache_str(conv)))
return NULL; // Safe conversion is not possible, or OEM
cache->setup(conv);
cache->fixed= false; // Make Item::fix_fields() happy