Bug #52717 | Assert in EXPLAIN SELECT with very particular combination with ANY and index | ||
---|---|---|---|
Submitted: | 9 Apr 2010 11:33 | Modified: | 12 Apr 2010 11:09 |
Reporter: | Bjørn Munch | Email Updates: | |
Status: | Duplicate | Impact on me: | |
Category: | MySQL Server: Optimizer | Severity: | S3 (Non-critical) |
Version: | 5.6.99-M4 | OS: | Any |
Assigned to: | Assigned Account | CPU Architecture: | Any |
Tags: | explain any index, regression |
[9 Apr 2010 11:33]
Bjørn Munch
[9 Apr 2010 11:43]
Valeriy Kravchuk
Does not crash with 5.5.4-m3 (mysql-trunk) tree.
[9 Apr 2010 11:46]
Bjørn Munch
I think this only happens with debug builds.
[9 Apr 2010 11:50]
Valeriy Kravchuk
Crashes on 32-bit Ubuntu 8.04: openxs@ubuntu:/home2/openxs/dbs/next-mr$ bin/mysql --no-defaults -uroot test Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 2 Server version: 5.6.99-m4-debug Source distribution Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. This software comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to modify and redistribute it under the GPL v2 license Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> CREATE TABLE t1 ( a int, b int ); Query OK, 0 rows affected (0.02 sec) mysql> INSERT INTO t1 VALUES (1,1),(2,2),(3,3); Query OK, 3 rows affected (0.00 sec) Records: 3 Duplicates: 0 Warnings: 0 mysql> ALTER TABLE t1 ADD INDEX (a); Query OK, 3 rows affected (0.00 sec) Records: 3 Duplicates: 0 Warnings: 0 mysql> EXPLAIN SELECT a FROM t1 WHERE (1,2) = ANY (SELECT a,2 FROM t1 WHERE b = 2); ERROR 2013 (HY000): Lost connection to MySQL server during query mysql> 100409 14:48:12 mysqld_safe Number of processes running now: 0 100409 14:48:12 mysqld_safe mysqld restarted mysql> exit Bye openxs@ubuntu:/home2/openxs/dbs/next-mr$ tail -100 var/ubuntu.err100409 ... 100409 14:47:47 InnoDB: mbminlen=4, mbmaxlen=4, type->mbminlen=0, type->mbmaxlen=4 mysqld: field.cc:3694: virtual int Field_long::store(longlong, bool): Assertion `!table || (!table->write_set || bitmap_is_set(table->write_set, field_index))' failed. 100409 14:48:11 - mysqld got signal 6 ; 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=8388608 read_buffer_size=131072 max_used_connections=1 max_threads=151 thread_count=1 connection_count=1 It is possible that mysqld could use up to key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 337841 K bytes of memory Hope that's ok; if not, decrease some variables in the equation. thd: 0x93ef208 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 = 0xa88583b0 thread_stack 0x30000 /home2/openxs/dbs/next-mr/libexec/mysqld(my_print_stacktrace+0x26)[0x8781d15] /home2/openxs/dbs/next-mr/libexec/mysqld(handle_segfault+0x2ee)[0x82c884e] [0xb779e420] /lib/tls/i686/cmov/libc.so.6(abort+0x101)[0xb75e0a01] /lib/tls/i686/cmov/libc.so.6(__assert_fail+0xee)[0xb75d810e] /home2/openxs/dbs/next-mr/libexec/mysqld(_ZN10Field_long5storeExb+0x7c)[0x82914ec] /home2/openxs/dbs/next-mr/libexec/mysqld[0x81faaab] /home2/openxs/dbs/next-mr/libexec/mysqld(_ZN8Item_int13save_in_fieldEP5Fieldb+0x59)[0x81fab0d] /home2/openxs/dbs/next-mr/libexec/mysqld(_ZN20store_key_const_item10copy_innerEv+0x48)[0x837743e] /home2/openxs/dbs/next-mr/libexec/mysqld(_ZN9store_key4copyEv+0x80)[0x827b218] /home2/openxs/dbs/next-mr/libexec/mysqld(_ZN31subselect_uniquesubquery_engine12copy_ref_keyEv+0x51)[0x82750a9] /home2/openxs/dbs/next-mr/libexec/mysqld(_ZN30subselect_indexsubquery_engine4execEv+0x91)[0x82754f3] /home2/openxs/dbs/next-mr/libexec/mysqld(_ZN14Item_subselect4execEv+0x8c)[0x827849a] /home2/openxs/dbs/next-mr/libexec/mysqld(_ZN14Item_subselect4execEv+0xb5)[0x82784c3] /home2/openxs/dbs/next-mr/libexec/mysqld(_ZN17Item_in_subselect8val_boolEv+0x50)[0x8274486] /home2/openxs/dbs/next-mr/libexec/mysqld(_ZN4Item15val_bool_resultEv+0x18)[0x82066b6] /home2/openxs/dbs/next-mr/libexec/mysqld(_ZN17Item_in_optimizer7val_intEv+0x231)[0x8238681] /home2/openxs/dbs/next-mr/libexec/mysqld[0x8360fda] /home2/openxs/dbs/next-mr/libexec/mysqld(_ZN4JOIN8optimizeEv+0x138b)[0x836e075] /home2/openxs/dbs/next-mr/libexec/mysqld(_Z12mysql_selectP3THDPPP4ItemP10TABLE_LISTjR4ListIS1_ES2_jP8st_orderSB_S2_SB_yP13select_resultP18st_select_lex_unitP13st_select_lex+0x283)[0x83713a9] /home2/openxs/dbs/next-mr/libexec/mysqld(_Z19mysql_explain_unionP3THDP18st_select_lex_unitP13select_result+0x362)[0x83718c4] /home2/openxs/dbs/next-mr/libexec/mysqld[0x82d9f37] /home2/openxs/dbs/next-mr/libexec/mysqld(_Z21mysql_execute_commandP3THD+0x9c1)[0x82dbf01] /home2/openxs/dbs/next-mr/libexec/mysqld(_Z11mysql_parseP3THDPKcjPS2_+0x229)[0x82e4151] /home2/openxs/dbs/next-mr/libexec/mysqld(_Z16dispatch_command19enum_server_commandP3THDPcj+0x9e0)[0x82e4cc6] /home2/openxs/dbs/next-mr/libexec/mysqld(_Z10do_commandP3THD+0x241)[0x82e6225] /home2/openxs/dbs/next-mr/libexec/mysqld(_Z24do_handle_one_connectionP3THD+0x15b)[0x82d3401] /home2/openxs/dbs/next-mr/libexec/mysqld(handle_one_connection+0x25)[0x82d34bf] /lib/tls/i686/cmov/libpthread.so.0[0xb777c4fb] /lib/tls/i686/cmov/libc.so.6(clone+0x5e)[0xb768ae5e] Trying to get some variables. Some pointers may be invalid and cause the dump to abort... thd->query at 0x9466890 = EXPLAIN SELECT a FROM t1 WHERE (1,2) = ANY (SELECT a,2 FROM t1 WHERE b = 2) thd->thread_id=2 thd->killed=NOT_KILLED ...
[9 Apr 2010 11:51]
MySQL Verification Team
Thank you for the bug report. C:\DBS>c:\dbs\5.5\bin\mysql -uroot --port=3540 --prompt="mysql 5.5 >" Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 2 Server version: 5.6.99-m4-Win X64-debug Source distribution Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. This software comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to modify and redistribute it under the GPL v2 license Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql 5.5 >use test Database changed mysql 5.5 >CREATE TABLE t1 ( a int, b int ); Query OK, 0 rows affected (0.04 sec) mysql 5.5 >INSERT INTO t1 VALUES (1,1),(2,2),(3,3); Query OK, 3 rows affected (0.00 sec) Records: 3 Duplicates: 0 Warnings: 0 mysql 5.5 >ALTER TABLE t1 ADD INDEX (a); Query OK, 3 rows affected (0.04 sec) Records: 3 Duplicates: 0 Warnings: 0 mysql 5.5 >EXPLAIN SELECT a FROM t1 WHERE (1,2) = ANY (SELECT a,2 FROM t1 WHERE b = 2); ERROR 2013 (HY000): Lost connection to MySQL server during query 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... 00000001405A9DA5 mysqld.exe!my_sigabrt_handler()[my_thr_init.c:519] 00000001406ADF71 mysqld.exe!raise()[winsig.c:597] 00000001406B7503 mysqld.exe!abort()[abort.c:78] 00000001406B104A mysqld.exe!_wassert()[assert.c:395] 0000000140230549 mysqld.exe!Field_long::store()[field.cc:3694] 000000014018C4DE mysqld.exe!save_int_value_in_field()[item.cc:5437] 000000014018C577 mysqld.exe!Item_int::save_in_field()[item.cc:5443] 0000000140291311 mysqld.exe!store_key_const_item::copy_inner()[sql_select.h:779] 0000000140290966 mysqld.exe!store_key::copy()[sql_select.h:674] 00000001402FF338 mysqld.exe!subselect_uniquesubquery_engine::copy_ref_key()[item_subselect.cc:2102] 00000001402FF880 mysqld.exe!subselect_indexsubquery_engine::exec()[item_subselect.cc:2309] 00000001402F865B mysqld.exe!Item_subselect::exec()[item_subselect.cc:265] 00000001402F868E mysqld.exe!Item_subselect::exec()[item_subselect.cc:270] 00000001402FA748 mysqld.exe!Item_in_subselect::val_bool()[item_subselect.cc:865] 000000014003E646 mysqld.exe!Item::val_bool_result()[item.h:832] 000000014005E0E1 mysqld.exe!Item_in_optimizer::val_int()[item_cmpfunc.cc:1835] 000000014026E3EE mysqld.exe!make_join_select()[sql_select.cc:6328] 000000014025E007 mysqld.exe!JOIN::optimize()[sql_select.cc:1147] 000000014026391C mysqld.exe!mysql_select()[sql_select.cc:2517] 000000014028DF10 mysqld.exe!mysql_explain_union()[sql_select.cc:16958] 00000001401AC531 mysqld.exe!execute_sqlcom_select()[sql_parse.cc:4681] 00000001401A4048 mysqld.exe!mysql_execute_command()[sql_parse.cc:2191] 00000001401AEDC7 mysqld.exe!mysql_parse()[sql_parse.cc:5735] 00000001401A184E mysqld.exe!dispatch_command()[sql_parse.cc:1026] 00000001401A0DF8 mysqld.exe!do_command()[sql_parse.cc:710] 0000000140084D8B mysqld.exe!do_handle_one_connection()[sql_connect.cc:1174] 0000000140084B87 mysqld.exe!handle_one_connection()[sql_connect.cc:1114] 00000001405A8C4B mysqld.exe!pthread_start()[my_winthread.c:62] 00000001406CAFE5 mysqld.exe!_callthreadstartex()[threadex.c:348] 00000001406CAFB4 mysqld.exe!_threadstartex()[threadex.c:331] 0000000077A9BE3D kernel32.dll!BaseThreadInitThunk() 0000000077CA6A51 ntdll.dll!RtlUserThreadStart() Trying to get some variables. Some pointers may be invalid and cause the dump to abort... thd->query at 000000000ADB42F0=EXPLAIN SELECT a FROM t1 WHERE (1,2) = ANY (SELECT a,2 FROM t1 WHERE b = 2) thd->thread_id=2 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.
[9 Apr 2010 12:01]
Bjørn Munch
Confirmed: could not reproduce on mysql-trunk in exact same environment and build flags
[9 Apr 2010 12:47]
Manyi Lu
Could this be a duplicate of BUG#52317?
[12 Apr 2010 6:01]
Tor Didriksen
bzrfind says # Revision jorgen.loland@sun.com-20100311102910-tsbh5nal1qz73fjd: test FAILED # Regression source: jorgen.loland@sun.com-20100311102910-tsbh5nal1qz73fjd jorgen.loland@sun.com-20100311102910-tsbh5nal1qz73fjd So, most likely a duplicate of Bug #52317 Assertion failing in Field_varstring::store () at field.cc:6833