mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Merge mysql.com:/home/hf/work/26921/my50-26921
into mysql.com:/home/hf/work/26921/my51-26921
This commit is contained in:
@ -242,9 +242,11 @@ static my_bool emb_read_query_result(MYSQL *mysql)
|
|||||||
mysql->warning_count= res->embedded_info->warning_count;
|
mysql->warning_count= res->embedded_info->warning_count;
|
||||||
mysql->server_status= res->embedded_info->server_status;
|
mysql->server_status= res->embedded_info->server_status;
|
||||||
mysql->field_count= res->fields;
|
mysql->field_count= res->fields;
|
||||||
mysql->fields= res->embedded_info->fields_list;
|
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->affected_rows= res->embedded_info->affected_rows;
|
||||||
|
mysql->insert_id= res->embedded_info->insert_id;
|
||||||
|
}
|
||||||
net_clear_error(&mysql->net);
|
net_clear_error(&mysql->net);
|
||||||
mysql->info= 0;
|
mysql->info= 0;
|
||||||
|
|
||||||
|
@ -15869,6 +15869,8 @@ static void test_status()
|
|||||||
|
|
||||||
Test that client gets updated value of insert_id on UPDATE that uses
|
Test that client gets updated value of insert_id on UPDATE that uses
|
||||||
LAST_INSERT_ID(expr).
|
LAST_INSERT_ID(expr).
|
||||||
|
select_query added to test for bug
|
||||||
|
#26921 Problem in mysql_insert_id() Embedded C API function
|
||||||
*/
|
*/
|
||||||
static void test_bug21726()
|
static void test_bug21726()
|
||||||
{
|
{
|
||||||
@ -15881,6 +15883,8 @@ static void test_bug21726()
|
|||||||
const char *update_query= "UPDATE t1 SET i= LAST_INSERT_ID(i + 1)";
|
const char *update_query= "UPDATE t1 SET i= LAST_INSERT_ID(i + 1)";
|
||||||
int rc;
|
int rc;
|
||||||
my_ulonglong insert_id;
|
my_ulonglong insert_id;
|
||||||
|
const char *select_query= "SELECT * FROM t1";
|
||||||
|
MYSQL_RES *result;
|
||||||
|
|
||||||
DBUG_ENTER("test_bug21726");
|
DBUG_ENTER("test_bug21726");
|
||||||
myheader("test_bug21726");
|
myheader("test_bug21726");
|
||||||
@ -15897,6 +15901,13 @@ static void test_bug21726()
|
|||||||
insert_id= mysql_insert_id(mysql);
|
insert_id= mysql_insert_id(mysql);
|
||||||
DIE_UNLESS(insert_id == 3);
|
DIE_UNLESS(insert_id == 3);
|
||||||
|
|
||||||
|
rc= mysql_query(mysql, select_query);
|
||||||
|
myquery(rc);
|
||||||
|
insert_id= mysql_insert_id(mysql);
|
||||||
|
DIE_UNLESS(insert_id == 3);
|
||||||
|
result= mysql_store_result(mysql);
|
||||||
|
mysql_free_result(result);
|
||||||
|
|
||||||
DBUG_VOID_RETURN;
|
DBUG_VOID_RETURN;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user