Description:
on 5.0.45 on windows:
mysql> insert ignore into `t1`(`a`) values (GeomFromWKB(@v));
ERROR 126 (HY000): Incorrect key file for table '.\f\t1.MYI'; try to repair it
mysql> check table t1 extended;
+-------+-------+----------+----------------------------+
| Table | Op | Msg_type | Msg_text |
+-------+-------+----------+----------------------------+
| f.t1 | check | warning | Table is marked as crashed |
| f.t1 | check | status | OK |
+-------+-------+----------+----------------------------+
2 rows in set (0.00 sec)
on 5.1.21-debug on linux, server crashes!
Version: '5.1.21-beta-debug' socket: '/tmp/mysql.sock' port: 3306 yes
070807 23:12:03 - mysqld got signal 11;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help diagnose
the problem, but since we have already crashed, something is definitely wrong
and this may fail.
key_buffer_size=8388572
read_buffer_size=131072
max_used_connections=1
max_threads=151
threads_connected=1
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 337612 K
bytes of memory
Hope that's ok; if not, decrease some variables in the equation.
thd: 0x8db0b90
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
Cannot determine thread, fp=0x4286482c, backtrace may not be correct.
Stack range sanity check OK, backtrace follows:
0x81fd55d handle_segfault + 541
0x84856e8 _mi_kpos + 96
0x84ae411 rtree_insert_req + 408
0x84ae7fe rtree_insert_level + 457
0x84aeb50 rtree_insert + 140
0x8493dbc mi_write + 1020
0x847aead _ZN9ha_myisam9write_rowEPh + 99
0x82ed67b _ZN7handler12ha_write_rowEPh + 33
0x827d044 _Z12write_recordP3THDP8st_tableP12st_copy_info + 1968
0x827b8fa _Z12mysql_insertP3THDP10TABLE_LISTR4ListI4ItemERS3_IS5_ES6_S6_15enum_duplicatesb + 2248
0x820cc1c _Z21mysql_execute_commandP3THD + 10268
0x821372e _Z11mysql_parseP3THDPKcjPS2_ + 372
0x8208ec8 _Z16dispatch_command19enum_server_commandP3THDPcj + 2320
0x82085ac _Z10do_commandP3THD + 612
0x82070ef handle_one_connection + 253
0x40038aa7 _end + 931867479
0x4017ec2e _end + 933203166
New value of fp=(nil) failed sanity check, terminating stack trace!
Please read http://dev.mysql.com/doc/refman/5.1/en/resolve-stack-dump.html
and follow instructions on how to resolve the stack trace.
Resolved stack trace is much more helpful in diagnosing the
problem, so please do resolve it
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort...
thd->query at 0x8de08c0 = insert ignore into `t1`(`a`) values (GeomFromWKB(@v))
thd->thread_id=1
How to repeat:
drop table if exists `t1`;
create table `t1` (`a` geometry not null, spatial index(`a`))engine=myisam;
set @v=unhex(concat('01','01000000',lpad(conv(abs(-98),10,16),16,'0'),lpad(conv(abs(65),10,16),16,'0')));
insert ignore into `t1`(`a`) values (GeomFromWKB(@v));
set @v=unhex(concat('01','01000000',lpad(conv(abs(-104),10,16),16,'0'),lpad(conv(abs(-123),10,16),16,'0')));
insert ignore into `t1`(`a`) values (GeomFromWKB(@v));
set @v=unhex(concat('01','01000000',lpad(conv(abs(-2),10,16),16,'0'),lpad(conv(abs(-128),10,16),16,'0')));
insert ignore into `t1`(`a`) values (GeomFromWKB(@v));
set @v=unhex(concat('01','01000000',lpad(conv(abs(-32),10,16),16,'0'),lpad(conv(abs(-53),10,16),16,'0')));
insert ignore into `t1`(`a`) values (GeomFromWKB(@v));
set @v=unhex(concat('01','01000000',lpad(conv(abs(-95),10,16),16,'0'),lpad(conv(abs(87),10,16),16,'0')));
insert ignore into `t1`(`a`) values (GeomFromWKB(@v));
set @v=unhex(concat('01','01000000',lpad(conv(abs(-113),10,16),16,'0'),lpad(conv(abs(-14),10,16),16,'0')));
insert ignore into `t1`(`a`) values (GeomFromWKB(@v));
set @v=unhex(concat('01','01000000',lpad(conv(abs(-58),10,16),16,'0'),lpad(conv(abs(87),10,16),16,'0')));
insert ignore into `t1`(`a`) values (GeomFromWKB(@v));
set @v=unhex(concat('01','01000000',lpad(conv(abs(-128),10,16),16,'0'),lpad(conv(abs(12),10,16),16,'0')));
insert ignore into `t1`(`a`) values (GeomFromWKB(@v));
set @v=unhex(concat('01','01000000',lpad(conv(abs(-53),10,16),16,'0'),lpad(conv(abs(112),10,16),16,'0')));
insert ignore into `t1`(`a`) values (GeomFromWKB(@v));
set @v=unhex(concat('01','01000000',lpad(conv(abs(25),10,16),16,'0'),lpad(conv(abs(-118),10,16),16,'0')));
insert ignore into `t1`(`a`) values (GeomFromWKB(@v));
set @v=unhex(concat('01','01000000',lpad(conv(abs(-63),10,16),16,'0'),lpad(conv(abs(-113),10,16),16,'0')));
insert ignore into `t1`(`a`) values (GeomFromWKB(@v));
set @v=unhex(concat('01','01000000',lpad(conv(abs(-98),10,16),16,'0'),lpad(conv(abs(38),10,16),16,'0')));
insert ignore into `t1`(`a`) values (GeomFromWKB(@v));
set @v=unhex(concat('01','01000000',lpad(conv(abs(-9),10,16),16,'0'),lpad(conv(abs(7),10,16),16,'0')));
insert ignore into `t1`(`a`) values (GeomFromWKB(@v));
set @v=unhex(concat('01','01000000',lpad(conv(abs(-53),10,16),16,'0'),lpad(conv(abs(58),10,16),16,'0')));
insert ignore into `t1`(`a`) values (GeomFromWKB(@v));
set @v=unhex(concat('01','01000000',lpad(conv(abs(7),10,16),16,'0'),lpad(conv(abs(-82),10,16),16,'0')));
insert ignore into `t1`(`a`) values (GeomFromWKB(@v));
set @v=unhex(concat('01','01000000',lpad(conv(abs(-91),10,16),16,'0'),lpad(conv(abs(-8),10,16),16,'0')));
insert ignore into `t1`(`a`) values (GeomFromWKB(@v));
set @v=unhex(concat('01','01000000',lpad(conv(abs(13),10,16),16,'0'),lpad(conv(abs(-68),10,16),16,'0')));
insert ignore into `t1`(`a`) values (GeomFromWKB(@v));
set @v=unhex(concat('01','01000000',lpad(conv(abs(-13),10,16),16,'0'),lpad(conv(abs(117),10,16),16,'0')));
insert ignore into `t1`(`a`) values (GeomFromWKB(@v));
set @v=unhex(concat('01','01000000',lpad(conv(abs(8),10,16),16,'0'),lpad(conv(abs(37),10,16),16,'0')));
insert ignore into `t1`(`a`) values (GeomFromWKB(@v));
set @v=unhex(concat('01','01000000',lpad(conv(abs(-128),10,16),16,'0'),lpad(conv(abs(56),10,16),16,'0')));
insert ignore into `t1`(`a`) values (GeomFromWKB(@v));
set @v=unhex(concat('01','01000000',lpad(conv(abs(-98),10,16),16,'0'),lpad(conv(abs(-31),10,16),16,'0')));
insert ignore into `t1`(`a`) values (GeomFromWKB(@v));
set @v=unhex(concat('01','01000000',lpad(conv(abs(-94),10,16),16,'0'),lpad(conv(abs(-8),10,16),16,'0')));
insert ignore into `t1`(`a`) values (GeomFromWKB(@v));
set @v=unhex(concat('01','01000000',lpad(conv(abs(-8),10,16),16,'0'),lpad(conv(abs(-47),10,16),16,'0')));
insert ignore into `t1`(`a`) values (GeomFromWKB(@v));
set @v=unhex(concat('01','01000000',lpad(conv(abs(-113),10,16),16,'0'),lpad(conv(abs(57),10,16),16,'0')));
insert ignore into `t1`(`a`) values (GeomFromWKB(@v));
set @v=unhex(concat('01','01000000',lpad(conv(abs(62),10,16),16,'0'),lpad(conv(abs(-53),10,16),16,'0')));
insert ignore into `t1`(`a`) values (GeomFromWKB(@v));
set @v=unhex(concat('01','01000000',lpad(conv(abs(-53),10,16),16,'0'),lpad(conv(abs(-26),10,16),16,'0')));
insert ignore into `t1`(`a`) values (GeomFromWKB(@v));
set @v=unhex(concat('01','01000000',lpad(conv(abs(37),10,16),16,'0'),lpad(conv(abs(-104),10,16),16,'0')));
insert ignore into `t1`(`a`) values (GeomFromWKB(@v));
set @v=unhex(concat('01','01000000',lpad(conv(abs(-2),10,16),16,'0'),lpad(conv(abs(31),10,16),16,'0')));
insert ignore into `t1`(`a`) values (GeomFromWKB(@v));
set @v=unhex(concat('01','01000000',lpad(conv(abs(-124),10,16),16,'0'),lpad(conv(abs(27),10,16),16,'0')));
insert ignore into `t1`(`a`) values (GeomFromWKB(@v));
check table t1 extended;
Suggested fix:
.