From 9f11fdd2c122c9b30548c7ab55df8dda643ec659 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Mon, 4 Dec 2017 16:07:50 +0200 Subject: [PATCH] Fix test failures Use larger BLOB type for mxs812_1, the inserted value exceeds the normal BLOB size. Add a baseline check into bulk_insert to verify that direct connections work (at the moment they don't, needs an investigation). Updated parameter names in failover_mysqlmon_mrm. Modified avro_alter to prevent data type conversion errors. --- maxscale-system-test/avro_alter.cpp | 10 +++++++++- maxscale-system-test/bulk_insert.cpp | 5 +++++ .../cnf/maxscale.cnf.template.failover_mysqlmon_mrm | 2 +- maxscale-system-test/mxs812_1.cpp | 2 +- 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/maxscale-system-test/avro_alter.cpp b/maxscale-system-test/avro_alter.cpp index 2ee641875..80f9afd1a 100644 --- a/maxscale-system-test/avro_alter.cpp +++ b/maxscale-system-test/avro_alter.cpp @@ -23,17 +23,23 @@ int main(int argc, char *argv[]) test.set_timeout(120); test.repl->connect(); + // Execute two events for each version of the schema execute_query_silent(test.repl->nodes[0], "DROP TABLE test.t1"); execute_query(test.repl->nodes[0], "CREATE TABLE test.t1(id INT)"); execute_query(test.repl->nodes[0], "INSERT INTO test.t1 VALUES (1)"); + execute_query(test.repl->nodes[0], "DELETE FROM test.t1"); execute_query(test.repl->nodes[0], "ALTER TABLE test.t1 ADD COLUMN a VARCHAR(100)"); execute_query(test.repl->nodes[0], "INSERT INTO test.t1 VALUES (2, \"a\")"); + execute_query(test.repl->nodes[0], "DELETE FROM test.t1"); execute_query(test.repl->nodes[0], "ALTER TABLE test.t1 ADD COLUMN b FLOAT"); execute_query(test.repl->nodes[0], "INSERT INTO test.t1 VALUES (3, \"b\", 3.0)"); + execute_query(test.repl->nodes[0], "DELETE FROM test.t1"); execute_query(test.repl->nodes[0], "ALTER TABLE test.t1 CHANGE COLUMN b c DATETIME(3)"); execute_query(test.repl->nodes[0], "INSERT INTO test.t1 VALUES (4, \"c\", NOW())"); + execute_query(test.repl->nodes[0], "DELETE FROM test.t1"); execute_query(test.repl->nodes[0], "ALTER TABLE test.t1 DROP COLUMN c"); execute_query(test.repl->nodes[0], "INSERT INTO test.t1 VALUES (5, \"d\")"); + execute_query(test.repl->nodes[0], "DELETE FROM test.t1"); test.repl->close_connections(); @@ -61,7 +67,9 @@ int main(int argc, char *argv[]) nrows++; } - test.add_result(nrows != 1, "Expected 1 line in file number %d, got %d: %s", i, nrows, rows); + // The number of changes that are present in each version of the schema + const int nchanges = 2; + test.add_result(nrows != nchanges, "Expected %d line in file number %d, got %d: %s", nchanges, i, nrows, rows); free(rows); } diff --git a/maxscale-system-test/bulk_insert.cpp b/maxscale-system-test/bulk_insert.cpp index 9e3595e54..d5202551f 100644 --- a/maxscale-system-test/bulk_insert.cpp +++ b/maxscale-system-test/bulk_insert.cpp @@ -203,12 +203,17 @@ int main(int argc, char** argv) TestConnections::require_repl_version("10.2"); TestConnections test(argc, argv); test.connect_maxscale(); + test.repl->connect(); + test.tprintf("Testing column-wise binding with a direct connection"); + test.add_result(bind_by_column(test.repl->nodes[0]), "Bulk inserts with a direct connection should work"); test.tprintf("Testing column-wise binding with readwritesplit"); test.add_result(bind_by_column(test.conn_rwsplit), "Bulk inserts with readwritesplit should work"); test.tprintf("Testing column-wise binding with readconnroute"); test.add_result(bind_by_column(test.conn_master), "Bulk inserts with readconnroute should work"); + test.tprintf("Testing row-wise binding with a direct connection"); + test.add_result(bind_by_row(test.repl->nodes[0]), "Bulk inserts with a direct connection should work"); test.tprintf("Testing row-wise binding with readwritesplit"); test.add_result(bind_by_row(test.conn_rwsplit), "Bulk inserts with readwritesplit should work"); test.tprintf("Testing row-wise binding with readconnroute"); diff --git a/maxscale-system-test/cnf/maxscale.cnf.template.failover_mysqlmon_mrm b/maxscale-system-test/cnf/maxscale.cnf.template.failover_mysqlmon_mrm index 1c38ff294..f6d1f5f92 100644 --- a/maxscale-system-test/cnf/maxscale.cnf.template.failover_mysqlmon_mrm +++ b/maxscale-system-test/cnf/maxscale.cnf.template.failover_mysqlmon_mrm @@ -11,7 +11,7 @@ monitor_interval=1000 detect_standalone_master=true failcount=1 allow_cluster_recovery=true -failover=true +auto_failover=true replication_user=repl replication_password=repl backend_connect_timeout=1 diff --git a/maxscale-system-test/mxs812_1.cpp b/maxscale-system-test/mxs812_1.cpp index 5f7ad1015..d1d564f6d 100644 --- a/maxscale-system-test/mxs812_1.cpp +++ b/maxscale-system-test/mxs812_1.cpp @@ -67,7 +67,7 @@ int main(int argc, char *argv[]) /** Create test table */ Test->repl->connect(); Test->try_query(Test->repl->nodes[0], (char*)"DROP TABLE IF EXISTS long_blob_table"); - Test->try_query(Test->repl->nodes[0], (char*)"CREATE TABLE long_blob_table(x INT, b BLOB)"); + Test->try_query(Test->repl->nodes[0], (char*)"CREATE TABLE long_blob_table(x INT, b LONGBLOB)"); Test->connect_maxscale(); Test->tprintf("Starting test");