summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2018-03-20 20:54:58 +0100
committerSergei Golubchik <serg@mariadb.org>2018-03-23 00:55:19 +0100
commitde55a7d1f923849e221ca44d9f8e375569ffe5f0 (patch)
tree6e3c94e5822f8890b200edebca17940cfa3ef6ce /sql
parentb6e2973ee66bad2e998cd2acd2c47fecaa1e6942 (diff)
downloadmariadb-git-de55a7d1f923849e221ca44d9f8e375569ffe5f0.tar.gz
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.
Diffstat (limited to 'sql')
-rw-r--r--sql/sql_parse.cc4
1 files changed, 1 insertions, 3 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 0a68d8ccea8..9271e231197 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -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