From abc1cf89f145d6044e7811690399793c25ba6107 Mon Sep 17 00:00:00 2001 From: Georg Richter Date: Tue, 1 Mar 2022 10:23:34 +0100 Subject: [PATCH] Test fix: For detecting if we test against MaxScale check also if mysql_get_server_info contains "maxScale". --- unittest/libmariadb/my_test.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/unittest/libmariadb/my_test.h b/unittest/libmariadb/my_test.h index ca9fed77..58765a9b 100644 --- a/unittest/libmariadb/my_test.h +++ b/unittest/libmariadb/my_test.h @@ -73,7 +73,12 @@ if (IS_SKYSQL(hostname)) \ #define SKIP_NOTLS #endif -#define IS_MAXSCALE() (getenv("srv")!=NULL && (strcmp(getenv("srv"), "maxscale") == 0 || strcmp(getenv("srv"), "skysql-ha") == 0)) +MYSQL *mysql_default = NULL; /* default connection */ + +#define IS_MAXSCALE()\ + ((mysql_default && strstr(mysql_get_server_info(mysql_default), "maxScale")) ||\ + (getenv("srv")!=NULL && (strcmp(getenv("srv"), "maxscale") == 0 ||\ + strcmp(getenv("srv"), "skysql-ha") == 0))) #define SKIP_MAXSCALE \ if (IS_MAXSCALE()) \ { \ @@ -644,7 +649,7 @@ MYSQL *my_test_connect(MYSQL *mysql, void run_tests(struct my_tests_st *test) { int i, rc, total=0; - MYSQL *mysql, *mysql_default= NULL; /* default connection */ + MYSQL *mysql; while (test[total].function) total++;