From 52e8c08a61067196287892f736673af2c0d68cf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Thu, 17 May 2018 09:34:01 +0300 Subject: [PATCH 1/6] Disable warnings when dropping databases Dropping a database with DROP DATABASE ... IF NOT EXISTS will cause warnings to be logged if it doesn't exist. The masking_user test was missing the part that disables these warnings. --- maxscale-system-test/masking/masking_user/t/masking_user.test | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/maxscale-system-test/masking/masking_user/t/masking_user.test b/maxscale-system-test/masking/masking_user/t/masking_user.test index 7b5a74594..c03c8b1ba 100644 --- a/maxscale-system-test/masking/masking_user/t/masking_user.test +++ b/maxscale-system-test/masking/masking_user/t/masking_user.test @@ -2,8 +2,9 @@ # Masking User # # See ../masking_rules.json - +--disable_warnings drop database if exists maskingdb; +--enable_warnings create database maskingdb; use maskingdb; From 22d6687f9fdf48c8812b1b8c7d84e946da6456e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Thu, 17 May 2018 09:39:19 +0300 Subject: [PATCH 2/6] Fix paths in mxs1110_16mb The paths that the test used assumed that the binary was built in-source. This is a relic of the test refactoring and seems to have gone unnoticed. --- maxscale-system-test/mxs1110_16mb.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/maxscale-system-test/mxs1110_16mb.cpp b/maxscale-system-test/mxs1110_16mb.cpp index 2b6f208c9..a487029ba 100644 --- a/maxscale-system-test/mxs1110_16mb.cpp +++ b/maxscale-system-test/mxs1110_16mb.cpp @@ -17,17 +17,21 @@ int main(int argc, char *argv[]) Test->set_timeout(60); int chunk_size = 2500000; int chunk_num = 5; + std::string src_dir = test_dir; + std::string masking_rules = src_dir + "/masking/masking_user/masking_rules.json"; + std::string cache_rules = src_dir + "/cache/cache_basic/cache_rules.json"; + std::string fw_rules = src_dir + "/fw"; - Test->maxscales->copy_to_node_legacy("./masking/masking_user/masking_rules.json", "~/", 0); + Test->maxscales->copy_to_node_legacy(masking_rules.c_str(), "~/", 0); - Test->maxscales->copy_to_node_legacy("./cache/cache_basic/cache_rules.json", "~/", 0); + Test->maxscales->copy_to_node_legacy(cache_rules.c_str(), "~/", 0); Test->maxscales->ssh_node_f(0, true, "cd %s;" "rm -rf rules;" "mkdir rules;" "chown vagrant:vagrant rules", Test->maxscales->access_homedir[0]); - copy_rules(Test, (char *) "rules2", "./fw/"); + copy_rules(Test, "rules2", fw_rules.c_str()); Test->maxscales->start_maxscale(0); From 4309d9b3a57a991c211b5b1da8452d2c810782ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Thu, 17 May 2018 09:50:37 +0300 Subject: [PATCH 3/6] Change mxs1836_show_eventTimes port from 9003 to 4006 Port 9003 is not open by default in the test environment. Changing it to port 4006, which is open, will work around this restriction. Also added the mysql_error output to the error message when the querying fails. --- .../cnf/maxscale.cnf.template.mxs1836_show_eventTimes | 2 +- maxscale-system-test/mxs1836_show_eventTimes.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/maxscale-system-test/cnf/maxscale.cnf.template.mxs1836_show_eventTimes b/maxscale-system-test/cnf/maxscale.cnf.template.mxs1836_show_eventTimes index a5d4fbb03..2f3e54183 100644 --- a/maxscale-system-test/cnf/maxscale.cnf.template.mxs1836_show_eventTimes +++ b/maxscale-system-test/cnf/maxscale.cnf.template.mxs1836_show_eventTimes @@ -21,4 +21,4 @@ passwd=maxinfo_passwd type=listener service=MaxInfo protocol=MySQLClient -port=9003 +port=4006 diff --git a/maxscale-system-test/mxs1836_show_eventTimes.cpp b/maxscale-system-test/mxs1836_show_eventTimes.cpp index 70759cb03..f719bae99 100644 --- a/maxscale-system-test/mxs1836_show_eventTimes.cpp +++ b/maxscale-system-test/mxs1836_show_eventTimes.cpp @@ -22,7 +22,7 @@ namespace // Specified in the configuration file. char USER[] = "maxinfo_user"; char PASSWD[] = "maxinfo_passwd"; -int PORT = 9003; +int PORT = 4006; void run(TestConnections& test, MYSQL* pMysql) { @@ -58,7 +58,7 @@ void run(TestConnections& test, MYSQL* pMysql) } else { - test.assert(false, "Executing 'show eventTimes' failed."); + test.assert(false, "Executing 'show eventTimes' failed: %s", mysql_error(pMysql)); } } From bf933ecc22ed3801f8f80e313a9b4270f776ffef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Thu, 17 May 2018 10:04:00 +0300 Subject: [PATCH 4/6] Open all ports by default The test now flushes the INPUT chain of iptables at the start of the test. This should open all ports even if the OS by default defines some rules that block ports. --- maxscale-system-test/cdc_client.cpp | 5 ++--- maxscale-system-test/testconnections.cpp | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/maxscale-system-test/cdc_client.cpp b/maxscale-system-test/cdc_client.cpp index 264210f35..07cfd80e4 100644 --- a/maxscale-system-test/cdc_client.cpp +++ b/maxscale-system-test/cdc_client.cpp @@ -185,9 +185,8 @@ int main(int argc, char *argv[]) Test->set_timeout(600); Test->maxscales->stop_maxscale(0); - // Remove old data files and make sure that port 4001 is open - Test->maxscales->ssh_node_f(0, true, "rm -rf /var/lib/maxscale/avro;" - "iptables -n -L INPUT|grep 4001 || iptables -I INPUT -p tcp --dport 4001 -j ACCEPT;"); + // Remove old data files + Test->maxscales->ssh_node_f(0, true, "rm -rf /var/lib/maxscale/avro;"); Test->repl->connect(); execute_query(Test->repl->nodes[0], "DROP TABLE IF EXISTS t1;"); diff --git a/maxscale-system-test/testconnections.cpp b/maxscale-system-test/testconnections.cpp index be1c7e794..a2d6f908b 100644 --- a/maxscale-system-test/testconnections.cpp +++ b/maxscale-system-test/testconnections.cpp @@ -641,7 +641,7 @@ void TestConnections::init_maxscale(int m) "chmod 664 %s/certs/*.pem;" "chmod a+x %s;" "%s" - "iptables -I INPUT -p tcp --dport 4001 -j ACCEPT;" + "iptables -F INPUT;" "rm -f %s/maxscale.log;" "rm -f %s/maxscale1.log;" "rm -rf /tmp/core* /dev/shm/* /var/lib/maxscale/maxscale.cnf.d/ /var/lib/maxscale/*;" From 135cd2e16a10b698544aaccb327644aa5d02a558 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Thu, 17 May 2018 10:46:57 +0300 Subject: [PATCH 5/6] Update readwritesplit limitations The use of multiple cursors was fixed in 2.2.5 and the multi-statement LOAD DATA LOCAL INFILE is fixed in 2.3.0. --- Documentation/About/Limitations.md | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/Documentation/About/Limitations.md b/Documentation/About/Limitations.md index c245c3be9..478664fb0 100644 --- a/Documentation/About/Limitations.md +++ b/Documentation/About/Limitations.md @@ -179,15 +179,6 @@ Readwritesplit does not support pipelining of JDBC batched statements. This is caused by the fact that readwritesplit executes the statements one at a time to track the state of the response. -#### Prepared Statement Limitations - -Readwritesplit does not support the parallel execution of binary protocol -prepared statements that use cursors. In practice this means that only one -open cursor is allowed when readwritesplit is used. - -Opening more than one cursor will cause the execution of the prepared -statements to stall. - #### Limitations in multi-statement handling When a multi-statement query is executed through the readwritesplit router, it @@ -195,6 +186,10 @@ will always be routed to the master. See [`strict_multi_stmt`](../Routers/ReadWriteSplit.md#strict_multi_stmt) for more details. +Execution of LOAD DATA LOCAL INFILE statements inside a multi-statement query is +not supported. If one is executed MaxScale will most likely hang (see +[MXS-1828](https://jira.mariadb.org/browse/MXS-1828)). + #### Limitations in client session handling Some of the queries that a client sends are routed to all backends instead of From 2a7f470b6bf9bd6588424646894d33f5734e79fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Thu, 17 May 2018 10:57:05 +0300 Subject: [PATCH 6/6] Make test failure messages unique in mxs1824_double_cursor Having the same error for two different failures makes it harder to figure out which one of them fails. --- maxscale-system-test/mxs1824_double_cursor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/maxscale-system-test/mxs1824_double_cursor.cpp b/maxscale-system-test/mxs1824_double_cursor.cpp index 01d5e9020..08daaaa51 100644 --- a/maxscale-system-test/mxs1824_double_cursor.cpp +++ b/maxscale-system-test/mxs1824_double_cursor.cpp @@ -18,7 +18,7 @@ void double_cursor(TestConnections& test, MYSQL* conn) MYSQL_STMT* stmt1 = mysql_stmt_init(conn); const char* query = "SELECT id FROM test.t1"; int rc = mysql_stmt_prepare(stmt1, query, strlen(query)); - test.assert(rc == 0, "Prepare should work: %s %s", mysql_stmt_error(stmt1), mysql_error(conn)); + test.assert(rc == 0, "First prepare should work: %s %s", mysql_stmt_error(stmt1), mysql_error(conn)); int type = CURSOR_TYPE_READ_ONLY; mysql_stmt_attr_set(stmt1, STMT_ATTR_CURSOR_TYPE, &type); @@ -35,7 +35,7 @@ void double_cursor(TestConnections& test, MYSQL* conn) MYSQL_STMT* stmt2 = mysql_stmt_init(conn); rc = mysql_stmt_prepare(stmt2, query, strlen(query)); - test.assert(rc == 0, "Prepare should work: %s %s", mysql_stmt_error(stmt2), mysql_error(conn)); + test.assert(rc == 0, "Second prepare should work: %s %s", mysql_stmt_error(stmt2), mysql_error(conn)); mysql_stmt_attr_set(stmt2, STMT_ATTR_CURSOR_TYPE, &type); mysql_stmt_bind_result(stmt2, bind);