Bug #75189 engines suite tests depending on InnoDB implementation details
Submitted: 12 Dec 2014 7:09 Modified: 19 Dec 2014 22:14
Reporter: Laurynas Biveinis (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Tests Severity:S3 (Non-critical)
Version:5.6 OS:Any
Assigned to: CPU Architecture:Any
Tags: TokuDB

[12 Dec 2014 7:09] Laurynas Biveinis
Description:
Credit goes to Rich Prohaska.

engines/funcs.in_insert_select_unique_violation and engines/iuds.insert_number test for duplicate primary key value violations by INSERT SELECT that has several violations. The tests record what InnoDB happens to return as the first violation, which might differ in case of e.g. TokuDB.

The linked commits show it clearly, for example:

 CREATE TABLE t2(c1 TINYINT NOT NULL PRIMARY KEY);
 INSERT INTO t1 (c1) VALUES(0),(1),(2),(3),(3),(4),(4),(5);
 INSERT INTO t2 SELECT * FROM t1;
 ERROR 23000: Duplicate entry '3' for key 'PRIMARY'

Whereas with TokuDB

ERROR 23000: Duplicate entry '4' for key 'PRIMARY'

How to repeat:
See above

Suggested fix:
Accept any duplicate value in the error:

https://github.com/Tokutek/percona-server-5.6/commit/8d7225f745abd21b1da63ffb48cee000f02c3...
https://github.com/Tokutek/percona-server-5.6/commit/ac3478d441ac9a3394c3782462a6d8be07935...
[19 Dec 2014 22:14] Sveta Smirnova
Thank you for the report.

Verified as described.