summaryrefslogtreecommitdiff
path: root/sql/item_subselect.h
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2013-03-17 11:41:25 +0100
committerSergei Golubchik <sergii@pisem.net>2013-03-17 11:41:25 +0100
commit495fd27c0e3781013904666f302a3d3e4f011e50 (patch)
tree53422be325dfde77ac5b01cdc5929bbd701d6638 /sql/item_subselect.h
parentecd4bf62d439b300facb4d5758c4670e6c96b7c5 (diff)
downloadmariadb-git-495fd27c0e3781013904666f302a3d3e4f011e50.tar.gz
MDEV-4284 Assertion `cmp_items[(uint)cmp_type]' fails in sql/item_cmpfunc.cc
Flip the switch and create Item_cache based on the argument's cmp_type, not argument's result_type(). Fix subselect_engine to calculate cmp_type correctly sql/item_subselect.h: mdev:4284
Diffstat (limited to 'sql/item_subselect.h')
-rw-r--r--sql/item_subselect.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/sql/item_subselect.h b/sql/item_subselect.h
index 1da129380e7..25852b55d98 100644
--- a/sql/item_subselect.h
+++ b/sql/item_subselect.h
@@ -286,6 +286,7 @@ public:
bool val_bool();
bool get_date(MYSQL_TIME *ltime, ulonglong fuzzydate);
enum Item_result result_type() const;
+ enum Item_result cmp_type() const;
enum_field_types field_type() const;
void fix_length_and_dec();
@@ -698,6 +699,7 @@ protected:
THD *thd; /* pointer to current THD */
Item_subselect *item; /* item, that use this engine */
enum Item_result res_type; /* type of results */
+ enum Item_result cmp_type; /* how to compare the results */
enum_field_types res_field_type; /* column type of the results */
bool maybe_null; /* may be null (first item in select) */
public:
@@ -712,7 +714,7 @@ public:
{
result= res;
item= si;
- res_type= STRING_RESULT;
+ cmp_type= res_type= STRING_RESULT;
res_field_type= MYSQL_TYPE_VAR_STRING;
maybe_null= 0;
set_thd(thd_arg);
@@ -752,6 +754,7 @@ public:
virtual uint cols()= 0; /* return number of columns in select */
virtual uint8 uncacheable()= 0; /* query is uncacheable */
enum Item_result type() { return res_type; }
+ enum Item_result cmptype() { return cmp_type; }
enum_field_types field_type() { return res_field_type; }
virtual void exclude()= 0;
virtual bool may_be_null() { return maybe_null; };