summaryrefslogtreecommitdiff
path: root/sql/item_subselect.h
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.org>2016-11-26 21:19:48 +0400
committerAlexander Barkov <bar@mariadb.org>2016-12-16 18:23:21 +0400
commit749bbb3d7b213b5044d97006259f013d70007d60 (patch)
treec24697cb4c861de2defff64aafbf89db566370d1 /sql/item_subselect.h
parent352ff9cc966b790f02128cc918281514cc245c26 (diff)
downloadmariadb-git-749bbb3d7b213b5044d97006259f013d70007d60.tar.gz
MDEV-11357 Split Item_cache::get_cache() into virtual methods in Type_handler
This patch: - Adds a new virtual method Type_handler::Item_get_cache - Splits moves Item_cache::get_cache() into the new method, every "case XXX_RESULT" to the corresponding Type_handler_xxx::Item_get_cache. - Adds Item::get_cache as a convenience wrapper, to make the caller code shorter. - Changes the last argument of Arg_comparator::cache_converted_constant() from Item_result to "const Type_handler *". - Removes subselect_engine::cmp_type, subselect_engine::res_type, subselect_engine::res_field_type and derives subselect_engine from Type_handler_hybrid_field_type instead. - Makes Type_handler_varchar public, as it's now needed as the default data type handler for subselect_engine.
Diffstat (limited to 'sql/item_subselect.h')
-rw-r--r--sql/item_subselect.h13
1 files changed, 4 insertions, 9 deletions
diff --git a/sql/item_subselect.h b/sql/item_subselect.h
index 823dbc6c281..74c03575272 100644
--- a/sql/item_subselect.h
+++ b/sql/item_subselect.h
@@ -301,6 +301,7 @@ public:
enum Item_result result_type() const;
enum Item_result cmp_type() const;
enum_field_types field_type() const;
+ const Type_handler *type_handler() const;
void fix_length_and_dec();
uint cols();
@@ -747,15 +748,13 @@ public:
};
-class subselect_engine: public Sql_alloc
+class subselect_engine: public Sql_alloc,
+ public Type_handler_hybrid_field_type
{
protected:
select_result_interceptor *result; /* results storage class */
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:
@@ -766,12 +765,11 @@ public:
subselect_engine(Item_subselect *si,
select_result_interceptor *res):
+ Type_handler_hybrid_field_type(&type_handler_varchar),
thd(NULL)
{
result= res;
item= si;
- cmp_type= res_type= STRING_RESULT;
- res_field_type= MYSQL_TYPE_VAR_STRING;
maybe_null= 0;
}
virtual ~subselect_engine() {}; // to satisfy compiler
@@ -808,9 +806,6 @@ public:
virtual int exec()= 0;
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; };
virtual table_map upper_select_const_tables()= 0;