From e641de2930f9271c2d05f92bfe51d9baef3f63ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Thu, 8 Feb 2018 15:46:59 +0200 Subject: [PATCH] Fix cdc_datatypes The test did not correctly handle quoted or NULL value comparisons. --- maxscale-system-test/cdc_datatypes/cdc_datatypes.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/maxscale-system-test/cdc_datatypes/cdc_datatypes.cpp b/maxscale-system-test/cdc_datatypes/cdc_datatypes.cpp index 9ce63da30..d73ac7d04 100644 --- a/maxscale-system-test/cdc_datatypes/cdc_datatypes.cpp +++ b/maxscale-system-test/cdc_datatypes/cdc_datatypes.cpp @@ -198,7 +198,7 @@ std::string type_to_table_name(const char* type) static std::string unquote(std::string str) { - if (str[0] == '\"') + if (str[0] == '\"' ||str[0] == '\'') { str = str.substr(1, str.length() - 2); } @@ -246,7 +246,11 @@ bool run_test(TestConnections& test) std::string input = unquote(test_set[x].values[j]); std::string output = row->value(field_name); - if (input != output && (input != "NULL" || output != "")) + if (input == output || (input == "NULL" && (output == "" || output == "0"))) + { + // Expected result + } + else { test.tprintf("Result mismatch: %s(%s) => %s", test_set[x].types[i], input.c_str(), output.c_str());