From c64fd4f39f4d52fcb05518c24e6550b03bbe9fb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Fri, 5 Jan 2018 08:52:36 +0200 Subject: [PATCH] MXS-1543: Add test case Added test case that checks that statement based replication is detected. --- maxscale-system-test/CMakeLists.txt | 4 ++++ maxscale-system-test/mxs1543.cpp | 32 +++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 maxscale-system-test/mxs1543.cpp diff --git a/maxscale-system-test/CMakeLists.txt b/maxscale-system-test/CMakeLists.txt index 31e6c5a21..9177d7daf 100644 --- a/maxscale-system-test/CMakeLists.txt +++ b/maxscale-system-test/CMakeLists.txt @@ -522,6 +522,10 @@ add_test_executable(mxs1516.cpp mxs1516 replication LABELS REPL_BACKEND) # https://jira.mariadb.org/browse/MXS-1542 add_test_executable(mxs1542.cpp mxs1542 avro LABELS REPL_BACKEND) +# MXS-1543: Avrorouter doesn't detect MIXED or STATEMENT format replication +# https://jira.mariadb.org/browse/MXS-1543 +add_test_executable(mxs1543.cpp mxs1543 avro LABELS REPL_BACKEND) + # MXS-1585: Crash in MaxScale 2.1.12 # https://jira.mariadb.org/browse/MXS-1585 add_test_executable(mxs1585.cpp mxs1585 mxs1585 LABELS REPL_BACKEND) diff --git a/maxscale-system-test/mxs1543.cpp b/maxscale-system-test/mxs1543.cpp new file mode 100644 index 000000000..6d185f92d --- /dev/null +++ b/maxscale-system-test/mxs1543.cpp @@ -0,0 +1,32 @@ +/** + * MXS-1543: https://jira.mariadb.org/browse/MXS-1543 + * + * Avrorouter doesn't detect MIXED or STATEMENT format replication + */ + +#include "testconnections.h" + +int main(int argc, char** argv) +{ + TestConnections::skip_maxscale_start(true); + TestConnections::check_nodes(false); + TestConnections test(argc, argv); + + test.replicate_from_master(); + + test.repl->connect(); + execute_query(test.repl->nodes[0], "CREATE OR REPLACE TABLE t1 (data VARCHAR(30))"); + execute_query(test.repl->nodes[0], "INSERT INTO t1 VALUES ('ROW')"); + execute_query(test.repl->nodes[0], "SET binlog_format=STATEMENT"); + execute_query(test.repl->nodes[0], "FLUSH LOGS"); + execute_query(test.repl->nodes[0], "INSERT INTO t1 VALUES ('STATEMENT')"); + execute_query(test.repl->nodes[0], "SET binlog_format=ROW"); + execute_query(test.repl->nodes[0], "FLUSH LOGS"); + execute_query(test.repl->nodes[0], "INSERT INTO t1 VALUES ('ROW2')"); + + // Wait for the avrorouter to process the data + sleep(10); + test.check_log_err("Possible STATEMENT or MIXED", true); + + return test.global_result; +}