We're updating the issue view to help you get more done. 

Server crashes in calculate_cond_selectivity_for_table with optimizer_use_condition_selectivity>=3

Description

1 2 3 4 5 6 7 8 9 10 11 12 SET use_stat_tables=PREFERABLY; SET optimizer_use_condition_selectivity=3; CREATE TABLE t1 (a INT) ENGINE=MyISAM; INSERT INTO t1 VALUES (10); CREATE TABLE t2 (id INT, flag CHAR(1), INDEX(id)) ENGINE=MyISAM; INSERT INTO t2 VALUES (100,'0'),(101,'1'); ANALYZE TABLE t1, t2; SELECT * FROM t1, t2 WHERE id = a AND ( a = 16 OR flag AND a != 6 );
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 #2 0x0000000000850f69 in handle_fatal_signal (sig=11) at 10.0/sql/signal_handler.cc:262 #3 <signal handler called> #4 0x0000000000961e6a in calculate_cond_selectivity_for_table (thd=0x7fb4adb3d070, table=0x7fb4aaca2470, cond=0x7fb4aaf93bb8) at 10.0/sql/opt_range.cc:3473 #5 0x00000000006aa171 in make_join_statistics (join=0x7fb4aaf4e088, tables_list=..., conds=0x7fb4aaf93bb8, keyuse_array=0x7fb4aaf4e390) at 10.0/sql/sql_select.cc:3934 #6 0x00000000006a135a in JOIN::optimize_inner (this=0x7fb4aaf4e088) at 10.0/sql/sql_select.cc:1327 #7 0x00000000006a0318 in JOIN::optimize (this=0x7fb4aaf4e088) at 10.0/sql/sql_select.cc:1013 #8 0x00000000006a7e83 in mysql_select (thd=0x7fb4adb3d070, rref_pointer_array=0x7fb4adb416a0, tables=0x7fb4aaf922d0, wild_num=1, fields=..., conds=0x7fb4aaf93bb8, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7fb4aaf93da0, unit=0x7fb4adb40d48, select_lex=0x7fb4adb41428) at 10.0/sql/sql_select.cc:3278 #9 0x000000000069e66f in handle_select (thd=0x7fb4adb3d070, lex=0x7fb4adb40c88, result=0x7fb4aaf93da0, setup_tables_done_option=0) at 10.0/sql/sql_select.cc:372 #10 0x0000000000673721 in execute_sqlcom_select (thd=0x7fb4adb3d070, all_tables=0x7fb4aaf922d0) at 10.0/sql/sql_parse.cc:5301 #11 0x000000000066bacc in mysql_execute_command (thd=0x7fb4adb3d070) at 10.0/sql/sql_parse.cc:2587 #12 0x0000000000675eab in mysql_parse (thd=0x7fb4adb3d070, rawbuf=0x7fb4aaf92088 "SELECT * FROM t1, t2 WHERE id = a AND ( a = 16 OR flag AND a != 6 )", length=67, parser_state=0x7fb4b5602630) at 10.0/sql/sql_parse.cc:6447 #13 0x0000000000668c79 in dispatch_command (command=COM_QUERY, thd=0x7fb4adb3d070, packet=0x7fb4adb33071 "SELECT * FROM t1, t2 WHERE id = a AND ( a = 16 OR flag AND a != 6 )", packet_length=67) at 10.0/sql/sql_parse.cc:1308 #14 0x000000000066801b in do_command (thd=0x7fb4adb3d070) at 10.0/sql/sql_parse.cc:1005 #15 0x0000000000782275 in do_handle_one_connection (thd_arg=0x7fb4adb3d070) at 10.0/sql/sql_connect.cc:1379 #16 0x0000000000781fc8 in handle_one_connection (arg=0x7fb4adb3d070) at 10.0/sql/sql_connect.cc:1293 #17 0x0000000000aa8661 in pfs_spawn_thread (arg=0x7fb4ace5c090) at 10.0/storage/perfschema/pfs.cc:1853 #18 0x00007fb4b5350b50 in start_thread (arg=<optimized out>) at pthread_create.c:304 #19 0x00007fb4b3e9fa7d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
1 2 3 revision-id: sergii@pisem.net-20140206153840-87zgw53lgkyvvdvp revno: 3992 branch-nick: 10.0

Environment

None

Status

Assignee

Igor Babaev

Reporter

Elena Stepanova

Fix versions

Affects versions

10.0.8

Priority

Major