Bug #23419 "Got error 1 from storage engine" when altering a table into partitions
Submitted: 18 Oct 2006 13:10 Modified: 18 Oct 2006 14:04
Reporter: Jason Morriss Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:5.1.11 OS:Linux (debian (intel))
Assigned to: CPU Architecture:Any
Tags: partition, partitioning

[18 Oct 2006 13:10] Jason Morriss
Description:
When implementing partitioning on a table designed to store log data I'm getting an error code 1 when I try to do certain selects from the table. It looks as though if I try to use any aggregate functions it fails. I've restarted the server and checked the tables, etc, and myiasmchk does tell me the index's need to be repaired but no matter how many times I do it, it still says they need to be repaired. 

The disk seems fine.

How to repeat:
create table test ( eventid int(10) unsigned, eventtime datetime not null, key eventtime (eventtime) );

ALTER TABLE test PARTITION BY RANGE(TO_DAYS(eventtime)) ( PARTITION `p2006-10-18` VALUES LESS THAN (TO_DAYS('2006-10-19')) );

select max(eventtime) from test;

The last select will give the error. No matter how many times I try to recreate the table, or repair it with myisamchk. If I do not partition the table, I never get errors.
[18 Oct 2006 13:50] MySQL Verification Team
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 bug fix. More information about accessing the source trees is available at

    http://dev.mysql.com/doc/en/installing-source.html

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.1.12-beta-debug Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> create table test ( eventid int(10) unsigned, eventtime datetime not
    -> null, key eventtime (eventtime) );
Query OK, 0 rows affected (0.01 sec)

mysql> ALTER TABLE test PARTITION BY RANGE(TO_DAYS(eventtime)) ( PARTITION
    -> `p2006-10-18` VALUES LESS THAN (TO_DAYS('2006-10-19')) );
Query OK, 0 rows affected (0.02 sec)
Records: 0  Duplicates: 0  Warnings: 0

mysql> select max(eventtime) from test;
+----------------+
| max(eventtime) |
+----------------+
| NULL           | 
+----------------+
1 row in set (0.01 sec)

mysql>
[18 Oct 2006 14:04] Jason Morriss
thank you!