Bug #16806 ALTER TABLE fails Can't create table 'test.#sql-549f_2' (errno: 140)
Submitted: 26 Jan 2006 14:43 Modified: 27 Mar 2006 14:09
Reporter: Jonathan Miller Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Partitions Severity:S2 (Serious)
Version:5.1.6-alpha OS:Linux (Linux)
Assigned to: Mikael Ronström CPU Architecture:Any

[26 Jan 2006 14:43] Jonathan Miller
Description:
Errors are (from /home/ndbdev/jmiller/clones/mysql-5.1-new/mysql-test/var/log/mysqltest-time) :
mysqltest: At line 23: query 'ALTER TABLE test.t1
ADD COLUMN c8 INT AFTER c1' failed: 1005: Can't create table 'test.#sql-549f_2' (errno: 140)
(the last lines may be the most important ones)

How to repeat:
CREATE TABLE test.t1 (
  c1 MEDIUMINT NOT NULL AUTO_INCREMENT,
  c2 TEXT NOT NULL,
  c3 INT NOT NULL,
  c4 BIT NOT NULL,
  c5 FLOAT,
  c6 VARCHAR(255),
  c7 TIMESTAMP,
  PRIMARY KEY(c1,c3))
  ENGINE=NDB
  PARTITION BY KEY(c3) PARTITIONS 5;

let $j= 800;
--disable_query_log
while ($j)
{
  eval INSERT INTO test.t1 VALUES (NULL, "Tested Remotely from Texas, USA", $j, b'0',
                                   $j.00,"By JBM $j","2006-01-26");
  dec $j;
}
--enable_query_log
ALTER TABLE test.t1
 ADD COLUMN c8 INT AFTER c1;
DROP TABLE test.t1;
~
[26 Jan 2006 20:57] Jorge del Conde
I tested this under FC4 using a fresh clone of 5.1
[16 Mar 2006 14:47] Jonathan Miller
Upgrade per Omer
[23 Mar 2006 14:33] Mikael Ronström
Default handling put some traps that needed care in fixing
[24 Mar 2006 16:44] Mikael Ronström
This bug fix will appear in 5.1.8
[27 Mar 2006 14:09] Jon Stephens
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:

Documented bugfix in 5.1.8 changelog. Closed.