Bug #34889 mysql_client_test::test_mysql_insert_id test fails sporadically
Submitted: 27 Feb 2008 14:27 Modified: 10 Apr 2008 12:32
Reporter: Davi Arnaut (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Tests Severity:S7 (Test Cases)
Version:5.0 OS:Any
Assigned to: Alexey Kopytov CPU Architecture:Any

[27 Feb 2008 14:27] Davi Arnaut
Description:
Recent changes to mysql_client_test uncovered that the test case for Bug#9481 fails if there are previous insert to table with a auto_increment column on the same connection.

How to repeat:
Comment out test_bug12744 which closes the connection and run the test case.

===== mysql_client_test.c 1.244 vs edited =====
--- 1.244/tests/mysql_client_test.c	2007-12-01 07:12:28 -02:00
+++ edited/tests/mysql_client_test.c	2008-02-27 11:25:43 -03:00
@@ -16423,7 +16423,7 @@
   { "test_bug15510", test_bug15510 },
   { "test_opt_reconnect", test_opt_reconnect },
 #ifndef EMBEDDED_LIBRARY
-  { "test_bug12744", test_bug12744 },
+  // { "test_bug12744", test_bug12744 },
 #endif
   { "test_bug16143", test_bug16143 },
   { "test_bug15613", test_bug15613 },
[27 Feb 2008 17:56] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/43095

ChangeSet@1.2589, 2008-02-27 13:05:46-03:00, davi@mysql.com +1 -0
  Bug#34889 mysql_client_test::test_mysql_insert_id test fails sporadically
  
  Disable the test case.
[3 Mar 2008 18:14] Bugs System
Pushed into 5.0.58
[3 Mar 2008 18:18] Bugs System
Pushed into 5.1.24-rc
[3 Mar 2008 18:18] Bugs System
Pushed into 6.0.5-alpha
[5 Mar 2008 12:56] Alexey Kopytov
Changing the target to 5.0 only, because 5.1/6.0 are not affected by this bug.
[5 Mar 2008 13:03] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/43455

ChangeSet@1.2608, 2008-03-05 16:02:33+03:00, kaa@kaamos.(none) +2 -0
  Fix for bug #34889: mysql_client_test::test_mysql_insert_id test fails 
                      sporadically
  
  Under some circumstances, the mysql_insert_id() value after SELECT ...
  INSERT could return a wrong value. This could happen when the last
  SELECT ... INSERT did not involve an AUTO_INCREMENT column, but the
  value of mysql_insert_id() was changed by some previous statements.
  
  Fixed by checking the value of thd->insert_id_used in
  select_insert::send_eof() and returning 0 for mysql_insert_id() if it
  is not set.
[13 Mar 2008 19:27] Bugs System
Pushed into 6.0.5-alpha
[13 Mar 2008 19:34] Bugs System
Pushed into 5.1.24-rc
[13 Mar 2008 19:42] Bugs System
Pushed into 5.0.60
[3 Apr 2008 15:03] Jon Stephens
Testing only, no user changes to document. Closed.
[10 Apr 2008 12:32] Paul DuBois
Noted in 5.0.60, 5.1.24, 6.0.5 changelogs.

Under some circumstances, the value of mysql_insert_id() following a
SELECT ... INSERT statement could return an incorrect value. This
could happen when the last SELECT ... INSERT did not involve an 
AUTO_INCREMENT column, but the value of mysql_insert_id() was changed
by some previous statements.