summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2014-08-25 23:13:37 +0200
committerSergei Golubchik <serg@mariadb.org>2014-10-10 22:27:40 +0200
commitab34aecff3c6c9c33ca682c90a79ec60d59f42ed (patch)
tree7d8eaecd0ba11b9b5a5b4020276726e8f67a9be8 /sql
parent686f102eb9a9eb4c9b0f713e532b19409b8bbbe6 (diff)
downloadmariadb-git-ab34aecff3c6c9c33ca682c90a79ec60d59f42ed.tar.gz
MDEV-6513 deprecate engine_condition_pushdown value of the @@optimizer_switch
* ignore the OPTIMIZER_SWITCH_ENGINE_CONDITION_PUSHDOWN bit * issue a deprecation warning on 'engine_condition_pushdown=on' * remove unused remains of the old pre-5.5 engine_condition_pushdown variable
Diffstat (limited to 'sql')
-rw-r--r--sql/handler.h14
-rw-r--r--sql/mysqld.cc16
-rw-r--r--sql/mysqld.h1
-rw-r--r--sql/records.cc4
-rw-r--r--sql/sql_class.h1
-rw-r--r--sql/sql_priv.h2
-rw-r--r--sql/sql_select.cc12
-rw-r--r--sql/sys_vars.cc8
8 files changed, 16 insertions, 42 deletions
diff --git a/sql/handler.h b/sql/handler.h
index 703d1c615b3..4ba312963ac 100644
--- a/sql/handler.h
+++ b/sql/handler.h
@@ -197,17 +197,11 @@ enum enum_alter_inplace_result {
#define HA_RECORD_MUST_BE_CLEAN_ON_WRITE (1ULL << 41)
/*
- Table condition pushdown must be performed regardless of
- 'engine_condition_pushdown' setting.
-
- This flag is aimed at storage engines that come with "special" predicates
- that can only be evaluated inside the storage engine.
- For example, when one does
- select * from sphinx_table where query='{fulltext_query}'
- then the "query=..." condition must be always pushed down into storage
- engine.
+ This storage engine supports condition pushdown
*/
-#define HA_MUST_USE_TABLE_CONDITION_PUSHDOWN (1ULL << 42)
+#define HA_CAN_TABLE_CONDITION_PUSHDOWN (1ULL << 42)
+/* old name for the same flag */
+#define HA_MUST_USE_TABLE_CONDITION_PUSHDOWN HA_CAN_TABLE_CONDITION_PUSHDOWN
/**
The handler supports read before write removal optimization
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 6f0cbc24e63..31d51123f8d 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -8807,18 +8807,6 @@ mysqld_get_one_option(int optid,
}
break;
#endif /* defined(ENABLED_DEBUG_SYNC) */
- case OPT_ENGINE_CONDITION_PUSHDOWN:
- /*
- The last of --engine-condition-pushdown and --optimizer_switch on
- command line wins (see get_options().
- */
- if (global_system_variables.engine_condition_pushdown)
- global_system_variables.optimizer_switch|=
- OPTIMIZER_SWITCH_ENGINE_CONDITION_PUSHDOWN;
- else
- global_system_variables.optimizer_switch&=
- ~OPTIMIZER_SWITCH_ENGINE_CONDITION_PUSHDOWN;
- break;
case OPT_LOG_ERROR:
/*
"No --log-error" == "write errors to stderr",
@@ -9199,10 +9187,6 @@ static int get_options(int *argc_ptr, char ***argv_ptr)
&extra_connection_count);
#endif
- global_system_variables.engine_condition_pushdown=
- MY_TEST(global_system_variables.optimizer_switch &
- OPTIMIZER_SWITCH_ENGINE_CONDITION_PUSHDOWN);
-
opt_readonly= read_only;
/*
diff --git a/sql/mysqld.h b/sql/mysqld.h
index d1efc5180a6..d68831a0d4f 100644
--- a/sql/mysqld.h
+++ b/sql/mysqld.h
@@ -558,7 +558,6 @@ enum options_mysqld
OPT_DEBUG_SYNC_TIMEOUT,
OPT_DELAY_KEY_WRITE_ALL,
OPT_DEPRECATED_OPTION,
- OPT_ENGINE_CONDITION_PUSHDOWN,
OPT_IGNORE_DB_DIRECTORY,
OPT_ISAM_LOG,
OPT_KEY_BUFFER_SIZE,
diff --git a/sql/records.cc b/sql/records.cc
index 1b230c41156..cbcdb365f40 100644
--- a/sql/records.cc
+++ b/sql/records.cc
@@ -287,8 +287,8 @@ bool init_read_record(READ_RECORD *info,THD *thd, TABLE *table,
thd->variables.read_buff_size);
}
/* Condition pushdown to storage engine */
- if ((thd->variables.optimizer_switch &
- OPTIMIZER_SWITCH_ENGINE_CONDITION_PUSHDOWN) &&
+ if ((table->file->ha_table_flags() &
+ HA_MUST_USE_TABLE_CONDITION_PUSHDOWN) &&
select && select->cond &&
(select->cond->used_tables() & table->map) &&
!table->file->pushed_cond)
diff --git a/sql/sql_class.h b/sql/sql_class.h
index 243cc4459a0..dfa6da5b7ce 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -602,7 +602,6 @@ typedef struct system_variables
my_bool tx_read_only;
my_bool low_priority_updates;
my_bool query_cache_wlock_invalidate;
- my_bool engine_condition_pushdown;
my_bool keep_files_on_create;
my_bool old_mode;
diff --git a/sql/sql_priv.h b/sql/sql_priv.h
index 5dc19181e9b..9578c2fe8df 100644
--- a/sql/sql_priv.h
+++ b/sql/sql_priv.h
@@ -199,7 +199,7 @@ template <class T> bool valid_buffer_range(T jump,
#define OPTIMIZER_SWITCH_INDEX_MERGE_SORT_UNION (1ULL << 2)
#define OPTIMIZER_SWITCH_INDEX_MERGE_INTERSECT (1ULL << 3)
#define OPTIMIZER_SWITCH_INDEX_MERGE_SORT_INTERSECT (1ULL << 4)
-#define OPTIMIZER_SWITCH_ENGINE_CONDITION_PUSHDOWN (1ULL << 5)
+#define deprecated_ENGINE_CONDITION_PUSHDOWN (1ULL << 5)
#define OPTIMIZER_SWITCH_INDEX_COND_PUSHDOWN (1ULL << 6)
#define OPTIMIZER_SWITCH_DERIVED_MERGE (1ULL << 7)
#define OPTIMIZER_SWITCH_DERIVED_WITH_KEYS (1ULL << 8)
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 5e8c3b26ff3..f7d492ceb68 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -9569,10 +9569,8 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond)
if (tab->table)
{
tab->table->file->pushed_cond= NULL;
- if (((thd->variables.optimizer_switch &
- OPTIMIZER_SWITCH_ENGINE_CONDITION_PUSHDOWN) ||
- (tab->table->file->ha_table_flags() &
- HA_MUST_USE_TABLE_CONDITION_PUSHDOWN)) &&
+ if ((tab->table->file->ha_table_flags() &
+ HA_MUST_USE_TABLE_CONDITION_PUSHDOWN) &&
!first_inner_tab)
{
COND *push_cond=
@@ -23631,10 +23629,8 @@ void JOIN_TAB::save_explain_data(Explain_table_access *eta, table_map prefix_tab
{
const COND *pushed_cond= tab->table->file->pushed_cond;
- if (((thd->variables.optimizer_switch &
- OPTIMIZER_SWITCH_ENGINE_CONDITION_PUSHDOWN) ||
- (tab->table->file->ha_table_flags() &
- HA_MUST_USE_TABLE_CONDITION_PUSHDOWN)) &&
+ if ((tab->table->file->ha_table_flags() &
+ HA_MUST_USE_TABLE_CONDITION_PUSHDOWN) &&
pushed_cond)
{
eta->push_extra(ET_USING_WHERE_WITH_PUSHED_CONDITION);
diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc
index b9304403ee5..722dabeb15a 100644
--- a/sql/sys_vars.cc
+++ b/sql/sys_vars.cc
@@ -2222,13 +2222,15 @@ export const char *optimizer_switch_names[]=
"exists_to_in",
"default", NullS
};
-/** propagates changes to @@engine_condition_pushdown */
static bool fix_optimizer_switch(sys_var *self, THD *thd,
enum_var_type type)
{
SV *sv= (type == OPT_GLOBAL) ? &global_system_variables : &thd->variables;
- sv->engine_condition_pushdown=
- MY_TEST(sv->optimizer_switch & OPTIMIZER_SWITCH_ENGINE_CONDITION_PUSHDOWN);
+ if (sv->optimizer_switch & deprecated_ENGINE_CONDITION_PUSHDOWN)
+ push_warning_printf(current_thd, Sql_condition::WARN_LEVEL_WARN,
+ ER_WARN_DEPRECATED_SYNTAX_NO_REPLACEMENT,
+ ER(ER_WARN_DEPRECATED_SYNTAX_NO_REPLACEMENT),
+ "engine_condition_pushdown=on");
return false;
}
static Sys_var_flagset Sys_optimizer_switch(