MySQL crashes on long indexes
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
MySQL Server |
Unknown
|
Unknown
|
||||
Percona Server moved to https://jira.percona.com/projects/PS | Status tracked in 5.7 | |||||
5.1 |
Won't Fix
|
Undecided
|
Unassigned | |||
5.5 |
Fix Released
|
High
|
Unassigned | |||
5.6 |
Fix Released
|
High
|
Unassigned | |||
5.7 |
Fix Released
|
High
|
Unassigned |
Bug Description
We run Percona server 5.5.25a, but this bug is from upstream. I opened one on the main MySQL bug tracker (http://
*Description*:
MySQL 5.5.21 and greater crashes with a SIGABRT when InnoDB tables have index sizes close to the limit of 3072.
The bug seems to have occurred due to the changes in http://
*How to repeat*:
CREATE TABLE `crash_test` (
`column1` varchar(255) NOT NULL,
`column2` varchar(255) NOT NULL,
`column3` varchar(255) NOT NULL,
`column4` varchar(255) NOT NULL,
`column5` bigint(20) unsigned NOT NULL,
PRIMARY KEY (`column1`
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=
(Note the index length above does not exceed the InnoDB limit of 3072, because the VARCHAR length bytes are not included in that calculation)
INSERT INTO crash_test (column1, column2, column3, column4, column5) VALUES ("abc", "abc", "abc", "abc", 9);
INSERT INTO crash_test (column1, column2, column3, column4, column5) VALUES ("abc", "abc", "abc", "abc", 10);
SELECT * FROM crash_test WHERE column1 = 'abc' ORDER BY column5 DESC;
And MySQL has now crashed.
*Trimmed error log*:
02:20:51 UTC - mysqld got signal 6 ;
key_buffer_
read_buffer_
max_used_
max_threads=1500
thread_count=1
connection_count=1
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_
Hope that's ok; if not, decrease some variables in the equation.
Thread pointer: 0x34f23740
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...
stack_bottom = 48ed20d0 thread_stack 0x40000
/usr/sbin/
/usr/sbin/
/lib64/
/lib64/
/lib64/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/lib64/
/lib64/
*Workarounds*:
Use smaller indexes
Confirmed on PS 5.5.27.
Backtrace with intermediate backtraces:
Breakpoint 1, row_sel_ convert_ mysql_key_ to_innobase (tuple= 0x7ffff41c1cc0, buf=0x7fffb400f288 "", buf_len=3074, index=0x7ffff41 c18c0, key_ptr= 0x7fffc42edb88 "\003", key_len=767, trx=0x7ffff41c30c0) Vone/Percona- Server- 5.5.27- rel28.0/ storage/ innobase/ row/row0sel. c:2315 Vone/Percona- Server- 5.5.27- rel28.0/ storage/ innobase/ row/row0sel. c: No such file or directory. convert_ mysql_key_ to_innobase (tuple= 0x7ffff41c1cc0, buf=0x7fffb400f288 "", buf_len=3074, index=0x7ffff41 c18c0, key_ptr= 0x7fffc42edb88 "\003", key_len=767, trx=0x7ffff41c30c0) at /media/ Vone/Percona- Server- 5.5.27- rel28.0/ storage/ innobase/ row/row0sel. c:2315 :records_ in_range (this=0x7fffb40 0eea0, keynr=<optimized out>, min_key= 0x7fffc42ebcf0, max_key= 0x7fffc42ebd10) at /media/ Vone/Percona- Server- 5.5.27- rel28.0/ storage/ innobase/ handler/ ha_innodb. cc:8584 param@entry= 0x7fffc42eda30, idx=idx@entry=0, key_tree= key_tree@ entry=0x7fffb40 233c0, min_key= min_key@ entry=0x7fffc42 edb88 "\003", min_key_ flag=min_ key_flag@ entry=0, min_keypart= min_keypart@ entry=- 1, key=max_ key@entry= 0x7fffc42eea86 "\003", max_key_ flag=max_ key_flag@ entry=0, max_keypart= max_keypart@ entry=- 1) at /media/ Vone/Percona- Server- 5.5.27- rel28.0/ sql/opt_ range.cc: 7807 param@entry= 0x7fffc42eda30, idx=idx@entry=0, tree=0x7fffb402 33c0, update_ tbl_stats= update_ tbl_stats@ entry=true) at /media/ Vone/Percona- Server- 5.5.27- rel28.0/ sql/opt_ range.cc: 7578 scans_params (param= param@entry= 0x7fffc42eda30, tree=tree@ entry=0x7fffb40 22e78, index_read_ must_be_ used=index_ read_must_ be_used@ entry=false, update_ tbl_stats= update_ tbl_stats@ entry=true, read_time= read_time@ entry=1. 899999999999999 9, records= estimated_ records@ entry=0x7fffc42 ec008) at /media/ Vone/Percona- Server- 5.5.27- rel28.0/ sql/opt_ range.cc: 4966 :test_quick_ select (this=<optimized out>, thd=0x241d3c0, keys_to_use=..., prev_tables= <optimized out>, limit=<optimized out>, force_quick_ range=< optimized out>) at /media/ Vone/Percona- Server- 5.5.27- rel28.0/ sql/opt_ range.cc: 2322 record_ count (limit= 184467440737095 51615, keys=0x7fffb400 6148, table=0x7fffb40 0e5c0, select= 0x7fffb40064d8, thd=0x241d3c0) at /media/ Vone/Percona- Server- 5.5.27- rel28.0/ sql/sql_ select. cc:2641 statistics (join=join@ entry=0x7fffb40 20de0, tables_ arg=0x7fffb4004 e38, conds=0x7fffb40 05500, keyuse_ array=keyuse_ array@entry= 0x7fffb4022398) at /media/ Vone/Percona- Server- 5.5.27- rel28.0/ sql/sql_ select. cc:3090 entry=0x7fffb40 20de0) at /media/ Vone/Percona- Server- 5.5.27- rel28.0/ sql/sql_ select. cc:1082 entry=0x241d3c0 , rref_pointer_ array=rref_ pointer_ array@entry= 0x241f868, tables= 0x7fffb4004e38, wild_num=1, fields=..., conds=<optimized out>, og_num=1, order=0x7fffb40 05768, group=0x0, having=0x0, proc_param=0x0, options= select_ options@ entry=214774860 8, resul...
at /media/
2315 /media/
#0 row_sel_
#1 0x0000000000850bfa in ha_innobase:
#2 0x0000000000765726 in check_quick_keys (param=
max_
#3 0x0000000000765963 in check_quick_select (param=
#4 0x0000000000765bd5 in get_key_
estimated_
#5 0x000000000076f63d in SQL_SELECT:
#6 0x00000000005d06cd in get_quick_
#7 make_join_
#8 0x00000000005d3777 in JOIN::optimize (this=this@
#9 0x00000000005d6b47 in mysql_select (thd=thd@
select_