Commit 58b95073 authored by Igor Babaev's avatar Igor Babaev

MDEV-17096 Pushdown of simple derived tables to storage engines

Added plugin system variable federated_pushdown.
parent d11be239
--source have_federatedx.inc --source have_federatedx.inc
--source include/federated.inc --source include/federated.inc
set global federated_pushdown=1;
connection slave; connection slave;
DROP TABLE IF EXISTS federated.t1; DROP TABLE IF EXISTS federated.t1;
...@@ -152,3 +154,5 @@ DROP TABLE federated.t1, federated.t2; ...@@ -152,3 +154,5 @@ DROP TABLE federated.t1, federated.t2;
connection default; connection default;
source include/federated_cleanup.inc; source include/federated_cleanup.inc;
set global federated_pushdown=0;
...@@ -19,6 +19,9 @@ ...@@ -19,6 +19,9 @@
static derived_handler* static derived_handler*
create_federatedx_derived_handler(THD* thd, TABLE_LIST *derived) create_federatedx_derived_handler(THD* thd, TABLE_LIST *derived)
{ {
if (!use_pushdown)
return 0;
ha_federatedx_derived_handler* handler = NULL; ha_federatedx_derived_handler* handler = NULL;
handlerton *ht= 0; handlerton *ht= 0;
...@@ -144,6 +147,9 @@ void ha_federatedx_derived_handler::print_error(int, unsigned long) ...@@ -144,6 +147,9 @@ void ha_federatedx_derived_handler::print_error(int, unsigned long)
static select_handler* static select_handler*
create_federatedx_select_handler(THD* thd, SELECT_LEX *sel) create_federatedx_select_handler(THD* thd, SELECT_LEX *sel)
{ {
if (!use_pushdown)
return 0;
ha_federatedx_select_handler* handler = NULL; ha_federatedx_select_handler* handler = NULL;
handlerton *ht= 0; handlerton *ht= 0;
......
...@@ -3677,11 +3677,17 @@ int ha_federatedx::discover_assisted(handlerton *hton, THD* thd, ...@@ -3677,11 +3677,17 @@ int ha_federatedx::discover_assisted(handlerton *hton, THD* thd,
return error; return error;
} }
#include "federatedx_pushdown.cc"
struct st_mysql_storage_engine federatedx_storage_engine= struct st_mysql_storage_engine federatedx_storage_engine=
{ MYSQL_HANDLERTON_INTERFACE_VERSION }; { 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) maria_declare_plugin(federatedx)
{ {
MYSQL_STORAGE_ENGINE_PLUGIN, MYSQL_STORAGE_ENGINE_PLUGIN,
...@@ -3694,7 +3700,7 @@ maria_declare_plugin(federatedx) ...@@ -3694,7 +3700,7 @@ maria_declare_plugin(federatedx)
federatedx_done, /* Plugin Deinit */ federatedx_done, /* Plugin Deinit */
0x0201 /* 2.1 */, 0x0201 /* 2.1 */,
NULL, /* status variables */ NULL, /* status variables */
NULL, /* system variables */ sysvars, /* system variables */
"2.1", /* string version */ "2.1", /* string version */
MariaDB_PLUGIN_MATURITY_STABLE /* maturity */ MariaDB_PLUGIN_MATURITY_STABLE /* maturity */
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment