1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-03 05:41:09 +03:00

MDEV-11016 wsrep_node_is_ready() check is too strict

Problem:-
  The condition that checks for node readiness is too strict as it does
  not allow SELECTs even if these selects do not access any tables.
    For example,if we run
       SELECT 1;
    OR
       SELECT @@max_allowed_packet;
Solution:-
  We need not to report this error when all_tables(lex->query_tables)
  is NULL:
This commit is contained in:
Sachin Setiya
2017-01-03 10:10:58 +05:30
parent 2f5670dc26
commit d9a1a201aa
5 changed files with 25 additions and 1 deletions

View File

@@ -288,6 +288,7 @@ void init_update_queries(void)
server_command_flags[COM_STMT_RESET]= CF_SKIP_QUESTIONS | CF_SKIP_WSREP_CHECK;
server_command_flags[COM_STMT_EXECUTE]= CF_SKIP_WSREP_CHECK;
server_command_flags[COM_STMT_SEND_LONG_DATA]= CF_SKIP_WSREP_CHECK;
server_command_flags[COM_REGISTER_SLAVE]= CF_SKIP_WSREP_CHECK;
/* Initialize the sql command flags array. */
memset(sql_command_flags, 0, sizeof(sql_command_flags));
@@ -2651,7 +2652,7 @@ mysql_execute_command(THD *thd)
/*
Bail out if DB snapshot has not been installed. SET and SHOW commands,
however, are always allowed.
Select query is also allowed if it does not access any table.
We additionally allow all other commands that do not change data in
case wsrep_dirty_reads is enabled.
*/
@@ -2659,6 +2660,8 @@ mysql_execute_command(THD *thd)
!wsrep_is_show_query(lex->sql_command) &&
!(thd->variables.wsrep_dirty_reads &&
!is_update_query(lex->sql_command)) &&
!(lex->sql_command == SQLCOM_SELECT &&
!all_tables) &&
!wsrep_node_is_ready(thd))
goto error;
}