1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-01 06:46:55 +03:00

MCOL-4525 Implement columnstore_select_handler=AUTO.

This feature allows a query execution to fallback to the server,
in case query execution using the select_handler (SH) fails. In case
of fallback, a warning message containing the original reason for
query failure using SH is generated.

To accomplish this task, SH execution is moved to an earlier step when
we create the SH in create_columnstore_select_handler(), instead of the
previous call to SH execution in ha_columnstore_select_handler::init_scan().
This requires some pre-requisite steps that occur in the server in
JOIN::optimize() and JOIN::exec() to be performed before starting SH execution.

In addition, missing test cases from MCOL-424 are also added to the MTR suite,
and the corresponding fix using disable_indices_for_CEJ() is reverted back
since the original fix now appears to be redundant.
This commit is contained in:
Gagan Goel
2021-06-03 13:52:38 +00:00
parent 4ecd561878
commit e3d8100150
13 changed files with 1065 additions and 146 deletions

View File

@ -71,13 +71,28 @@ static MYSQL_THDVAR_ULONGLONG(
1
);
static MYSQL_THDVAR_BOOL(
const char* mcs_select_handler_mode_values[] = {
"OFF",
"ON",
"AUTO",
NullS
};
static TYPELIB mcs_select_handler_mode_values_lib = {
array_elements(mcs_select_handler_mode_values) - 1,
"mcs_select_handler_mode_values",
mcs_select_handler_mode_values,
NULL
};
static MYSQL_THDVAR_ENUM(
select_handler,
PLUGIN_VAR_NOCMDARG,
"Enable/Disable the MCS select_handler",
NULL,
NULL,
1
PLUGIN_VAR_RQCMDARG,
"Set the MCS select_handler to Disabled, Enabled, or Automatic",
NULL, // check
NULL, // update
1, // default
&mcs_select_handler_mode_values_lib // values lib
);
static MYSQL_THDVAR_BOOL(
@ -288,17 +303,17 @@ static MYSQL_THDVAR_ULONG(
1 // block size
);
const char* mcs_use_import_for_batchinsert_values[] = {
const char* mcs_use_import_for_batchinsert_mode_values[] = {
"OFF",
"ON",
"ALWAYS",
NullS
};
static TYPELIB mcs_use_import_for_batchinsert_values_lib = {
array_elements(mcs_use_import_for_batchinsert_values) - 1,
"mcs_use_import_for_batchinsert_values",
mcs_use_import_for_batchinsert_values,
static TYPELIB mcs_use_import_for_batchinsert_mode_values_lib = {
array_elements(mcs_use_import_for_batchinsert_mode_values) - 1,
"mcs_use_import_for_batchinsert_mode_values",
mcs_use_import_for_batchinsert_mode_values,
NULL
};
@ -309,7 +324,7 @@ static MYSQL_THDVAR_ENUM(
NULL, // check
NULL, // update
1, // default
&mcs_use_import_for_batchinsert_values_lib // values lib
&mcs_use_import_for_batchinsert_mode_values_lib // values lib
);
static MYSQL_THDVAR_BOOL(
@ -412,11 +427,12 @@ void set_original_optimizer_flags(ulonglong ptr, THD* thd)
THDVAR(current_thd, original_optimizer_flags) = (uint64_t)(ptr);
}
bool get_select_handler(THD* thd)
mcs_select_handler_mode_t get_select_handler_mode(THD* thd)
{
return ( thd == NULL ) ? false : THDVAR(thd, select_handler);
return ( thd == NULL ) ? mcs_select_handler_mode_t::ON :
(mcs_select_handler_mode_t) THDVAR(thd, select_handler);
}
void set_select_handler(THD* thd, bool value)
void set_select_handler_mode(THD* thd, ulong value)
{
THDVAR(thd, select_handler) = value;
}
@ -585,12 +601,12 @@ void set_local_query(THD* thd, ulong value)
THDVAR(thd, local_query) = value;
}
mcs_use_import_for_batchinsert_t get_use_import_for_batchinsert(THD* thd)
mcs_use_import_for_batchinsert_mode_t get_use_import_for_batchinsert_mode(THD* thd)
{
return ( thd == NULL ) ? mcs_use_import_for_batchinsert_t::ON :
(mcs_use_import_for_batchinsert_t) THDVAR(thd, use_import_for_batchinsert);
return ( thd == NULL ) ? mcs_use_import_for_batchinsert_mode_t::ON :
(mcs_use_import_for_batchinsert_mode_t) THDVAR(thd, use_import_for_batchinsert);
}
void set_use_import_for_batchinsert(THD* thd, ulong value)
void set_use_import_for_batchinsert_mode(THD* thd, ulong value)
{
THDVAR(thd, use_import_for_batchinsert) = value;
}