[Commits] 58b9507: MDEV-17096 Pushdown of simple derived tables to storage engines
revision-id: 58b950737c547df42c82744029cbcad235e0efd9 (mariadb-10.3.6-133-g58b9507) parent(s): d11be23933def394585fae83a6f1ab561e3736f2 author: Igor Babaev committer: Igor Babaev timestamp: 2019-02-12 13:11:32 -0800 message: MDEV-17096 Pushdown of simple derived tables to storage engines Added plugin system variable federated_pushdown. --- mysql-test/suite/federated/federatedx_create_handlers.test | 4 ++++ storage/federatedx/federatedx_pushdown.cc | 6 ++++++ storage/federatedx/ha_federatedx.cc | 10 ++++++++-- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/mysql-test/suite/federated/federatedx_create_handlers.test b/mysql-test/suite/federated/federatedx_create_handlers.test index 21539b6..558b846 100644 --- a/mysql-test/suite/federated/federatedx_create_handlers.test +++ b/mysql-test/suite/federated/federatedx_create_handlers.test @@ -1,6 +1,8 @@ --source have_federatedx.inc --source include/federated.inc +set global federated_pushdown=1; + connection slave; DROP TABLE IF EXISTS federated.t1; @@ -152,3 +154,5 @@ DROP TABLE federated.t1, federated.t2; connection default; source include/federated_cleanup.inc; + +set global federated_pushdown=0; diff --git a/storage/federatedx/federatedx_pushdown.cc b/storage/federatedx/federatedx_pushdown.cc index c53b359..906d87c 100644 --- a/storage/federatedx/federatedx_pushdown.cc +++ b/storage/federatedx/federatedx_pushdown.cc @@ -19,6 +19,9 @@ static derived_handler* create_federatedx_derived_handler(THD* thd, TABLE_LIST *derived) { + if (!use_pushdown) + return 0; + ha_federatedx_derived_handler* handler = NULL; handlerton *ht= 0; @@ -144,6 +147,9 @@ void ha_federatedx_derived_handler::print_error(int, unsigned long) static select_handler* create_federatedx_select_handler(THD* thd, SELECT_LEX *sel) { + if (!use_pushdown) + return 0; + ha_federatedx_select_handler* handler = NULL; handlerton *ht= 0; diff --git a/storage/federatedx/ha_federatedx.cc b/storage/federatedx/ha_federatedx.cc index 918fbef..f55b0bc 100644 --- a/storage/federatedx/ha_federatedx.cc +++ b/storage/federatedx/ha_federatedx.cc @@ -3677,11 +3677,17 @@ int ha_federatedx::discover_assisted(handlerton *hton, THD* thd, return error; } -#include "federatedx_pushdown.cc" struct st_mysql_storage_engine federatedx_storage_engine= { MYSQL_HANDLERTON_INTERFACE_VERSION }; +my_bool use_pushdown; +static MYSQL_SYSVAR_BOOL(pushdown, use_pushdown, 0, + "Use query fragments pushdown capabilities", NULL, NULL, FALSE); +static struct st_mysql_sys_var* sysvars[]= { MYSQL_SYSVAR(pushdown) }; + +#include "federatedx_pushdown.cc" + maria_declare_plugin(federatedx) { MYSQL_STORAGE_ENGINE_PLUGIN, @@ -3694,7 +3700,7 @@ maria_declare_plugin(federatedx) federatedx_done, /* Plugin Deinit */ 0x0201 /* 2.1 */, NULL, /* status variables */ - NULL, /* system variables */ + sysvars, /* system variables */ "2.1", /* string version */ MariaDB_PLUGIN_MATURITY_STABLE /* maturity */ }
participants (1)
-
IgorBabaev