Bug #32625 Make test type_bit_innodb more robust
Submitted: 22 Nov 2007 14:42 Modified: 19 Jun 2010 0:23
Reporter: Vasil Dimov Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Tests Severity:S3 (Non-critical)
Version:5.1 OS:Any
Assigned to: CPU Architecture:Any
Tags: Contribution

[22 Nov 2007 14:42] Vasil Dimov
Description:
type_bit_innodb test tries to add unique index on a table that has more than one duplicate values. This means that the value reported as duplicate in the error message is non-deterministic.

How to repeat:
This may be hard to repeat with the current source, but the fix below makes it future-proof.

The test failed for me with a non-standard InnoDB source tree.

Suggested fix:
This simple fix changes the error message from:

ERROR 23000: Duplicate entry '***WHATEVER***' for key 'a'

to

ERROR 23000: Duplicate entry '' for key 'a'

--- mysql-test/t/type_bit_innodb.test.orig      2007-11-22 16:25:06.000000000 +0200
+++ mysql-test/t/type_bit_innodb.test   2007-11-22 16:26:48.000000000 +0200
@@ -40,6 +40,7 @@
 create table t1 (a bit) engine=innodb;
 insert into t1 values (b'0'), (b'1'), (b'000'), (b'100'), (b'001');
 select hex(a) from t1;
+--replace_regex /(.*Duplicate entry )'.*'( for key.*)/\1''\2/
 --error ER_DUP_ENTRY
 alter table t1 add unique (a);
 drop table t1;
[7 Oct 2008 9:44] Vasil Dimov
Ping.
[5 Mar 2009 6:29] 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/68307

2767 Timothy Smith	2009-03-04
      Apply fix for Bug #32625: Make test type_bit_innodb more robust
      
      Since the test inserts more than one duplicate value, it's not deterministic
      which one will be noticed as a problem when adding the unique index.  So just
      clear the value out when printing the result, as the ER_DUP_ENTRY is what's
      important.
[11 Mar 2009 20:57] 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/68954

2777 Timothy Smith	2009-03-11
      Bug #32625: Make test type_bit_innodb more robust
      
      Since there is more than one duplicate value in the table, when adding the
      unique index it is not deterministic which value will be reported as causing a
      problem.  Replace the reported value with '' so that it doesn't affect the
      results.
[11 Mar 2009 21:13] Timothy Smith
Queued into 5.0-, 5.1-, and 6.0-bugteam.
[13 Mar 2009 19:03] Bugs System
Pushed into 5.1.33 (revid:joro@sun.com-20090313111355-7bsi1hgkvrg8pdds) (version source revid:azundris@mysql.com-20090312165510-brjlbv9ony3rkl9m) (merge vers: 5.1.33) (pib:6)
[13 Mar 2009 19:09] Bugs System
Pushed into 5.0.80 (revid:chad@mysql.com-20090312173213-viivy35mb79n1zlg) (version source revid:chad@mysql.com-20090312173213-viivy35mb79n1zlg) (merge vers: 5.0.80) (pib:6)
[14 Mar 2009 23:57] Paul DuBois
Test case changes. No changelog entry needed.

Setting report to NDI pending push into 6.0.x.
[18 Mar 2009 13:21] Bugs System
Pushed into 6.0.11-alpha (revid:joro@sun.com-20090318122208-1b5kvg6zeb4hxwp9) (version source revid:azundris@mysql.com-20090312170222-ge037buaytw4yjf8) (merge vers: 6.0.11-alpha) (pib:6)
[18 Mar 2009 14:27] Paul DuBois
Test case changes. No changelog entry needed.
[9 May 2009 16:41] Bugs System
Pushed into 5.1.34-ndb-6.2.18 (revid:jonas@mysql.com-20090508185236-p9b3as7qyauybefl) (version source revid:jonas@mysql.com-20090508100057-30ote4xggi4nq14v) (merge vers: 5.1.33-ndb-6.2.18) (pib:6)
[9 May 2009 17:38] Bugs System
Pushed into 5.1.34-ndb-6.3.25 (revid:jonas@mysql.com-20090509063138-1u3q3v09wnn2txyt) (version source revid:jonas@mysql.com-20090508175813-s6yele2z3oh6o99z) (merge vers: 5.1.33-ndb-6.3.25) (pib:6)
[9 May 2009 18:35] Bugs System
Pushed into 5.1.34-ndb-7.0.6 (revid:jonas@mysql.com-20090509154927-im9a7g846c6u1hzc) (version source revid:jonas@mysql.com-20090509073226-09bljakh9eppogec) (merge vers: 5.1.33-ndb-7.0.6) (pib:6)
[5 May 2010 15:08] Bugs System
Pushed into 5.1.47 (revid:joro@sun.com-20100505145753-ivlt4hclbrjy8eye) (version source revid:vasil.dimov@oracle.com-20100331130613-8ja7n0vh36a80457) (merge vers: 5.1.46) (pib:16)
[6 May 2010 3:05] Paul DuBois
Push resulted from incorporation of InnoDB tree. No changes pertinent to this bug. Re-closing.
[28 May 2010 5:47] Bugs System
Pushed into mysql-next-mr (revid:alik@sun.com-20100524190136-egaq7e8zgkwb9aqi) (version source revid:vasil.dimov@oracle.com-20100331130613-8ja7n0vh36a80457) (pib:16)
[28 May 2010 6:17] Bugs System
Pushed into 6.0.14-alpha (revid:alik@sun.com-20100524190941-nuudpx60if25wsvx) (version source revid:vasil.dimov@oracle.com-20100331130613-8ja7n0vh36a80457) (merge vers: 5.1.46) (pib:16)
[28 May 2010 6:44] Bugs System
Pushed into 5.5.5-m3 (revid:alik@sun.com-20100524185725-c8k5q7v60i5nix3t) (version source revid:vasil.dimov@oracle.com-20100331130613-8ja7n0vh36a80457) (merge vers: 5.1.46) (pib:16)
[29 May 2010 2:54] Paul DuBois
Push resulted from incorporation of InnoDB tree. No changes pertinent to this bug.
Re-closing.
[17 Jun 2010 11:47] Bugs System
Pushed into 5.1.47-ndb-7.0.16 (revid:martin.skold@mysql.com-20100617114014-bva0dy24yyd67697) (version source revid:vasil.dimov@oracle.com-20100331130613-8ja7n0vh36a80457) (merge vers: 5.1.46) (pib:16)
[17 Jun 2010 12:25] Bugs System
Pushed into 5.1.47-ndb-6.2.19 (revid:martin.skold@mysql.com-20100617115448-idrbic6gbki37h1c) (version source revid:vasil.dimov@oracle.com-20100331130613-8ja7n0vh36a80457) (merge vers: 5.1.46) (pib:16)
[17 Jun 2010 13:12] Bugs System
Pushed into 5.1.47-ndb-6.3.35 (revid:martin.skold@mysql.com-20100617114611-61aqbb52j752y116) (version source revid:vasil.dimov@oracle.com-20100331130613-8ja7n0vh36a80457) (merge vers: 5.1.46) (pib:16)