Commit ee51f582 authored by Oleksandr Byelkin's avatar Oleksandr Byelkin

MDEV-10340: support COM_RESET_CONNECTION

parent 78b5e8d6
......@@ -9,6 +9,8 @@ enum enum_server_command
COM_TABLE_DUMP, COM_CONNECT_OUT, COM_REGISTER_SLAVE,
COM_STMT_PREPARE, COM_STMT_EXECUTE, COM_STMT_SEND_LONG_DATA, COM_STMT_CLOSE,
COM_STMT_RESET, COM_SET_OPTION, COM_STMT_FETCH, COM_DAEMON,
COM_UNIMPLEMENTED,
COM_RESET_CONNECTION,
COM_MDB_GAP_BEG,
COM_MDB_GAP_END=250,
COM_SLAVE_WORKER=251,
......
......@@ -111,6 +111,8 @@ enum enum_server_command
COM_TABLE_DUMP, COM_CONNECT_OUT, COM_REGISTER_SLAVE,
COM_STMT_PREPARE, COM_STMT_EXECUTE, COM_STMT_SEND_LONG_DATA, COM_STMT_CLOSE,
COM_STMT_RESET, COM_SET_OPTION, COM_STMT_FETCH, COM_DAEMON,
COM_UNIMPLEMENTED, // COM_BINLOG_DUMP_GTID in MySQL
COM_RESET_CONNECTION,
/* don't forget to update const char *command_name[] in sql_parse.cc */
COM_MDB_GAP_BEG,
COM_MDB_GAP_END=250,
......
......@@ -1392,7 +1392,7 @@ performance-schema-max-rwlock-instances -1
performance-schema-max-socket-classes 10
performance-schema-max-socket-instances -1
performance-schema-max-stage-classes 150
performance-schema-max-statement-classes 185
performance-schema-max-statement-classes 187
performance-schema-max-table-handles -1
performance-schema-max-table-instances -1
performance-schema-max-thread-classes 50
......
......@@ -2867,9 +2867,9 @@ READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_STATEMENT_CLASSES
SESSION_VALUE NULL
GLOBAL_VALUE 185
GLOBAL_VALUE 187
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 185
DEFAULT_VALUE 187
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Maximum number of statement instruments.
......
......@@ -3063,9 +3063,9 @@ READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_STATEMENT_CLASSES
SESSION_VALUE NULL
GLOBAL_VALUE 185
GLOBAL_VALUE 187
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 185
DEFAULT_VALUE 187
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Maximum number of statement instruments.
......
......@@ -171,8 +171,8 @@ const LEX_STRING command_name[257]={
{ C_STRING_WITH_LEN("Set option") }, //27
{ C_STRING_WITH_LEN("Fetch") }, //28
{ C_STRING_WITH_LEN("Daemon") }, //29
{ 0, 0 }, //30
{ 0, 0 }, //31
{ C_STRING_WITH_LEN("Unimpl get tid") }, //30
{ C_STRING_WITH_LEN("Reset connection") },//31
{ 0, 0 }, //32
{ 0, 0 }, //33
{ 0, 0 }, //34
......@@ -525,6 +525,7 @@ void init_update_queries(void)
server_command_flags[COM_STMT_SEND_LONG_DATA]= CF_SKIP_WSREP_CHECK;
server_command_flags[COM_REGISTER_SLAVE]= CF_SKIP_WSREP_CHECK;
server_command_flags[COM_MULTI]= CF_SKIP_WSREP_CHECK | CF_NO_COM_MULTI;
server_command_flags[CF_NO_COM_MULTI]= CF_NO_COM_MULTI;
/* Initialize the sql command flags array. */
memset(sql_command_flags, 0, sizeof(sql_command_flags));
......@@ -1671,6 +1672,14 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
break;
}
#endif
case COM_RESET_CONNECTION:
{
thd->status_var.com_other++;
thd->change_user();
thd->clear_error(); // if errors from rollback
my_ok(thd, 0, 0, 0);
break;
}
case COM_CHANGE_USER:
{
int auth_rc;
......@@ -2307,6 +2316,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
case COM_TIME: // Impossible from client
case COM_DELAYED_INSERT:
case COM_END:
case COM_UNIMPLEMENTED:
default:
my_message(ER_UNKNOWN_COM_ERROR, ER_THD(thd, ER_UNKNOWN_COM_ERROR),
MYF(0));
......
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