diff options
author | Raghavendra D Prabhu <rprabhu@wnohang.net> | 2015-07-16 05:24:13 -0700 |
---|---|---|
committer | Nirbhay Choubey <nirbhay@mariadb.com> | 2016-02-22 17:59:06 -0500 |
commit | 1077eef94273a87a22d656a2fcd4e47413a29aed (patch) | |
tree | 71cd09bae46d3dd98586e94b499d9a45aa0fcb61 /sql/sql_admin.cc | |
parent | 5be449d014d0bdab4859409860deec669a1f11f3 (diff) | |
download | mariadb-git-1077eef94273a87a22d656a2fcd4e47413a29aed.tar.gz |
PXC-391: Avoid Total Order Isolation (TOI) for LOCAL sql admin commands.
The admin commands in question are:
> OPTIMIZE
> REPAIR
> ANALYZE
For LOCAL or NO_WRITE_TO_BINLOG invocations of these commands, ie
OPTIMIZE LOCAL TABLE <t1>
they are not binlogged as expected.
Also, in addition, they are not executed under TOI.
Hence, they are not propagated to other nodes.
The effect is same as that of wsrep_on=0.
Also added tests for this.
A WSREP_DEBUG for wsrep_register_hton has also been added.
The galera_flush_local test has also been updated for verifying that effects
of NO_WRITE_TO_BINLOG / LOCAL are equivalent to wsrep_on=0 from wsrep
perspective.
(cherry picked from commit 5065122f94a8002d4da231528a46f8d9ddbffdc2)
Conflicts:
sql/sql_admin.cc
sql/sql_reload.cc
sql/wsrep_hton.cc
Diffstat (limited to 'sql/sql_admin.cc')
-rw-r--r-- | sql/sql_admin.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sql/sql_admin.cc b/sql/sql_admin.cc index 5ffa8b16345..3ed8545bcb4 100644 --- a/sql/sql_admin.cc +++ b/sql/sql_admin.cc @@ -1175,6 +1175,7 @@ bool Sql_cmd_analyze_table::execute(THD *thd) if (check_table_access(thd, SELECT_ACL | INSERT_ACL, first_table, FALSE, UINT_MAX, FALSE)) goto error; + WSREP_TO_ISOLATION_BEGIN_WRTCHK(NULL, NULL, first_table); thd->enable_slow_log= opt_log_slow_admin_statements; #ifdef WITH_WSREP WSREP_TO_ISOLATION_BEGIN(first_table->db, first_table->table_name, NULL); @@ -1233,7 +1234,7 @@ bool Sql_cmd_optimize_table::execute(THD *thd) if (check_table_access(thd, SELECT_ACL | INSERT_ACL, first_table, FALSE, UINT_MAX, FALSE)) goto error; /* purecov: inspected */ - WSREP_TO_ISOLATION_BEGIN(first_table->db, first_table->table_name, NULL) + WSREP_TO_ISOLATION_BEGIN_WRTCHK(NULL, NULL, first_table); thd->enable_slow_log= opt_log_slow_admin_statements; res= (specialflag & SPECIAL_NO_NEW_FUNC) ? mysql_recreate_table(thd, first_table, true) : @@ -1267,7 +1268,7 @@ bool Sql_cmd_repair_table::execute(THD *thd) FALSE, UINT_MAX, FALSE)) goto error; /* purecov: inspected */ thd->enable_slow_log= opt_log_slow_admin_statements; - WSREP_TO_ISOLATION_BEGIN(first_table->db, first_table->table_name, NULL) + WSREP_TO_ISOLATION_BEGIN_WRTCHK(NULL, NULL, first_table); res= mysql_admin_table(thd, first_table, &m_lex->check_opt, "repair", TL_WRITE, 1, MY_TEST(m_lex->check_opt.sql_flags & TT_USEFRM), |