summaryrefslogtreecommitdiff
path: root/sql/item_subselect.h
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2016-08-30 16:14:51 -0700
committerIgor Babaev <igor@askmonty.org>2016-08-30 16:14:51 -0700
commit2250e9ea261f661cb73c147a28f4d30655d7483d (patch)
tree04673b47943fdb137f8fe5bafdb64a24887f8c0f /sql/item_subselect.h
parentcb1e44219b9beae92e104cfe5e67aab3073dd8aa (diff)
parent4ca7b226c05ae883accec64b1afe6d60daf1b323 (diff)
downloadmariadb-git-2250e9ea261f661cb73c147a28f4d30655d7483d.tar.gz
Merge 10.2 into 10.2-mdev9864.
Diffstat (limited to 'sql/item_subselect.h')
-rw-r--r--sql/item_subselect.h60
1 files changed, 28 insertions, 32 deletions
diff --git a/sql/item_subselect.h b/sql/item_subselect.h
index e72f75726ed..178c875d5e5 100644
--- a/sql/item_subselect.h
+++ b/sql/item_subselect.h
@@ -222,14 +222,14 @@ public:
*/
virtual void reset_value_registration() {}
enum_parsing_place place() { return parsing_place; }
- bool walk(Item_processor processor, bool walk_subquery, uchar *arg);
- bool mark_as_eliminated_processor(uchar *arg);
- bool eliminate_subselect_processor(uchar *arg);
- bool set_fake_select_as_master_processor(uchar *arg);
- bool enumerate_field_refs_processor(uchar *arg);
- bool check_vcol_func_processor(uchar *int_arg)
+ bool walk(Item_processor processor, bool walk_subquery, void *arg);
+ bool mark_as_eliminated_processor(void *arg);
+ bool eliminate_subselect_processor(void *arg);
+ bool set_fake_select_as_master_processor(void *arg);
+ bool enumerate_field_refs_processor(void *arg);
+ bool check_vcol_func_processor(void *arg)
{
- return trace_unsupported_by_check_vcol_func_processor("subselect");
+ return mark_unsupported_function("select ...", arg, VCOL_IMPOSSIBLE);
}
/**
Callback to test if an IN predicate is expensive.
@@ -240,7 +240,7 @@ public:
@retval TRUE if the predicate is expensive
@retval FALSE otherwise
*/
- bool is_expensive_processor(uchar *arg) { return is_expensive(); }
+ bool is_expensive_processor(void *arg) { return is_expensive(); }
/**
Get the SELECT_LEX structure associated with this Item.
@@ -249,9 +249,9 @@ public:
st_select_lex* get_select_lex();
virtual bool expr_cache_is_needed(THD *);
virtual void get_cache_parameters(List<Item> &parameters);
- virtual bool is_subquery_processor (uchar *opt_arg) { return 1; }
- bool exists2in_processor(uchar *opt_arg) { return 0; }
- bool limit_index_condition_pushdown_processor(uchar *opt_arg)
+ virtual bool is_subquery_processor (void *opt_arg) { return 1; }
+ bool exists2in_processor(void *opt_arg) { return 0; }
+ bool limit_index_condition_pushdown_processor(void *opt_arg)
{
return TRUE;
}
@@ -400,7 +400,7 @@ public:
bool select_transformer(JOIN *join);
void top_level_item() { abort_on_null=1; }
inline bool is_top_level_item() { return abort_on_null; }
- bool exists2in_processor(uchar *opt_arg);
+ bool exists2in_processor(void *opt_arg);
Item* expr_cache_insert_transformer(THD *thd, uchar *unused);
@@ -706,7 +706,7 @@ public:
in_strategy= (SUBS_STRATEGY_CHOSEN | strategy);
DBUG_VOID_RETURN;
}
- bool exists2in_processor(uchar *opt_arg __attribute__((unused)))
+ bool exists2in_processor(void *opt_arg __attribute__((unused)))
{
return 0;
};
@@ -761,7 +761,7 @@ public:
INDEXSUBQUERY_ENGINE, HASH_SJ_ENGINE,
ROWID_MERGE_ENGINE, TABLE_SCAN_ENGINE};
- subselect_engine(THD *thd_arg, Item_subselect *si,
+ subselect_engine(Item_subselect *si,
select_result_interceptor *res)
{
result= res;
@@ -769,7 +769,6 @@ public:
cmp_type= res_type= STRING_RESULT;
res_field_type= MYSQL_TYPE_VAR_STRING;
maybe_null= 0;
- set_thd(thd_arg);
}
virtual ~subselect_engine() {}; // to satisfy compiler
virtual void cleanup()= 0;
@@ -780,7 +779,7 @@ public:
*/
void set_thd(THD *thd_arg);
THD * get_thd() { return thd; }
- virtual int prepare()= 0;
+ virtual int prepare(THD *)= 0;
virtual void fix_length_and_dec(Item_cache** row)= 0;
/*
Execute the engine
@@ -835,11 +834,11 @@ class subselect_single_select_engine: public subselect_engine
st_select_lex *select_lex; /* corresponding select_lex */
JOIN * join; /* corresponding JOIN structure */
public:
- subselect_single_select_engine(THD *thd_arg, st_select_lex *select,
+ subselect_single_select_engine(st_select_lex *select,
select_result_interceptor *result,
Item_subselect *item);
void cleanup();
- int prepare();
+ int prepare(THD *thd);
void fix_length_and_dec(Item_cache** row);
int exec();
uint cols();
@@ -869,11 +868,11 @@ class subselect_union_engine: public subselect_engine
{
st_select_lex_unit *unit; /* corresponding unit structure */
public:
- subselect_union_engine(THD *thd_arg, st_select_lex_unit *u,
+ subselect_union_engine(st_select_lex_unit *u,
select_result_interceptor *result,
Item_subselect *item);
void cleanup();
- int prepare();
+ int prepare(THD *);
void fix_length_and_dec(Item_cache** row);
int exec();
uint cols();
@@ -926,11 +925,11 @@ public:
// constructor can assign THD because it will be called after JOIN::prepare
subselect_uniquesubquery_engine(THD *thd_arg, st_join_table *tab_arg,
Item_subselect *subs, Item *where)
- :subselect_engine(thd_arg, subs, 0), tab(tab_arg), cond(where)
+ :subselect_engine(subs, 0), tab(tab_arg), cond(where)
{}
~subselect_uniquesubquery_engine();
void cleanup();
- int prepare();
+ int prepare(THD *);
void fix_length_and_dec(Item_cache** row);
int exec();
uint cols() { return 1; }
@@ -1058,7 +1057,7 @@ public:
subselect_hash_sj_engine(THD *thd_arg, Item_subselect *in_predicate,
subselect_single_select_engine *old_engine)
- : subselect_engine(thd_arg, in_predicate, NULL),
+ : subselect_engine(in_predicate, NULL),
tmp_table(NULL), is_materialized(FALSE), materialize_engine(old_engine),
materialize_join(NULL), semi_join_conds(NULL), lookup_engine(NULL),
count_partial_match_columns(0), count_null_only_columns(0),
@@ -1068,7 +1067,7 @@ public:
bool init(List<Item> *tmp_columns, uint subquery_id);
void cleanup();
- int prepare();
+ int prepare(THD *);
int exec();
virtual void print(String *str, enum_query_type query_type);
uint cols()
@@ -1347,15 +1346,14 @@ protected:
protected:
virtual bool partial_match()= 0;
public:
- subselect_partial_match_engine(THD *thd_arg,
- subselect_uniquesubquery_engine *engine_arg,
+ subselect_partial_match_engine(subselect_uniquesubquery_engine *engine_arg,
TABLE *tmp_table_arg, Item_subselect *item_arg,
select_result_interceptor *result_arg,
List<Item> *equi_join_conds_arg,
bool has_covering_null_row_arg,
bool has_covering_null_columns_arg,
uint count_columns_with_nulls_arg);
- int prepare() { return 0; }
+ int prepare(THD *thd_arg) { set_thd(thd_arg); return 0; }
int exec();
void fix_length_and_dec(Item_cache**) {}
uint cols() { /* TODO: what is the correct value? */ return 1; }
@@ -1442,8 +1440,7 @@ protected:
bool exists_complementing_null_row(MY_BITMAP *keys_to_complement);
bool partial_match();
public:
- subselect_rowid_merge_engine(THD *thd_arg,
- subselect_uniquesubquery_engine *engine_arg,
+ subselect_rowid_merge_engine(subselect_uniquesubquery_engine *engine_arg,
TABLE *tmp_table_arg, uint merge_keys_count_arg,
bool has_covering_null_row_arg,
bool has_covering_null_columns_arg,
@@ -1451,7 +1448,7 @@ public:
Item_subselect *item_arg,
select_result_interceptor *result_arg,
List<Item> *equi_join_conds_arg)
- :subselect_partial_match_engine(thd_arg, engine_arg, tmp_table_arg,
+ :subselect_partial_match_engine(engine_arg, tmp_table_arg,
item_arg, result_arg, equi_join_conds_arg,
has_covering_null_row_arg,
has_covering_null_columns_arg,
@@ -1470,8 +1467,7 @@ class subselect_table_scan_engine: public subselect_partial_match_engine
protected:
bool partial_match();
public:
- subselect_table_scan_engine(THD *thd_arg,
- subselect_uniquesubquery_engine *engine_arg,
+ subselect_table_scan_engine(subselect_uniquesubquery_engine *engine_arg,
TABLE *tmp_table_arg, Item_subselect *item_arg,
select_result_interceptor *result_arg,
List<Item> *equi_join_conds_arg,