diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index ef8f9c3d34a86..0f5df57ae40f9 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -20954,6 +20954,7 @@ static MYSQL *proxy_connect_as(const char *client_ip, const char *user, */ static void test_proxy_header_connect_errors_reset() { +#ifndef DBUG_OFF const char *client_ip= "192.0.2.50"; char query[256]; unsigned int conn_errno= 0; @@ -20962,6 +20963,13 @@ static void test_proxy_header_connect_errors_reset() myheader("test_proxy_header_connect_errors_reset"); + /* Force a deterministic "unresolvable" outcome; see hostname.cc. */ + rc= mysql_query(mysql, "SET @save_debug_dbug= @@global.debug_dbug"); + myquery(rc); + rc= mysql_query(mysql, + "SET GLOBAL debug_dbug='+d,getnameinfo_error_noname'"); + myquery(rc); + rc= mysql_query(mysql, "SET @saved_max_connect_errors= @@global.max_connect_errors"); myquery(rc); @@ -21010,6 +21018,9 @@ static void test_proxy_header_connect_errors_reset() myquery(rc); rc= mysql_query(mysql, "FLUSH HOSTS"); myquery(rc); + rc= mysql_query(mysql, "SET GLOBAL debug_dbug= @save_debug_dbug"); + myquery(rc); +#endif /* !DBUG_OFF */ } /*