summaryrefslogtreecommitdiff
path: root/libmysqld
diff options
context:
space:
mode:
authorunknown <holyfoot/hf@mysql.com/hfmain.(none)>2007-11-30 19:16:13 +0400
committerunknown <holyfoot/hf@mysql.com/hfmain.(none)>2007-11-30 19:16:13 +0400
commit05fbb233d8e500da274dbd4bcffc134b23cfca13 (patch)
tree28d3e38d1d3b73e9352396555b28bd936c164013 /libmysqld
parent63b65169534c97f0c225859d2d6d49f3cee2bc10 (diff)
downloadmariadb-git-05fbb233d8e500da274dbd4bcffc134b23cfca13.tar.gz
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
Diffstat (limited to 'libmysqld')
-rw-r--r--libmysqld/lib_sql.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc
index 7ac663480c8..6aee2fd6614 100644
--- a/libmysqld/lib_sql.cc
+++ b/libmysqld/lib_sql.cc
@@ -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;