Bug #16819 ALTER TABLE test.t1 REBUILD PARTITION p0 1037: Out of memory;
Submitted: 26 Jan 2006 19:14 Modified: 25 Apr 2006 9:25
Reporter: Jonathan Miller Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Partitions Severity:S3 (Non-critical)
Version:5.1.6-alpha OS:Linux (Linux)
Assigned to: Mikael Ronström CPU Architecture:Any

[26 Jan 2006 19:14] Jonathan Miller
Description:
Errors are (from /home/ndbdev/jmiller/clones/mysql-5.1-new/mysql-test/var/log/mysqltest-time) :
mysqltest: At line 40: query 'ALTER TABLE test.t1 REBUILD PARTITION p0' failed: 1037: Out of memory; restart server and try again (needed 8 bytes)

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= 11;
--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 INDEX (c5);

ALTER TABLE test.t1 RENAME test.t3;

ALTER TABLE test.t3 RENAME test.t1;

ALTER TABLE test.t1 CHANGE c2 c2 BLOB;

ALTER TABLE test.t1 CHANGE c2 c2 TEXT;

ALTER TABLE test.t1 MODIFY c1 BIGINT NOT NULL;

SHOW CREATE TABLE test.t1;

ALTER TABLE test.t1 REBUILD PARTITION p0;

DROP TABLE test.t1;
[26 Jan 2006 21:02] Jorge del Conde
Reproduced with a recent 5.1 clone
[21 Mar 2006 16:31] Mikael Ronström
This bug is not present for the moment.
However there is nothing particularly sensible happening at this command.
The entire table is rebuilt as usual as this is the only action ALTER TABLE can
perform on MySQL Cluster tables in 5.1. So there are two options either simply
report an error that command isn't supported or have it as it is now where it
uses the same "hammer" whatever command is issued (REPAIR, CHECK, REBUILD,
OPTIMIZE, ANALYZE).
[21 Mar 2006 22:52] Jonathan Miller
If it is not supported, I would think returning "command isn't supported" would be best.
/jbm
[24 Mar 2006 15:44] Mikael Ronström
Patch pending to ensure a proper error message is received
[24 Apr 2006 20:44] Mikael Ronström
This patch will be a part of MySQL 5.1.10
[25 Apr 2006 9:25] 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.10 changelog; closed.