Skip to content

Commit 05f61ba

Browse files
committed
MDEV-10559: main.mysql_client_test_nonblock crashes in buildbot on 10.0
fix for async operations
1 parent df09d5e commit 05f61ba

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

sql-common/client.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3644,7 +3644,8 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
36443644
/* Free alloced memory */
36453645
end_server(mysql);
36463646
mysql_close_free(mysql);
3647-
if (!(client_flag & CLIENT_REMEMBER_OPTIONS))
3647+
if (!(client_flag & CLIENT_REMEMBER_OPTIONS) &&
3648+
!mysql->options.extension->async_context)
36483649
mysql_close_free_options(mysql);
36493650
}
36503651
DBUG_RETURN(0);

sql-common/mysql_async.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,11 @@ MK_ASYNC_START_BODY(
455455
parms.db= db;
456456
parms.port= port;
457457
parms.unix_socket= unix_socket;
458-
parms.client_flags= client_flags;
458+
/*
459+
async wrapper enforce the CLIENT_REMEMBER_OPTIONS flag to be
460+
functional (otherwise it can't operate)
461+
*/
462+
parms.client_flags= client_flags | CLIENT_REMEMBER_OPTIONS;
459463
},
460464
NULL,
461465
r_ptr,

tests/mysql_client_test.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18443,7 +18443,7 @@ static void test_bug58036()
1844318443

1844418444
if (mysql_real_connect(conn, opt_host, opt_user,
1844518445
opt_password, opt_db ? opt_db : "test",
18446-
opt_port, opt_unix_socket, CLIENT_REMEMBER_OPTIONS))
18446+
opt_port, opt_unix_socket, 0))
1844718447
{
1844818448
if (!opt_silent)
1844918449
printf("mysql_real_connect() succeeded (failure expected)\n");
@@ -18469,7 +18469,7 @@ static void test_bug58036()
1846918469
mysql_options(conn, MYSQL_SET_CHARSET_NAME, "latin1");
1847018470
if (!mysql_real_connect(conn, opt_host, opt_user,
1847118471
opt_password, opt_db ? opt_db : "test",
18472-
opt_port, opt_unix_socket, CLIENT_REMEMBER_OPTIONS))
18472+
opt_port, opt_unix_socket, 0))
1847318473
{
1847418474
if (!opt_silent)
1847518475
printf("mysql_real_connect() failed: %s (%d)\n",
@@ -19344,7 +19344,7 @@ static void test_big_packet()
1934419344

1934519345
if (!(mysql_real_connect(mysql_local, opt_host, opt_user,
1934619346
opt_password, current_db, opt_port,
19347-
opt_unix_socket, CLIENT_REMEMBER_OPTIONS)))
19347+
opt_unix_socket, 0)))
1934819348
{
1934919349
mysql_close(mysql_local);
1935019350
fprintf(stderr, "\n connection failed(%s)", mysql_error(mysql_local));

0 commit comments

Comments
 (0)