Bug #69086 Assertion `fd != -1' fails in my_seek on REPAIR of a corrupted ARCHIVE table
Submitted: 26 Apr 2013 19:17 Modified: 26 Apr 2013 20:27
Reporter: Elena Stepanova Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Archive storage engine Severity:S3 (Non-critical)
Version:5.1-debug, 5.5-debug, 5.6-debug OS:Any
Assigned to: CPU Architecture:Any

[26 Apr 2013 19:17] Elena Stepanova
Description:
Version: '5.5.31-debug-log'  socket: '/data/repo/bzr/mysql-5.5/mysql-test/var/tmp/mysqld.1.sock'  port: 13000  Source distribution
mysqld: mysql-5.5/mysys/my_seek.c:57: my_seek: Assertion `fd != -1' failed.
19:15:56 UTC - mysqld got signal 6 ;

#7  0x00007f17fcff5192 in __GI___assert_fail (assertion=0xc2b4c9 "fd != -1", file=0xc2b450 "mysql-5.5/mysys/my_seek.c", line=57, function=0xc2b540 "my_seek") at assert.c:103
#8  0x00000000008dd828 in my_seek (fd=-1, pos=1330205761, whence=0, MyFlags=0) at mysql-5.5/mysys/my_seek.c:57
#9  0x000000000090913d in azrewind (s=0x7f17ec01d138) at mysql-5.5/storage/archive/azio.c:685
#10 0x0000000000902a25 in ha_archive::read_data_header (this=0x7f17ec01cf80, file_to_read=0x7f17ec01d138) at mysql-5.5/storage/archive/ha_archive.cc:316
#11 0x0000000000904910 in ha_archive::rnd_init (this=0x7f17ec01cf80, scan=true) at mysql-5.5/storage/archive/ha_archive.cc:1107
#12 0x00000000005a035b in handler::ha_rnd_init (this=0x7f17ec01cf80, scan=true) at mysql-5.5/sql/handler.h:1375
#13 0x000000000076c930 in handler::read_first_row (this=0x7f17ec01cf80, buf=0x7f17ec02a2b0 "\375\001", primary_key=64) at mysql-5.5/sql/handler.cc:2295
#14 0x000000000064674a in join_read_system (tab=0x7f17ec03c440) at mysql-5.5/sql/sql_select.cc:12228
#15 0x00000000006463d2 in join_read_const_table (tab=0x7f17ec03c440, pos=0x7f17ec005458) at mysql-5.5/sql/sql_select.cc:12158
#16 0x000000000062f9fe in make_join_statistics (join=0x7f17ec0053c8, tables_arg=0x7f17ec004de0, conds=0x0, keyuse_array=0x7f17ec006980) at mysql-5.5/sql/sql_select.cc:2873
#17 0x0000000000629051 in JOIN::optimize (this=0x7f17ec0053c8) at mysql-5.5/sql/sql_select.cc:1057
#18 0x000000000062ebe9 in mysql_select (thd=0x28d9970, rref_pointer_array=0x28dbc38, tables=0x7f17ec004de0, wild_num=1, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7f17ec0053a8, unit=0x28db440, select_lex=0x28dba60) at mysql-5.5/sql/sql_select.cc:2590
#19 0x0000000000626bda in handle_select (thd=0x28d9970, lex=0x28db390, result=0x7f17ec0053a8, setup_tables_done_option=0) at mysql-5.5/sql/sql_select.cc:297
#20 0x00000000006025d7 in execute_sqlcom_select (thd=0x28d9970, all_tables=0x7f17ec004de0) at mysql-5.5/sql/sql_parse.cc:4590
#21 0x00000000005fb138 in mysql_execute_command (thd=0x28d9970) at mysql-5.5/sql/sql_parse.cc:2151
#22 0x0000000000604738 in mysql_parse (thd=0x28d9970, rawbuf=0x7f17ec004c10 "select * from t1", length=16, parser_state=0x7f17f35d7190) at mysql-5.5/sql/sql_parse.cc:5627
#23 0x00000000005f8773 in dispatch_command (command=COM_QUERY, thd=0x28d9970, packet=0x295ecd1 "select * from t1", packet_length=16) at mysql-5.5/sql/sql_parse.cc:1037
#24 0x00000000005f7a88 in do_command (thd=0x28d9970) at mysql-5.5/sql/sql_parse.cc:773
#25 0x00000000006dfdd4 in do_handle_one_connection (thd_arg=0x28d9970) at mysql-5.5/sql/sql_connect.cc:853
#26 0x00000000006df808 in handle_one_connection (arg=0x28d9970) at mysql-5.5/sql/sql_connect.cc:772
#27 0x00000000008fe336 in pfs_spawn_thread (arg=0x2941300) at mysql-5.5/storage/perfschema/pfs.cc:1015
#28 0x00007f17fd38ce9a in start_thread (arg=0x7f17f35d8700) at pthread_create.c:308
#29 0x00007f17fd0b9cbd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112

How to repeat:
--source include/have_archive.inc

--let $datadir = `SELECT @@datadir`

create table t1 (a int) engine=archive;
insert into t1 values (1);
--remove_file $datadir/test/t1.ARZ
--error 13,1017,1194
select * from t1;
--error ER_CRASHED_ON_USAGE
insert into t1 values (2);
repair table t1;
[26 Apr 2013 20:27] MySQL Verification Team
Hello Elena,

Thank you for the report.
Verified as described.

Thanks,
Umesh