1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

Fix for #2208 (multi-query returns wrong result in embedded library)

now we execute only one first select during mysql_real_query
others - during 'mysql_next_result'


include/mysql.h:
  'virtual' next_result added
libmysql/client_settings.h:
  cli_next_result declaration added
libmysql/libmysql.c:
  mysql_next_result now works in embedded library as well
libmysqld/lib_sql.cc:
  emb_next_result implemented
sql/sql_class.h:
  fields to store the rest of the query added
sql/sql_parse.cc:
  Saving the rest of the query added for embedded case
This commit is contained in:
unknown
2004-02-10 17:09:59 +04:00
parent e5ab70702c
commit b4fc7c7fbf
6 changed files with 50 additions and 12 deletions

View File

@ -3511,6 +3511,21 @@ my_bool STDCALL mysql_more_results(MYSQL *mysql)
Reads and returns the next query results
*/
int cli_next_result(MYSQL *mysql)
{
DBUG_ENTER("cli_next_result");
mysql->net.last_error[0]= 0;
mysql->net.last_errno= 0;
strmov(mysql->net.sqlstate, not_error_sqlstate);
mysql->affected_rows= ~(my_ulonglong) 0;
if (mysql->last_used_con->server_status & SERVER_MORE_RESULTS_EXISTS)
DBUG_RETURN((*mysql->methods->read_query_result)(mysql));
DBUG_RETURN(-1); /* No more results */
}
int STDCALL mysql_next_result(MYSQL *mysql)
{
DBUG_ENTER("mysql_next_result");
@ -3523,15 +3538,7 @@ int STDCALL mysql_next_result(MYSQL *mysql)
DBUG_RETURN(1);
}
mysql->net.last_error[0]= 0;
mysql->net.last_errno= 0;
strmov(mysql->net.sqlstate, not_error_sqlstate);
mysql->affected_rows= ~(my_ulonglong) 0;
if (mysql->last_used_con->server_status & SERVER_MORE_RESULTS_EXISTS)
DBUG_RETURN((*mysql->methods->read_query_result)(mysql));
DBUG_RETURN(-1); /* No more results */
DBUG_RETURN((*mysql->methods->next_result)(mysql));
}