Bug #39445 | Falcon: Update fails following online add column | ||
---|---|---|---|
Submitted: | 15 Sep 2008 6:22 | Modified: | 15 May 2009 15:57 |
Reporter: | Christopher Powers | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Falcon storage engine | Severity: | S2 (Serious) |
Version: | 6.0-falcon | OS: | Any |
Assigned to: | Christopher Powers | CPU Architecture: | Any |
Tags: | F_ONLINE ALTER |
[15 Sep 2008 6:22]
Christopher Powers
[15 Sep 2008 18:11]
MySQL Verification Team
Thank you for the bug report. Verified as described. Server version: 6.0.8-alpha-debug Source distribution Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> DROP TABLE IF EXISTS t1; Query OK, 0 rows affected, 1 warning (0.00 sec) mysql> CREATE TABLE t1 (s1 int, s2 int, key(s2)) ENGINE=FALCON; Query OK, 0 rows affected (0.04 sec) mysql> INSERT INTO t1 VALUES (1,1), (2,2), (3,3); Query OK, 3 rows affected (0.00 sec) Records: 3 Duplicates: 0 Warnings: 0 mysql> ALTER ONLINE TABLE t1 ADD COLUMN (s3 int), ADD COLUMN (s4 int); Query OK, 0 rows affected (0.01 sec) Records: 0 Duplicates: 0 Warnings: 0 mysql> INSERT INTO t1 VALUES (4,4,4,4), (5,5,5,5), (6,6,6,6); Query OK, 3 rows affected (0.00 sec) Records: 3 Duplicates: 0 Warnings: 0 mysql> SELECT * FROM t1; +------+------+------+------+ | s1 | s2 | s3 | s4 | +------+------+------+------+ | 1 | 1 | NULL | NULL | | 2 | 2 | NULL | NULL | | 3 | 3 | NULL | NULL | | 4 | 4 | 4 | 4 | | 5 | 5 | 5 | 5 | | 6 | 6 | 6 | 6 | +------+------+------+------+ 6 rows in set (0.00 sec) mysql> UPDATE t1 SET s2 = s1 + 1; ERROR 1032 (HY000): Can't find record in 't1' mysql>
[21 Feb 2009 23:34]
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/commits/67101 3030 Christopher Powers 2009-02-21 Bug #39445 "Falcon: Update fails following online add column" Enabled online ALTER ADD COLUMN. The problem is that online ALTER ADD COLUMN creates a new default record format for the table that has more fields than the older record formats associated with existing rows. This causes inconsistent results during row updates because the the older, shorter rows lacked the encoding for new columns. StorageInterface::decodeRecord() now sets the NULL flag for fields that are not physically represented. The assumption of NULL can be safely made because online ALTER ADD COLUMN only supports nullable columns and a default value of NULL. Columns added outside of this restriction, e.g. with a non-null default value, will be created via the slow ALTER in which all rows are copied into a new table and thus assigned the newer record format.
[22 Feb 2009 7:14]
Kevin Lewis
Code looks good. OK to push.
[23 Feb 2009 11:03]
John Embretsen
A regression test for this bug is part of the falcon_online_add_column test which is attached to the e-mail at http://lists.mysql.com/falcon/13 (2008-10-03) The entire test needs to be adapted to the current feature restrictions, e.g. that ONLINE ADD COLUMN is supporting only nullable columns with DEFAULT NULL values (?). In other words, move test segments that include adding/dropping NOT NULL columns into the "negative testing" section. Should also add a test segment for adding DEFAULT NULL columns.
[2 Mar 2009 14:12]
Bugs System
Pushed into 6.0.11-alpha (revid:alik@sun.com-20090302140208-lfdejjbcyezlhhjt) (version source revid:vvaintroub@mysql.com-20090223172157-jllfd81jwvak4n5j) (merge vers: 6.0.11-alpha) (pib:6)
[15 May 2009 15:57]
MC Brown
An entry has been added to the 6.0.11 changelog: Updating Falcon tables after an online ALTER ADD COLUMN operation could fail