diff --git a/maxscale-system-test/CMakeLists.txt b/maxscale-system-test/CMakeLists.txt index f8160fed3..49fa2c6e5 100644 --- a/maxscale-system-test/CMakeLists.txt +++ b/maxscale-system-test/CMakeLists.txt @@ -982,6 +982,9 @@ add_test_executable(mxs2609_history_replay.cpp mxs2609_history_replay mxs2609_hi # MXS-2621: Incorrect SQL if lower_case_table_names is used. add_test_executable(mxs2621_lower_case_tables.cpp mxs2621_lower_case_tables mxs2621_lower_case_tables LABELS REPL_BACKEND) +# MXS-2631: Duplicate system tables not ignored +add_test_executable(mxs2631_ignore_system_tables.cpp mxs2631_ignore_system_tables mxs2631_ignore_system_tables LABELS schemarouter BREAKS_REPL REPL_BACKEND) + ############################################ # END: Normal tests # ############################################ diff --git a/maxscale-system-test/cnf/maxscale.cnf.template.mxs2631_ignore_system_tables b/maxscale-system-test/cnf/maxscale.cnf.template.mxs2631_ignore_system_tables new file mode 100644 index 000000000..7d84350a3 --- /dev/null +++ b/maxscale-system-test/cnf/maxscale.cnf.template.mxs2631_ignore_system_tables @@ -0,0 +1,59 @@ +[maxscale] +threads=###threads### +log_warning=1 + +[MySQL-Monitor] +type=monitor +module=mysqlmon +servers=server1,server2,server3,server4 +user=maxskysql +password=skysql + +[Sharding-router] +type=service +router=schemarouter +servers=server1,server2,server3,server4 +user=maxskysql +password=skysql +auth_all_servers=1 +ignore_databases_regex=^(?!(mysql|information_schema|performance_schema)) + +[Sharding-Listener] +type=listener +service=Sharding-router +protocol=MySQLClient +port=4006 + +[CLI] +type=service +router=cli + +[CLI-Listener] +type=listener +service=CLI +protocol=maxscaled +socket=default + +[server1] +type=server +address=###node_server_IP_1### +port=###node_server_port_1### +protocol=MySQLBackend + +[server2] +type=server +address=###node_server_IP_2### +port=###node_server_port_2### +protocol=MySQLBackend + +[server3] +type=server +address=###node_server_IP_3### +port=###node_server_port_3### +protocol=MySQLBackend + +[server4] +type=server +address=###node_server_IP_4### +port=###node_server_port_4### +protocol=MySQLBackend diff --git a/maxscale-system-test/mxs2631_ignore_system_tables.cpp b/maxscale-system-test/mxs2631_ignore_system_tables.cpp new file mode 100644 index 000000000..3eaf5928e --- /dev/null +++ b/maxscale-system-test/mxs2631_ignore_system_tables.cpp @@ -0,0 +1,25 @@ +/** + * MXS-2631: Dublicate system tables found + * + * https://jira.mariadb.org/browse/MXS-2631 + */ + + +#include +#include "testconnections.h" + +int main(int argc, char* argv[]) +{ + TestConnections test(argc, argv); + test.set_timeout(30); + + MYSQL* conn = test.maxscales->open_rwsplit_connection(0); + + test.add_result(execute_query(conn, "SELECT 1"), "Query should succeed."); + + mysql_close(conn); + test.stop_timeout(); + sleep(1); + test.repl->fix_replication(); + return test.global_result; +}