1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-07 00:04:31 +03:00

Bug #26921 Problem in mysql_insert_id() Embedded C API function.

client library only sets mysql->insert_id when query returned
no recordset. So the embedded library should behave the same way


libmysqld/lib_sql.cc:
  Bug #26921 Problem in mysql_insert_id() Embedded C API function.
  
  only set 'affected_rows' and 'insert_id' fields when query
  didn't return a recordset
tests/mysql_client_test.c:
  Bug #26921 Problem in mysql_insert_id() Embedded C API function.
  
  testcase added
This commit is contained in:
unknown
2007-11-30 19:16:13 +04:00
parent 63b6516953
commit 05fbb233d8
4 changed files with 16 additions and 76 deletions

View File

@@ -251,9 +251,11 @@ static my_bool emb_read_query_result(MYSQL *mysql)
mysql->warning_count= res->embedded_info->warning_count;
mysql->server_status= res->embedded_info->server_status;
mysql->field_count= res->fields;
mysql->fields= res->embedded_info->fields_list;
mysql->affected_rows= res->embedded_info->affected_rows;
mysql->insert_id= res->embedded_info->insert_id;
if (!(mysql->fields= res->embedded_info->fields_list))
{
mysql->affected_rows= res->embedded_info->affected_rows;
mysql->insert_id= res->embedded_info->insert_id;
}
mysql->net.last_errno= 0;
mysql->net.last_error[0]= 0;
mysql->info= 0;