Bug #10045 CHECK TABLE problems with composite AUTO_INCREMENT, BLOB primary key
Submitted: 20 Apr 2005 20:09 Modified: 13 May 2005 20:03
Reporter: Dean Ellis Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: MyISAM storage engine Severity:S3 (Non-critical)
Version:4.0 OS:
Assigned to: Michael Widenius CPU Architecture:Any

[20 Apr 2005 20:09] Dean Ellis
Description:
CHECK TABLE reports warnings about max used auto_increment value for composite primary keys consisting of the auto_increment and a blob/text column (which contains a non-empty value).

How to repeat:
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 ( a INT AUTO_INCREMENT, b BLOB, PRIMARY KEY (a,b(10)) );
CHECK TABLE t1;
INSERT INTO t1 (b) VALUES ('aaaa');
CHECK TABLE t1;
INSERT INTO t1 (b) VALUES ('');
CHECK TABLE t1;
INSERT INTO t1 (b) VALUES ('bbbb');
CHECK TABLE t1;

Suggested fix:
n/a
[20 Apr 2005 20:19] Dean Ellis
The values reported by CHECK TABLE as the "max used value" are presumably from the value stored in the BLOB column for the particular row.

ie:
INSERT INTO t1 (b) VALUES ('AAAA');
CHECK TABLE t1;
Auto-increment value: 1 is smaller than max used value: 4276545

With 4276545 being 0x414141, or 'AAA'.

INSERT INTO t1 (b) VALUES ('BBBA');
CHECK TABLE t1;
Auto-increment value: 2 is smaller than max used value: 4276802

With 4276802 being 0x414242, or 'ABB'.

And so on.
[26 Apr 2005 16:24] MySQL Verification Team
This bug is storage engine specific.
[13 May 2005 20: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/internals/24881
[13 May 2005 20:03] Michael Widenius
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html

Additional info:

Fix will be in MySQL 4.0.25