1
0
mirror of https://github.com/mariadb-corporation/mariadb-connector-c.git synced 2025-08-07 02:42:49 +03:00

Follow up for CONC-622 test:

Host 0.0.0.0 is mapped to locahost, so we need another invalid
host address (1.0.0.0) instead and reduce the number of loops.
This commit is contained in:
Georg Richter
2023-01-15 17:41:29 +01:00
parent 5f6133653d
commit 003b5cd168

View File

@@ -255,11 +255,12 @@ static int test_conc622(MYSQL *my __attribute__((unused)))
int status; int status;
uint default_timeout; uint default_timeout;
int i; int i;
const char *invalid_host= "1.0.0.0";
if (skip_async) if (skip_async)
return SKIP; return SKIP;
for (i=0; i < 100; i++) for (i=0; i < 5; i++)
{ {
mysql_init(&mysql); mysql_init(&mysql);
rc= mysql_options(&mysql, MYSQL_OPT_NONBLOCK, 0); rc= mysql_options(&mysql, MYSQL_OPT_NONBLOCK, 0);
@@ -273,7 +274,7 @@ static int test_conc622(MYSQL *my __attribute__((unused)))
mysql_options(&mysql, MYSQL_READ_DEFAULT_GROUP, "myapp"); mysql_options(&mysql, MYSQL_READ_DEFAULT_GROUP, "myapp");
/* Returns 0 when done, else flag for what to wait for when need to block. */ /* Returns 0 when done, else flag for what to wait for when need to block. */
status= mysql_real_connect_start(&ret, &mysql, "0.0.0.0", username, password, schema, port, socketname, 0); status= mysql_real_connect_start(&ret, &mysql, invalid_host, username, password, schema, port, socketname, 0);
while (status) while (status)
{ {
status= wait_for_mysql(&mysql, status); status= wait_for_mysql(&mysql, status);
@@ -288,7 +289,8 @@ static int test_conc622(MYSQL *my __attribute__((unused)))
status= mysql_close_cont(&mysql, status); status= mysql_close_cont(&mysql, status);
} }
} else { } else {
diag("Expected error when connection to host '0.0.0.0'"); diag("Expected error when connecting to host '%s'", invalid_host);
diag("Connected to %s", mysql_get_server_info(&mysql));
return FAIL; return FAIL;
} }
} }