Bug #56287 | mysql5.1.50 crash when using Partition datetime in sub in query | ||
---|---|---|---|
Submitted: | 26 Aug 2010 11:50 | Modified: | 17 Dec 2010 5:05 |
Reporter: | li mohao | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Partitions | Severity: | S1 (Critical) |
Version: | 5.1.50, 5.1.51-bzr ,5.5.6 | OS: | Linux (suse 10 x64 and centos 5.5 x64) |
Assigned to: | Mattias Jonsson | CPU Architecture: | Any |
Tags: | mysq 5.5.6, mysql 5.1.47, mysql5.1.50 innodb_plugin |
[26 Aug 2010 11:50]
li mohao
[26 Aug 2010 12:05]
Valeriy Kravchuk
Verified just as described with current 5.1.51 from bzr on Mac OS X: macbook-pro:5.1 openxs$ tail -60 var/macbook-pro.err where mysqld died. If you see no messages after this, something went terribly wrong... stack_bottom = 0xb077ef64 thread_stack 0x30000 0 mysqld 0x0058305e my_print_stacktrace + 44 1 mysqld 0x0010185c handle_segfault + 836 2 libSystem.B.dylib 0x940472bb _sigtramp + 43 3 ??? 0xffffffff 0x0 + 4294967295 4 ha_innodb_plugin.so 0x01f6866a 0x0 + 32933482 5 ha_innodb_plugin.so 0x01f68905 0x0 + 32934149 6 mysqld 0x0025d6c9 _ZN12ha_partition21handle_unordered_nextEPhb + 305 7 mysqld 0x00260baa _ZN12ha_partition15index_next_sameEPhPKhj + 298 8 mysqld 0x000a7cbc _ZN30subselect_indexsubquery_engine4execEv + 836 9 mysqld 0x000ad84f _ZN14Item_subselect4execEv + 129 10 mysqld 0x000ad878 _ZN14Item_subselect4execEv + 170 11 mysqld 0x000a6e3c _ZN17Item_in_subselect8val_boolEv + 100 12 mysqld 0x00031938 _ZN4Item15val_bool_resultEv + 24 13 mysqld 0x00066a5d _ZN17Item_in_optimizer7val_intEv + 585 14 mysqld 0x00189648 _Z11setup_orderP3THDPP4ItemP10TABLE_LISTR4ListIS1_ES8_P8st_order + 4682 15 mysqld 0x001899ed _Z10sub_selectP4JOINP13st_join_tableb + 293 16 mysqld 0x0019b40f _ZN4JOIN9join_freeEv + 1643 17 mysqld 0x001addf5 _ZN4JOIN4execEv + 9485 18 mysqld 0x001a8853 _Z12mysql_selectP3THDPPP4ItemP10TABLE_LISTjR4ListIS1_ES2_jP8st_orderSB_S2_SB_yP13select_resultP18st_select_lex_unitP13st_select_lex + 879 19 mysqld 0x001ae172 _Z13handle_selectP3THDP6st_lexP13select_resultm + 560 20 mysqld 0x0011330a _Z15update_precheckP3THDP10TABLE_LIST + 1150 21 mysqld 0x001159c6 _Z21mysql_execute_commandP3THD + 2936 22 mysqld 0x0011f46a _Z11mysql_parseP3THDPcjPPKc + 664 23 mysqld 0x00120275 _Z16dispatch_command19enum_server_commandP3THDPcj + 3133 24 mysqld 0x001216bc _Z10do_commandP3THD + 666 25 mysqld 0x0010bf0e handle_one_connection + 372 26 libSystem.B.dylib 0x9400c095 _pthread_start + 321 27 libSystem.B.dylib 0x9400bf52 thread_start + 34 Trying to get some variables. Some pointers may be invalid and cause the dump to abort... thd->query at 0x1074828 = SELECT count(*) FROM part_date3 p where c3 in (select c3 from part_date3 t where t.c3 < date '2011-04-26 19:19:44' and t.c3 > date '2011-04-26 19:18:44') thd->thread_id=1 thd->killed=NOT_KILLED The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains information that should help you find out what is causing the crash. 100826 15:02:18 mysqld_safe mysqld restarted 100826 15:02:18 [Warning] Setting lower_case_table_names=2 because file system for /Users/openxs/dbs/5.1/var/ is case insensitive 100826 15:02:18 [Warning] One can only use the --user switch if running as root 100826 15:02:18 [Note] Plugin 'FEDERATED' is disabled. 100826 15:02:18 [Note] Plugin 'ndbcluster' is disabled. InnoDB: The InnoDB memory heap is disabled InnoDB: Mutexes and rw_locks use GCC atomic builtins InnoDB: Compressed tables use zlib 1.2.3 100826 15:02:18 InnoDB: highest supported file format is Barracuda. InnoDB: The log sequence number in ibdata files does not match InnoDB: the log sequence number in the ib_logfiles! 100826 15:02:18 InnoDB: Database was not shut down normally! InnoDB: Starting crash recovery. InnoDB: Reading tablespace information from the .ibd files... InnoDB: Restoring possible half-written data pages from the doublewrite InnoDB: buffer... 100826 15:02:18 InnoDB Plugin 1.0.11 started; log sequence number 2585469 100826 15:02:18 [Note] Event Scheduler: Loaded 0 events 100826 15:02:19 [Note] /Users/openxs/dbs/5.1/libexec/mysqld: ready for connections. Version: '5.1.51-debug' socket: '/tmp/mysql.sock' port: 3306 Source distribution
[26 Aug 2010 12:09]
Valeriy Kravchuk
Same crash happens with builtin InnoDB.
[26 Aug 2010 12:13]
Valeriy Kravchuk
With MyISAM I've got assertion failure: Version: '5.1.51-debug' socket: '/tmp/mysql.sock' port: 3306 Source distribution Assertion failed: (inited==INDEX), function unknown function, file ha_myisam.cc, line 1727. EXPLAIN PARTITIONS resuls in this case: mysql> explain partitions SELECT count(*) FROM part_date3 p where c3 in (select c3 from part_date3 t where t.c3 < date '2011-04-26 19:19:44' and t.c3 > date '2011-04-26 19:18:44')\G *************************** 1. row *************************** id: 1 select_type: PRIMARY table: p partitions: p200912,p201001,p201002,p201003,p201004,p201005,p201006,p201007,p201008,p201009,p201010,p201011,p201012,p201101,p201102,p201103,p201104,p201105,p201106,p201107,p201108,p201109,p201110,p201111,p201112,p201912 type: index possible_keys: NULL key: partidx key_len: 8 ref: NULL rows: 13000 Extra: Using where; Using index *************************** 2. row *************************** id: 2 select_type: DEPENDENT SUBQUERY table: t partitions: p200912,p201104 type: index_subquery possible_keys: partidx key: partidx key_len: 8 ref: func rows: 71 Extra: Using index; Using where 2 rows in set (0.00 sec)
[26 Aug 2010 14:16]
li mohao
not only the PARTITION tables the normal table has the same bug create table CREATE TABLE part_date4 ( c1 bigint(20) unsigned NOT NULL AUTO_INCREMENT, c2 varchar(40) not null default '', c3 datetime not NULL, PRIMARY KEY (c1,c3), KEY partidx(c3)) ENGINE=InnoDB DEFAULT CHARSET=utf8 ; load data DELIMITER $$ DROP PROCEDURE IF EXISTS load_data4 $$ CREATE PROCEDURE load_data4() BEGIN declare v int default 0; while v < 1000 do insert into part_date4(c2,c3) values (uuid(),TIMESTAMPADD(month,-4,current_timestamp)); insert into part_date4(c2,c3) values (uuid(),TIMESTAMPADD(month,-3,current_timestamp)); insert into part_date4(c2,c3) values (uuid(),TIMESTAMPADD(month,-2,current_timestamp)); insert into part_date4(c2,c3) values (uuid(),TIMESTAMPADD(month,-1,current_timestamp)); insert into part_date4(c2,c3) values (uuid(),TIMESTAMPADD(month,0,current_timestamp)); insert into part_date4(c2,c3) values (uuid(),TIMESTAMPADD(month,1,current_timestamp)); insert into part_date4(c2,c3) values (uuid(),TIMESTAMPADD(month,2,current_timestamp)); insert into part_date4(c2,c3) values (uuid(),TIMESTAMPADD(month,3,current_timestamp)); insert into part_date4(c2,c3) values (uuid(),TIMESTAMPADD(month,4,current_timestamp)); insert into part_date4(c2,c3) values (uuid(),TIMESTAMPADD(month,5,current_timestamp)); insert into part_date4(c2,c3) values (uuid(),TIMESTAMPADD(month,6,current_timestamp)); insert into part_date4(c2,c3) values (uuid(),TIMESTAMPADD(month,7,current_timestamp)); insert into part_date4(c2,c3) values (uuid(),TIMESTAMPADD(month,8,current_timestamp)); set v = v + 1; end while; END $$ DELIMITER ; when exec query SELECT count(*) FROM part_date3 p where c3 in (select c3 from part_date3 t where t.c3 < date '2011-04-26 19:27:50' and t.c3 > date '2011-04-26 19:26:50') ; server crashed also crash log 100826 22:08:04 - 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=16777216 read_buffer_size=262144 max_used_connections=3 max_threads=600 threads_connected=1 It is possible that mysqld could use up to key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 483390 K bytes of memory Hope that's ok; if not, decrease some variables in the equation. thd: 0x157d2e0 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 = 0x4708f180 thread_stack 0x40000 /opt/xtradb/libexec/mysqld(my_print_stacktrace+0x33)[0x890c03] /opt/xtradb/libexec/mysqld(handle_segfault+0x340)[0x5dda90] /lib64/libpthread.so.0[0x2ba3f52a9c00] /opt/xtradb/libexec/mysqld(_ZN12ha_partition19handle_ordered_nextEPhb+0x36)[0x6d0896] /opt/xtradb/libexec/mysqld(_ZN30subselect_indexsubquery_engine4execEv+0x134)[0x5a0584] /opt/xtradb/libexec/mysqld(_ZN14Item_subselect4execEv+0x32)[0x59e012] /opt/xtradb/libexec/mysqld(_ZN14Item_subselect4execEv+0x58)[0x59e038] /opt/xtradb/libexec/mysqld(_ZN17Item_in_subselect8val_boolEv+0x11)[0x59e5b1] /opt/xtradb/libexec/mysqld(_ZN4Item15val_bool_resultEv+0xd)[0x542b3d] /opt/xtradb/libexec/mysqld(_ZN17Item_in_optimizer7val_intEv+0x158)[0x56a208] /opt/xtradb/libexec/mysqld[0x63f60d] /opt/xtradb/libexec/mysqld(_Z10sub_selectP4JOINP13st_join_tableb+0xb6)[0x648da6] /opt/xtradb/libexec/mysqld[0x651e8a] /opt/xtradb/libexec/mysqld(_ZN4JOIN4execEv+0x95c)[0x65ebdc] /opt/xtradb/libexec/mysqld(_Z12mysql_selectP3THDPPP4ItemP10TABLE_LISTjR4ListIS1_ES2_jP8st_orderSB_S2_SB_yP13select_resultP18st_select_lex_unitP13st_select_lex+0x17b)[0x66073b] /opt/xtradb/libexec/mysqld(_Z13handle_selectP3THDP6st_lexP13select_resultm+0x169)[0x661039] /opt/xtradb/libexec/mysqld[0x5e93ee] /opt/xtradb/libexec/mysqld(_Z21mysql_execute_commandP3THD+0x3afa)[0x5ef8da] /opt/xtradb/libexec/mysqld(_Z11mysql_parseP3THDPcjPPKc+0x2b9)[0x5f2619] /opt/xtradb/libexec/mysqld(_Z16dispatch_command19enum_server_commandP3THDPcj+0xa7d)[0x5f309d] /opt/xtradb/libexec/mysqld(_Z10do_commandP3THD+0xe6)[0x5f3d26] /opt/xtradb/libexec/mysqld(handle_one_connection+0x747)[0x5e5e27] /lib64/libpthread.so.0[0x2ba3f52a2143] /lib64/libc.so.6(__clone+0x6d)[0x2ba3f591e8cd] Trying to get some variables. Some pointers may be invalid and cause the dump to abort... thd->query at 0x1629280 = SELECT count(*) FROM part_date3 p where c3 in (select c3 from part_date3 t where t.c3 < date '2011-04-26 19:27:50' and t.c3 > date '2011-04-26 19:26:50') thd->thread_id=4 thd->killed=NOT_KILLED ====================== this is big bug.
[26 Aug 2010 14:23]
li mohao
I am sorry query normal table part_date4 SELECT count(*) FROM part_date4 p where c3 in (select c3 from part_date4 t where t.c3 < date '2011-04-26 19:27:50' and t.c3 > date '2011-04-26 19:26:50') ; not crashed
[26 Aug 2010 14:23]
li mohao
I am sorry query normal table part_date4 SELECT count(*) FROM part_date4 p where c3 in (select c3 from part_date4 t where t.c3 < date '2011-04-26 19:27:50' and t.c3 > date '2011-04-26 19:26:50') ; not crashed
[20 Sep 2010 9:59]
li mohao
I am test with mysql 5.5.6 The Server crashed also.
[30 Sep 2010 10:04]
Mattias Jonsson
Mikael approved it.
[6 Nov 2010 11:19]
Jon Stephens
Already documented in the 5.1.53 and 5.5.8 changelogs -- waiting for push to mysql-trunk to close. (Previously set Closed status in error, should have been Needs Merge.)
[18 Nov 2010 15:54]
Bugs System
Pushed into mysql-5.1 5.1.54 (revid:build@mysql.com-20101118153531-693taxtxyxpt037i) (version source revid:build@mysql.com-20101118153531-693taxtxyxpt037i) (merge vers: 5.1.54) (pib:21)
[5 Dec 2010 12:41]
Bugs System
Pushed into mysql-trunk 5.6.1 (revid:alexander.nozdrin@oracle.com-20101205122447-6x94l4fmslpbttxj) (version source revid:alexander.nozdrin@oracle.com-20101205122447-6x94l4fmslpbttxj) (merge vers: 5.6.1) (pib:23)
[16 Dec 2010 22:30]
Bugs System
Pushed into mysql-5.5 5.5.9 (revid:jonathan.perkin@oracle.com-20101216101358-fyzr1epq95a3yett) (version source revid:jonathan.perkin@oracle.com-20101216101358-fyzr1epq95a3yett) (merge vers: 5.5.9) (pib:24)
[17 Dec 2010 5:05]
Jon Stephens
Since I've already written the changelog entry, I've set this to Closed to clear out my queue a bit. Please set back to Documenting when removing the Private flag so I'll know to publish the entry, Thanks!
[27 May 2011 12:56]
Mats Kindahl
Is there any reason to keep the private flag on this one? It was committed and pushed almost half a year ago.