diff --git a/system-test/CMakeLists.txt b/system-test/CMakeLists.txt index 21291625f..2dfb6f75c 100644 --- a/system-test/CMakeLists.txt +++ b/system-test/CMakeLists.txt @@ -49,6 +49,7 @@ add_subdirectory(cdc_datatypes) # MXS-682 # MXS-957 # MXS-1786 +# MXS-3915 add_test_executable(sanity_check.cpp sanity_check replication LABELS readwritesplit LIGHT REPL_BACKEND) # Repeatedly connect to maxscale while the backends reject all connections, expect no crash diff --git a/system-test/sanity_check.cpp b/system-test/sanity_check.cpp index 3aea50d24..b97869120 100644 --- a/system-test/sanity_check.cpp +++ b/system-test/sanity_check.cpp @@ -99,6 +99,20 @@ void test_rwsplit(TestConnections& test) test.maxscales->disconnect(); } +void test_mxs3915(TestConnections& test) +{ + auto c = test.maxscale->rwsplit(); + test.expect(c.connect(), "Failed to connect: %s", c.error()); + c.query("SET autocommit=0"); + c.query("COMMIT"); + c.query("SET autocommit=1"); + auto id = c.field("SELECT @@server_id"); + + test.repl->connect(); + auto master_id = test.repl->get_server_id_str(0); + test.expect(id != master_id, "SELECT was routed to master after re-enabling autocommit"); +} + int main(int argc, char** argv) { TestConnections test(argc, argv); @@ -127,5 +141,8 @@ int main(int argc, char** argv) // Readwritesplit sanity checks test_rwsplit(test); + // MXS-3915: Autocommit tracking is broken + test_mxs3915(test); + return test.global_result; }