Bug #46188 Server raises fatal exception if engine returns error during ONLINE ALTER
Submitted: 15 Jul 2009 3:31 Modified: 15 Aug 2009 12:37
Reporter: Christopher Powers Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server: DDL Severity:S2 (Serious)
Version: OS:Any
Assigned to: CPU Architecture:Any
Tags: F_ONLINE ALTER

[15 Jul 2009 3:31] Christopher Powers
Description:
The server raises a fatal exception if the storage engine returns an error during ONLINE ALTER operations. This restricts the engine's ability to perform several online operations.

For example, Falcon creates online primary or unique indexes in alter phase 2. Pre-existing duplicate keys can only be discovered during this phase, after the index has been created and is being populated.

If a duplicate is encountered, Falcon would ordinarily return an error and drop the newly created index. However, the server raises a fatal exception if an error is returned during any of the alter phases.

For now, online add primary/unique indexes is disabled in Falcon until the server can except a duplicate key error without crashing (see Bug#45885).

How to repeat:
(Dependent upon changes in Bug#45885)

Build Falcon with HA_ADD_UNIQUE_INDEX and HA_ADD_PK_INDEX enabled in check_if_supported_alter() in ha_falcon.cpp.

CREATE TABLE t1 (s1 int, s2 int) ENGINE = FALCON;
INSERT INTO t1 VALUES (1,1), (1,2);
ALTER ONLINE TABLE t1 ADD UNIQUE INDEX it1 (s1);
[15 Jul 2009 12:37] Susanne Ebrecht
Many thanks for writing a bug report.

Is it only falcon related or do you have same issue by using InnoDB, MyISAM or another storage engine?

Which version/tree did you take for testing?
[15 Jul 2009 14:47] Christopher Powers
Hi,

This is true for any storage engine that uses the online ALTER API: check_if_supported_alter(), alter_table_phase1(), alter_table_phase2() and alter_table_phase3().

As far as I know, only Falcon and NDB use this API.
[15 Aug 2009 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".