summaryrefslogtreecommitdiff
path: root/sql/sql_parse.cc
diff options
context:
space:
mode:
authorSachin Setiya <sachinsetia1001@gmail.com>2016-12-14 15:22:04 +0530
committerSachin Setiya <sachinsetia1001@gmail.com>2016-12-14 15:32:40 +0530
commit4c1e181ac5eac55c67705ffe29b48a5d832211be (patch)
tree3e00b2eedd26cb54dd96498a4a03080591ec2cf0 /sql/sql_parse.cc
parentffdd1e9d888edc4e147c3b316a87468b000f8dd4 (diff)
downloadmariadb-git-4c1e181ac5eac55c67705ffe29b48a5d832211be.tar.gz
MDEV-11479 Improved wsrep_dirty_reads
Tasks:- Changes in wsrep_dirty_reads variable 1.) Global + Session scope (Current: session-only) 2.) Can be set using command line. 3.) Allow all commands that do not change data (besides SELECT) 4.) Allow prepared Statements that do not change data 5.) Works with wsrep_sync_wait enabled
Diffstat (limited to 'sql/sql_parse.cc')
-rw-r--r--sql/sql_parse.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 4ed1b7a5323..d92ef810498 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -2633,13 +2633,16 @@ mysql_execute_command(THD *thd)
}
/*
- Bail out if DB snapshot has not been installed. We however,
- allow SET and SHOW queries.
+ Bail out if DB snapshot has not been installed. SET and SHOW commands,
+ however, are always allowed.
+
+ We additionally allow all other commands that do not change data in
+ case wsrep_dirty_reads is enabled.
*/
if (thd->variables.wsrep_on && !thd->wsrep_applier && !wsrep_ready &&
lex->sql_command != SQLCOM_SET_OPTION &&
!(thd->variables.wsrep_dirty_reads &&
- lex->sql_command == SQLCOM_SELECT) &&
+ !is_update_query(lex->sql_command)) &&
!wsrep_is_show_query(lex->sql_command))
{
my_message(ER_UNKNOWN_COM_ERROR,