Skip to content

Commit ee3c99d

Browse files
committed
Merge branch 'bb-mdev-11016' into 10.1
2 parents af05bec + 7ed5563 commit ee3c99d

File tree

3 files changed

+24
-1
lines changed

3 files changed

+24
-1
lines changed

mysql-test/suite/galera/r/galera_var_dirty_reads.result

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,19 @@ SET @@session.wsrep_dirty_reads=ON;
1818
SELECT * FROM t1;
1919
i
2020
1
21+
SET @@session.wsrep_dirty_reads=OFF;
22+
SELECT 2;
23+
2
24+
2
25+
SELECT @@max_allowed_packet;
26+
@@max_allowed_packet
27+
4194304
28+
SELECT 2+2 from DUAL;
29+
2+2
30+
4
31+
SELECT sysdate() from DUAL;
32+
sysdate()
33+
2016-10-28 23:13:06
2134
SELECT * FROM t1;
2235
i
2336
1

mysql-test/suite/galera/t/galera_var_dirty_reads.test

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,13 @@ SET @@session.wsrep_dirty_reads=ON;
3636

3737
SELECT * FROM t1;
3838

39+
#Select query which does not access table should be allowed MDEV-11016
40+
SET @@session.wsrep_dirty_reads=OFF;
41+
SELECT 2;
42+
SELECT @@max_allowed_packet;
43+
SELECT 2+2 from DUAL;
44+
SELECT sysdate() from DUAL;
45+
3946
--disable_query_log
4047
--eval SET @@global.wsrep_cluster_address = '$wsrep_cluster_address_saved'
4148
--enable_query_log

sql/sql_parse.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2650,12 +2650,15 @@ mysql_execute_command(THD *thd)
26502650

26512651
/*
26522652
Bail out if DB snapshot has not been installed. We however, allow SET,
2653-
SHOW and SELECT queries (only if wsrep_dirty_reads is set).
2653+
SHOW and SELECT queries (only if wsrep_dirty_reads is set or when it
2654+
does not access any table).
26542655
*/
26552656
if (lex->sql_command != SQLCOM_SET_OPTION &&
26562657
!wsrep_is_show_query(lex->sql_command) &&
26572658
!(thd->variables.wsrep_dirty_reads &&
26582659
lex->sql_command == SQLCOM_SELECT) &&
2660+
!(lex->sql_command == SQLCOM_SELECT &&
2661+
!all_tables) &&
26592662
!wsrep_node_is_ready(thd))
26602663
goto error;
26612664
}

0 commit comments

Comments
 (0)