Second crash in hp_movelink with mysql-55-eb

Bug #788576 reported by Philip Stoev
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
percona-projects-qa
Fix Released
High
Alexey Kopytov

Bug Description

If a heap table containing prefix keys is ALTER-ed , the resulting table is corrupt. Either the following backtrace occurs:

#5 0x085fd074 in hp_movelink (pos=0xae911750, next_link=0x0, newlink=0xae911758) at /home/philips/bzr/mysql-55-eb/storage/heap/hp_hash.c:232
#6 0x086021d2 in hp_write_key (info=0xae93ca50, keyinfo=0xae9159ec, record=0xae9144d0 "\340\002golugcgqkinkglugcgqkinkglugcgqki\004were",
    recpos=0xae94a438 "<\244\224\256") at /home/philips/bzr/mysql-55-eb/storage/heap/hp_write.c:336
#7 0x08601b00 in heap_write (info=0xae93ca50, record=0xae9144d0 "\340\002golugcgqkinkglugcgqkinkglugcgqki\004were")
    at /home/philips/bzr/mysql-55-eb/storage/heap/hp_write.c:63
#8 0x085fa774 in ha_heap::write_row (this=0xae911258, buf=0xae9144d0 "\340\002golugcgqkinkglugcgqkinkglugcgqki\004were")
    at /home/philips/bzr/mysql-55-eb/storage/heap/ha_heap.cc:246
#9 0x08355a69 in handler::ha_write_row (this=0xae911258, buf=0xae9144d0 "\340\002golugcgqkinkglugcgqkinkglugcgqki\004were")
    at /home/philips/bzr/mysql-55-eb/sql/handler.cc:4782
#10 0x081ed5ac in write_record (thd=0xa0d8fe0, table=0xae913e00, info=0xb16b703c) at /home/philips/bzr/mysql-55-eb/sql/sql_insert.cc:1734
#11 0x081eb7ee in mysql_insert (thd=0xa0d8fe0, table_list=0xae9048f0, fields=..., values_list=..., update_fields=..., update_values=..., duplic=DUP_ERROR,
    ignore=true) at /home/philips/bzr/mysql-55-eb/sql/sql_insert.cc:928
#12 0x08203178 in mysql_execute_command (thd=0xa0d8fe0) at /home/philips/bzr/mysql-55-eb/sql/sql_parse.cc:2787
#13 0x0820a92a in mysql_parse (thd=0xa0d8fe0,
    rawbuf=0xae9046d0 "INSERT IGNORE INTO t1 VALUES\n( 2 , NULL , 6 , REPEAT( 'glugcgqk' , 5 ) , 'look' ) ,\n( REPEAT( 'kglugcgqkin' , 6 ) , 'if' , 'was' , NULL , NULL ) ,\n( 'go' , 'were' , 3 , 7 , 7 ) ,\n( NULL , NULL , NULL "..., length=212, parser_state=0xb16b8034)
    at /home/philips/bzr/mysql-55-eb/sql/sql_parse.cc:5503
#14 0x081feffa in dispatch_command (command=COM_QUERY, thd=0xa0d8fe0,
    packet=0xa170919 "INSERT IGNORE INTO t1 VALUES\n( 2 , NULL , 6 , REPEAT( 'glugcgqk' , 5 ) , 'look' ) ,\n( REPEAT( 'kglugcgqkin' , 6 ) , 'if' , 'was' , NULL , NULL ) ,\n( 'go' , 'were' , 3 , 7 , 7 ) ,\n( NULL , NULL , NULL "..., packet_length=212) at /home/philips/bzr/mysql-55-eb/sql/sql_parse.cc:1034
#15 0x081fe4e8 in do_command (thd=0xa0d8fe0) at /home/philips/bzr/mysql-55-eb/sql/sql_parse.cc:771
#16 0x082cced5 in do_handle_one_connection (thd_arg=0xa0d8fe0) at /home/philips/bzr/mysql-55-eb/sql/sql_connect.cc:776
#17 0x082ccb98 in handle_one_connection (arg=0xa0d8fe0) at /home/philips/bzr/mysql-55-eb/sql/sql_connect.cc:724
#18 0x084d966c in pfs_spawn_thread (arg=0xa1607a0) at /home/philips/bzr/mysql-55-eb/storage/perfschema/pfs.cc:1015
#19 0x00821919 in start_thread () from /lib/libpthread.so.0
#20 0x0076acce in clone () from /lib/libc.so.6

or the server reports that the table is corrupt.

Test case:

CREATE TABLE IF NOT EXISTS t1 (
         f1 VARCHAR ( 32 ) ,
         f2 VARCHAR ( 128 ) ,
         f3 VARBINARY ( 128 ) ,
         f4 VARBINARY ( 512 ) ,
         f5 VARBINARY ( 1024 ) ,
KEY ( f2 ( 1 ) ) ) ENGINE=HEAP ROW_FORMAT=DYNAMIC ;
ALTER TABLE t1 ENGINE = HEAP;

# Crash happens on this INSERT
INSERT IGNORE INTO t1 VALUES
( 2 , NULL , 6 , REPEAT( 'glugcgqk' , 5 ) , 'look' ) ,
( REPEAT( 'kglugcgqkin' , 6 ) , 'if' , 'was' , NULL , NULL ) ,
( 'go' , 'were' , 3 , 7 , 7 ) ,
( NULL , NULL , NULL , NULL , 7 );

# or, table corruption is reported on this DELETE
DELETE FROM t1 WHERE f5 <=> NULL ;

bzr version-info:

revision-id: <email address hidden>
date: 2011-05-26 09:12:10 +0300
build-date: 2011-05-26 14:41:38 +0300
revno: 3479
branch-nick: mysql-55-eb

Changed in percona-projects-qa:
milestone: none → 5.5.13-eb
importance: Undecided → High
assignee: nobody → Laurynas Biveinis (laurynas-biveinis)
status: New → In Progress
Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :

Able to reproduce with

CREATE TABLE IF NOT EXISTS t1 (
         f1 VARCHAR ( 32 ) ,
         f2 VARCHAR ( 128 ) ,
         f3 VARBINARY ( 128 ) ,
         f4 VARBINARY ( 512 ) ,
         f5 VARBINARY ( 1024 ) ,
KEY ( f2 ( 1 ) ) ) ENGINE=HEAP ROW_FORMAT=DYNAMIC ;
INSERT IGNORE INTO t1 VALUES
( 2 , NULL , 6 , REPEAT( 'glugcgqk' , 5 ) , 'look' ) ,
( REPEAT( 'kglugcgqkin' , 6 ) , 'if' , 'was' , NULL , NULL ),
( NULL , NULL , NULL , NULL , 7 );
DELETE FROM t1 WHERE f5 <=> NULL ;

summary: - Second crash in hp_movelink with maria-55-eb
+ Second crash in hp_movelink with mysql-55-eb
Changed in percona-projects-qa:
assignee: Laurynas Biveinis (laurynas-biveinis) → Alexey Kopytov (akopytov)
Changed in percona-projects-qa:
status: In Progress → Fix Committed
Changed in percona-projects-qa:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.