From 125cf0d4e8eeea135aa553f9bf810aac6bdcd52a Mon Sep 17 00:00:00 2001 From: Guilhem Bichot Date: Wed, 6 Jan 2010 11:54:45 +0100 Subject: WL#5197 "Move @@engine_condition_pushdown to @@optimizer_switch" "set engine_condition_pushdown" is deprecated, engine condition pushdown is controlled by a new "set optimizer_switch=engine_condition_pushdown=on|off". mysql-test/r/index_merge_myisam.result: @@optimizer_switch has a new flag mysql-test/r/mysqld--help-notwin.result: @@optimizer_switch has a new flag mysql-test/r/mysqld--help-win.result: @@optimizer_switch has a new flag mysql-test/r/optimizer_switch_eng_cond_pushdown1.result: Check how --engine-condition-pushdown and --optimizer-switch influence each other when used together (last wins). mysql-test/r/optimizer_switch_eng_cond_pushdown2.result: Check how --engine-condition-pushdown and --optimizer-switch influence each other when used together (last wins). mysql-test/suite/ndb/r/ndb_condition_pushdown.result: @@engine_condition_pushdown is deprecated, use @@optimizer_switch instead mysql-test/suite/ndb/r/ndb_gis.result: @@engine_condition_pushdown is deprecated, use @@optimizer_switch instead mysql-test/suite/ndb/r/ndb_index_unique.result: @@engine_condition_pushdown is deprecated, use @@optimizer_switch instead mysql-test/suite/ndb/t/ndb_condition_pushdown.test: @@engine_condition_pushdown is deprecated, use @@optimizer_switch instead mysql-test/suite/ndb/t/ndb_gis.test: @@engine_condition_pushdown is deprecated, use @@optimizer_switch instead mysql-test/suite/ndb/t/ndb_index_unique.test: @@engine_condition_pushdown is deprecated, use @@optimizer_switch instead mysql-test/suite/sys_vars/r/engine_condition_pushdown_basic.result: Setting @@engine_condition_pushdown gives a deprecation warning now. We test that the engine_condition_pushdown flag of @@optimizer_switch, and @@engine_condition_pushdown influence each other (turning the flag on/off sets the variable on/off and vice-versa). mysql-test/suite/sys_vars/r/optimizer_switch_basic.result: @@optimizer_switch has a new flag mysql-test/suite/sys_vars/t/engine_condition_pushdown_basic.test: Setting @@engine_condition_pushdown gives a deprecation warning now. We test that the engine_condition_pushdown flag of @@optimizer_switch, and @@engine_condition_pushdown influence each other (turning the flag on/off sets the variable on/off and vice-versa). mysql-test/t/optimizer_switch_eng_cond_pushdown1-master.opt: Check how --engine-condition-pushdown and --optimizer-switch influence each other when used together (last wins). mysql-test/t/optimizer_switch_eng_cond_pushdown1.test: Check how --engine-condition-pushdown and --optimizer-switch influence each other when used together (last wins). mysql-test/t/optimizer_switch_eng_cond_pushdown2-master.opt: Check how --engine-condition-pushdown and --optimizer-switch influence each other when used together (last wins). mysql-test/t/optimizer_switch_eng_cond_pushdown2.test: Check how --engine-condition-pushdown and --optimizer-switch influence each other when used together (last wins). sql/mysql_priv.h: new "engine_condition_pushdown" switch in @@optimizer_switch, on by default, like @@engine_condition_pushdown is on by default. Constants are ULL because optimizer_switch is stored in a ulonglong. sql/mysqld.cc: Making --engine-condition-pushdown and --optimizer-switch (command-line options) influence each other (last wins) sql/records.cc: @@engine_condition_pushdown is deprecated, use @@optimizer_switch instead sql/sql_select.cc: @@engine_condition_pushdown is deprecated, use @@optimizer_switch instead sql/sys_vars.cc: Setting @@engine_condition_pushdown now issues a deprecation message. The version for removal is unknown at this point so I copied it from other deprecation warnings in this file. Turning on/off the engine_condition_pushdown flag of @@optimizer_switch (with SET) turns on/off the @@engine_condition_pushdown variable, and vice-versa, thanks to fix_* functions. --- sql/mysql_priv.h | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'sql/mysql_priv.h') diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 1615ca97073..bf0c587f7ae 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -622,17 +622,19 @@ protected: #define MODE_PAD_CHAR_TO_FULL_LENGTH (ULL(1) << 31) /* @@optimizer_switch flags. These must be in sync with optimizer_switch_typelib */ -#define OPTIMIZER_SWITCH_INDEX_MERGE 1 -#define OPTIMIZER_SWITCH_INDEX_MERGE_UNION 2 -#define OPTIMIZER_SWITCH_INDEX_MERGE_SORT_UNION 4 -#define OPTIMIZER_SWITCH_INDEX_MERGE_INTERSECT 8 -#define OPTIMIZER_SWITCH_LAST 16 +#define OPTIMIZER_SWITCH_INDEX_MERGE (1ULL << 0) +#define OPTIMIZER_SWITCH_INDEX_MERGE_UNION (1ULL << 1) +#define OPTIMIZER_SWITCH_INDEX_MERGE_SORT_UNION (1ULL << 2) +#define OPTIMIZER_SWITCH_INDEX_MERGE_INTERSECT (1ULL << 3) +#define OPTIMIZER_SWITCH_ENGINE_CONDITION_PUSHDOWN (1ULL << 4) +#define OPTIMIZER_SWITCH_LAST (1ULL << 5) /* The following must be kept in sync with optimizer_switch_str in mysqld.cc */ #define OPTIMIZER_SWITCH_DEFAULT (OPTIMIZER_SWITCH_INDEX_MERGE | \ OPTIMIZER_SWITCH_INDEX_MERGE_UNION | \ OPTIMIZER_SWITCH_INDEX_MERGE_SORT_UNION | \ - OPTIMIZER_SWITCH_INDEX_MERGE_INTERSECT) + OPTIMIZER_SWITCH_INDEX_MERGE_INTERSECT | \ + OPTIMIZER_SWITCH_ENGINE_CONDITION_PUSHDOWN) /* @@ -2636,7 +2638,8 @@ enum options_mysqld OPT_SSL_CIPHER, OPT_SSL_KEY, OPT_UPDATE_LOG, - OPT_WANT_CORE + OPT_WANT_CORE, + OPT_ENGINE_CONDITION_PUSHDOWN }; #endif /* MYSQL_SERVER */ -- cgit v1.2.1