1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-29 08:21:15 +03:00

MCOL-4334 Enable Select Handler for queries run inside Stored Procedures

There is another session variable to enable/disable SH in SP
This commit is contained in:
Roman Nozdrin
2020-10-12 15:20:49 +00:00
parent 09ba586be2
commit 6ab1b829a0
3 changed files with 25 additions and 7 deletions

View File

@ -747,13 +747,8 @@ create_columnstore_select_handler(THD* thd, SELECT_LEX* select_lex)
// Check the session variable value to enable/disable use of
// select_handler
if (!get_select_handler(thd))
{
return handler;
}
// Disable SP support in the select_handler for now.
if ((thd->lex)->sphead)
if (!get_select_handler(thd) ||
((thd->lex)->sphead && !get_select_handler_in_stored_procedures(thd)))
{
return handler;
}

View File

@ -98,6 +98,15 @@ static MYSQL_THDVAR_BOOL(
1
);
static MYSQL_THDVAR_BOOL(
select_handler_in_stored_procedures,
PLUGIN_VAR_NOCMDARG,
"Enable/Disable the MCS select_handler for Stored Procedures",
NULL,
NULL,
1
);
static MYSQL_THDVAR_UINT(
orderby_threads,
PLUGIN_VAR_RQCMDARG,
@ -332,6 +341,7 @@ st_mysql_sys_var* mcs_system_variables[] =
MYSQL_SYSVAR(select_handler),
MYSQL_SYSVAR(derived_handler),
MYSQL_SYSVAR(group_by_handler),
MYSQL_SYSVAR(select_handler_in_stored_procedures),
MYSQL_SYSVAR(orderby_threads),
MYSQL_SYSVAR(decimal_scale),
MYSQL_SYSVAR(use_decimal_scale),
@ -419,6 +429,16 @@ void set_group_by_handler(THD* thd, bool value)
THDVAR(thd, group_by_handler) = value;
}
bool get_select_handler_in_stored_procedures(THD* thd)
{
return ( thd == NULL ) ? true :
THDVAR(thd, select_handler_in_stored_procedures);
}
void set_select_handler_in_stored_procedures(THD* thd, bool value)
{
THDVAR(thd, select_handler_in_stored_procedures) = value;
}
void set_compression_type(THD* thd, ulong value)
{
THDVAR(thd, compression_type) = value;

View File

@ -62,6 +62,9 @@ void set_derived_handler(THD* thd, bool value);
bool get_group_by_handler(THD* thd);
void set_group_by_handler(THD* thd, bool value);
bool get_select_handler_in_stored_procedures(THD* thd);
void set_select_handler_in_stored_procedures(THD* thd, bool value);
uint get_orderby_threads(THD* thd);
void set_orderby_threads(THD* thd, uint value);