Skip to content

Commit

Permalink
Test fix:
Browse files Browse the repository at this point in the history
For detecting if we test against MaxScale check also if
mysql_get_server_info contains "maxScale".
  • Loading branch information
9EOR9 committed Mar 1, 2022
1 parent 82de6ee commit abc1cf8
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions unittest/libmariadb/my_test.h
Original file line number Diff line number Diff line change
Expand Up @@ -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()) \
{ \
Expand Down Expand Up @@ -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++;
Expand Down

0 comments on commit abc1cf8

Please sign in to comment.