1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-24 11:21:21 +03:00

Fix for bug #9992: mysql_next_result hangs on error

set net->no_send_error to 0 before execution of each element of
    multiquery statement to provide the sending of error to client


tests/mysql_client_test.c:
  Fix for bug #9992: mysql_next_result hangs on error
      test case
This commit is contained in:
unknown
2005-05-27 18:01:09 +05:00
parent a985031a29
commit 8264f9bd5e
2 changed files with 24 additions and 3 deletions

View File

@@ -233,7 +233,7 @@ mysql_simple_prepare(MYSQL *mysql, const char *query)
/* Connect to the server */
static void client_connect()
static void client_connect(ulong flag)
{
int rc;
myheader_r("client_connect");
@@ -251,7 +251,7 @@ static void client_connect()
if (!(mysql_real_connect(mysql, opt_host, opt_user,
opt_password, opt_db ? opt_db:"test", opt_port,
opt_unix_socket, 0)))
opt_unix_socket, flag)))
{
opt_silent= 0;
myerror("connection failed");
@@ -13478,6 +13478,22 @@ static void print_test_output()
}
static void check_mupltiquery_bug9992()
{
MYSQL_RES* res ;
mysql_query(mysql,"SHOW TABLES;SHOW DATABASE;SELECT 1;");
fprintf(stdout, "\n\n!!! check_mupltiquery_bug9992 !!!\n");
do
{
if (!(res= mysql_store_result(mysql)))
return;
mysql_free_result(res);
} while (!mysql_next_result(mysql));
fprintf(stdout, "\n\n!!! SUCCESS !!!\n");
return;
}
/***************************************************************************
main routine
***************************************************************************/
@@ -13499,7 +13515,7 @@ int main(int argc, char **argv)
(char**) embedded_server_groups))
DIE("Can't initialize MySQL server");
client_connect(); /* connect to server */
client_connect(0); /* connect to server */
total_time= 0;
for (iter_count= 1; iter_count <= opt_count; iter_count++)
@@ -13543,6 +13559,10 @@ int main(int argc, char **argv)
}
client_disconnect(); /* disconnect from server */
client_connect(CLIENT_MULTI_STATEMENTS);
check_mupltiquery_bug9992();
client_disconnect();
free_defaults(defaults_argv);
print_test_output();