mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +03:00
Changed mysql_next_result() to return int instead of bool
Changed ~Item_func_in() to call cleanup() (to fix memory leak) Fixed test_multi_statements() test in client_test include/mysql.h: Changed mysql_next_result() to return int instead of bool libmysql/libmysql.c: Changed mysql_next_result() to return int instead of bool Added check to mysql_next_result() to ensure that it's not called in wrong context. sql/item_cmpfunc.cc: Indentation fixes sql/item_cmpfunc.h: Changed ~Item_func_in() to call cleanup() (Fixed memory leak in cmp_item_row()) tests/client_test.c: Fixed test_multi_statements() test.
This commit is contained in:
@ -3317,7 +3317,7 @@ my_ulonglong STDCALL mysql_stmt_num_rows(MYSQL_STMT *stmt)
|
||||
my_bool STDCALL mysql_stmt_free_result(MYSQL_STMT *stmt)
|
||||
{
|
||||
MYSQL *mysql;
|
||||
DBUG_ENTER("mysql_stmt_close");
|
||||
DBUG_ENTER("mysql_stmt_free_result");
|
||||
|
||||
DBUG_ASSERT(stmt != 0);
|
||||
|
||||
@ -3498,10 +3498,18 @@ my_bool STDCALL mysql_more_results(MYSQL *mysql)
|
||||
Reads and returns the next query results
|
||||
*/
|
||||
|
||||
my_bool STDCALL mysql_next_result(MYSQL *mysql)
|
||||
int STDCALL mysql_next_result(MYSQL *mysql)
|
||||
{
|
||||
DBUG_ENTER("mysql_next_result");
|
||||
|
||||
if (mysql->status != MYSQL_STATUS_READY)
|
||||
{
|
||||
strmov(mysql->net.sqlstate, unknown_sqlstate);
|
||||
strmov(mysql->net.last_error,
|
||||
ER(mysql->net.last_errno=CR_COMMANDS_OUT_OF_SYNC));
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
|
||||
mysql->net.last_error[0]= 0;
|
||||
mysql->net.last_errno= 0;
|
||||
strmov(mysql->net.sqlstate, not_error_sqlstate);
|
||||
@ -3510,9 +3518,10 @@ my_bool STDCALL mysql_next_result(MYSQL *mysql)
|
||||
if (mysql->last_used_con->server_status & SERVER_MORE_RESULTS_EXISTS)
|
||||
DBUG_RETURN((*mysql->methods->read_query_result)(mysql));
|
||||
|
||||
DBUG_RETURN(0);
|
||||
DBUG_RETURN(-1); /* No more results */
|
||||
}
|
||||
|
||||
|
||||
MYSQL_RES * STDCALL mysql_use_result(MYSQL *mysql)
|
||||
{
|
||||
return (*mysql->methods->use_result)(mysql);
|
||||
|
Reference in New Issue
Block a user