Skip to content

Commit dc22acf

Browse files
author
Daniele Sciascia
authored
MDEV-22616 CHECK TABLE fails with wsrep_trx_fragment_size > 0 (#1551)
Executing CHECK TABLE with streaming replication enabled reports error "Streaming replication not supported with binlog_format=STATEMENT". Administrative commands such as CHECK TABLE, are not replicated and temporarily set binlog format to statement. To avoid the problem, report the error only for active transactions for which streaming replication is enabled.
1 parent ce1c6da commit dc22acf

File tree

3 files changed

+34
-1
lines changed

3 files changed

+34
-1
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
connection node_2;
2+
connection node_1;
3+
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
4+
SET SESSION wsrep_trx_fragment_size = 1;
5+
CHECK TABLE t1;
6+
Table Op Msg_type Msg_text
7+
test.t1 check status OK
8+
START TRANSACTION;
9+
INSERT INTO t1 VALUES (1);
10+
CHECK TABLE t1;
11+
Table Op Msg_type Msg_text
12+
test.t1 check status OK
13+
DROP TABLE t1;
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#
2+
# MDEV-22616
3+
#
4+
# CHECK TABLE fails with wsrep_trx_fragment_size > 0
5+
#
6+
7+
--source include/galera_cluster.inc
8+
9+
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
10+
SET SESSION wsrep_trx_fragment_size = 1;
11+
CHECK TABLE t1;
12+
13+
START TRANSACTION;
14+
INSERT INTO t1 VALUES (1);
15+
16+
CHECK TABLE t1;
17+
18+
DROP TABLE t1;

sql/sql_class.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5758,7 +5758,9 @@ int THD::decide_logging_format(TABLE_LIST *tables)
57585758
binlog by filtering rules.
57595759
*/
57605760
#ifdef WITH_WSREP
5761-
if (WSREP_CLIENT_NNULL(this) && wsrep_thd_is_local(this) &&
5761+
if (WSREP_CLIENT_NNULL(this) &&
5762+
wsrep_thd_is_local(this) &&
5763+
wsrep_is_active(this) &&
57625764
variables.wsrep_trx_fragment_size > 0)
57635765
{
57645766
if (!is_current_stmt_binlog_format_row())

0 commit comments

Comments
 (0)