summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorholyfoot/hf@hfmain.(none) <>2007-12-07 10:10:02 +0400
committerholyfoot/hf@hfmain.(none) <>2007-12-07 10:10:02 +0400
commit901dc028f924a42f39c227802fea1fa732db8627 (patch)
tree9289f46a5ebd5f614a4e6156e05f12b89f4c2ef6 /tests
parentd349effe1111a1afa4eb868ca2feed1ad6af3622 (diff)
parentd26de7bee08c75618ebe12c85c1cffb1cd10c935 (diff)
downloadmariadb-git-901dc028f924a42f39c227802fea1fa732db8627.tar.gz
Merge bk@192.168.21.1:mysql-5.1-opt
into mysql.com:/home/hf/work/26921/my51-26921
Diffstat (limited to 'tests')
-rw-r--r--tests/mysql_client_test.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c
index 409d67faf90..2f33e351620 100644
--- a/tests/mysql_client_test.c
+++ b/tests/mysql_client_test.c
@@ -15883,6 +15883,8 @@ static void test_status()
Test that client gets updated value of insert_id on UPDATE that uses
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()
{
@@ -15895,6 +15897,8 @@ static void test_bug21726()
const char *update_query= "UPDATE t1 SET i= LAST_INSERT_ID(i + 1)";
int rc;
my_ulonglong insert_id;
+ const char *select_query= "SELECT * FROM t1";
+ MYSQL_RES *result;
DBUG_ENTER("test_bug21726");
myheader("test_bug21726");
@@ -15911,6 +15915,13 @@ static void test_bug21726()
insert_id= mysql_insert_id(mysql);
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;
}