Allow table-less selects even when wsrep is not ready
It doesn't make sense to allow selects from I_S but disallow selects that don't use any tables at all, because any (disallowed) select that doesn't use tables can be made allowed by adding "FROM I_S.COLLATIONS LIMIT 1" to the end. And it break mysql-test rather badly, even check-testcase.test fails on its first `SELECT '$tmp' = 'No such row'` This reverts 9a896148576, c5dd2abf4ca, and 33028f7c4bc: Refs: MW-245 - changed logic so that in non primary node it is possible to do SET + SHOW + SELECT from information and pfs schema, when dirty reads are not enabled - however, non table selects are not allowed (e.g. SELECT 1) Refs MW-245 - logic was wrong in detecting if queries are allowed in non primary node. it allowed select with no table list to execute even if dirty reads was not specified Refs: MW-245 - Adjust tests to account for the new behavior.
This commit is contained in:
parent
b6e2973ee6
commit
de55a7d1f9
@ -30,9 +30,9 @@ SET @@session.wsrep_dirty_reads=OFF;
|
||||
SELECT i, variable_name, variable_value FROM t1, information_schema.session_variables WHERE variable_name LIKE "wsrep_dirty_reads" AND i = 1;
|
||||
ERROR 08S01: WSREP has not yet prepared node for application use
|
||||
SELECT 1;
|
||||
ERROR 08S01: WSREP has not yet prepared node for application use
|
||||
1
|
||||
1
|
||||
USE information_schema;
|
||||
ERROR 08S01: WSREP has not yet prepared node for application use
|
||||
SELECT * FROM information_schema.session_variables WHERE variable_name LIKE "wsrep_dirty_reads";
|
||||
VARIABLE_NAME VARIABLE_VALUE
|
||||
WSREP_DIRTY_READS OFF
|
||||
|
@ -51,7 +51,7 @@ INSERT INTO t1 VALUES (1),(2),(3),(4),(5);
|
||||
--let $value = query_get_value(SHOW SLAVE STATUS, Last_SQL_Error, 1)
|
||||
--connection node_3
|
||||
--disable_query_log
|
||||
--eval SELECT "$value" IN ("Error 'WSREP has not yet prepared node for application use' on query. Default database: 'test'. Query: 'BEGIN'", "Node has dropped from cluster") AS expected_error
|
||||
--eval SELECT "$value" IN ("Error 'Unknown command' on query. Default database: 'test'. Query: 'BEGIN'", "Node has dropped from cluster") AS expected_error
|
||||
--enable_query_log
|
||||
|
||||
# Step #4. Bring back the async slave and restart replication
|
||||
@ -85,9 +85,8 @@ DROP TABLE t1;
|
||||
STOP SLAVE;
|
||||
RESET SLAVE ALL;
|
||||
|
||||
CALL mtr.add_suppression("Slave SQL: Error 'WSREP has not yet prepared node for application use' on query");
|
||||
CALL mtr.add_suppression("Slave: WSREP has not yet prepared node for application use Error_code: 1047");
|
||||
CALL mtr.add_suppression("TORDERED} returned -107 \\(Transport endpoint is not connected\\)");
|
||||
CALL mtr.add_suppression("Slave SQL: Error 'Unknown command' on query");
|
||||
CALL mtr.add_suppression("Slave: Unknown command Error_code: 1047");
|
||||
CALL mtr.add_suppression("Transport endpoint is not connected");
|
||||
CALL mtr.add_suppression("Slave SQL: Error in Xid_log_event: Commit could not be completed, 'Deadlock found when trying to get lock; try restarting transaction', Error_code: 1213");
|
||||
CALL mtr.add_suppression("Slave SQL: Node has dropped from cluster, Error_code: 1047");
|
||||
|
@ -47,10 +47,8 @@ SET @@session.wsrep_dirty_reads=OFF;
|
||||
--error ER_UNKNOWN_COM_ERROR
|
||||
SELECT i, variable_name, variable_value FROM t1, information_schema.session_variables WHERE variable_name LIKE "wsrep_dirty_reads" AND i = 1;
|
||||
|
||||
--error ER_UNKNOWN_COM_ERROR
|
||||
SELECT 1;
|
||||
|
||||
--error ER_UNKNOWN_COM_ERROR
|
||||
USE information_schema;
|
||||
|
||||
SELECT * FROM information_schema.session_variables WHERE variable_name LIKE "wsrep_dirty_reads";
|
||||
|
@ -893,7 +893,6 @@ void cleanup_items(Item *item)
|
||||
#ifdef WITH_WSREP
|
||||
static bool wsrep_tables_accessible_when_detached(const TABLE_LIST *tables)
|
||||
{
|
||||
bool has_tables = false;
|
||||
for (const TABLE_LIST *table= tables; table; table= table->next_global)
|
||||
{
|
||||
TABLE_CATEGORY c;
|
||||
@ -906,9 +905,8 @@ static bool wsrep_tables_accessible_when_detached(const TABLE_LIST *tables)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
has_tables = true;
|
||||
}
|
||||
return has_tables;
|
||||
return true;
|
||||
}
|
||||
#endif /* WITH_WSREP */
|
||||
#ifndef EMBEDDED_LIBRARY
|
||||
|
Loading…
x
Reference in New Issue
Block a user