Error info :
mysqld: /qa/work/PS-5.7-trunk_dbg/sql/opt_costmodel.h:287: double Cost_model_table::key_compare_cost(double) const: Assert ion `keys >= 0.0' failed. 09:35:36 UTC - mysqld got signal 6 ;
GDB info
#0 __pthread_kill (threadid=<optimized out>, signo=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:62 #1 0x000000000199cc45 in my_write_core (sig=6) at /qa/work/PS-5.7-trunk_dbg/mysys/stacktrace.c:249 #2 0x0000000000f16a96 in handle_fatal_signal (sig=6) at /qa/work/PS-5.7-trunk_dbg/sql/signal_handler.cc:223 #3 <signal handler called> #4 0x00007f7862397428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54 #5 0x00007f786239902a in __GI_abort () at abort.c:89 #6 0x00007f786238fbd7 in __assert_fail_base (fmt=<optimized out>, assertion=assertion@entry=0x1f76a74 "keys >= 0.0", file=file@entry=0x1f76a38 "/qa/work/PS-5.7-trunk_dbg/sql/opt_costmodel.h", line=line@entry=287, function=function@entry=0x1f78660 <Cost_model_table::key_compare_cost(double) const::__PRETTY_FUNCTION__> "double Cost_model_table::key_compare_cost(double) const") at assert.c:92 #7 0x00007f786238fc82 in __GI___assert_fail (assertion=0x1f76a74 "keys >= 0.0", file=0x1f76a38 "/qa/work/PS-5.7-trunk_dbg/sql/opt_costmodel.h", line=287, function=0x1f78660 <Cost_model_table::key_compare_cost(double) const::__PRETTY_FUNCTION__> "double Cost_model_table::key_compare_cost(double) const") at assert.c:101 #8 0x0000000000fa4070 in Cost_model_table::key_compare_cost (this=0x7f781dd05378, keys=-nan(0x8000000000000)) at /qa/work/PS-5.7-trunk_dbg/sql/opt_costmodel.h:287 #9 0x0000000001833ecb in cost_group_min_max (table=0x7f781dd04a20, key=0, used_key_parts=1, group_key_parts=1, range_tree=0x0, index_tree=0x0, quick_prefix_records=0, have_min=false, have_max=false, cost_est=0x7f7864925a70, records=0x7f78649258e8) at /qa/work/PS-5.7-trunk_dbg/sql/opt_range.cc:13210 #10 0x0000000001832527 in get_best_group_min_max (param=0x7f78649276f0, tree=0x0, cost_est=0x7f7864927550) at /qa/work/PS-5.7-trunk_dbg/sql/opt_range.cc:12520 #11 0x000000000181b814 in test_quick_select (thd=0x7f781dc12000, keys_to_use=..., prev_tables=0, limit=18446744073709551615, force_quick_range=false, interesting_order=st_order::ORDER_NOT_RELEVANT, tab=0x7f781def6c50, cond=0x0, needed_reg=0x7f781def6c90, quick=0x7f7864929960) at /qa/work/PS-5.7-trunk_dbg/sql/opt_range.cc:3049 #12 0x0000000001618790 in get_quick_record_count (thd=0x7f781dc12000, tab=0x7f781def6c50, limit=18446744073709551615) at /qa/work/PS-5.7-trunk_dbg/sql/sql_optimizer.cc:5990 #13 0x0000000001617e03 in JOIN::estimate_rowcount (this=0x7f781def6860) at /qa/work/PS-5.7-trunk_dbg/sql/sql_optimizer.cc:5737 #14 0x00000000016160db in JOIN::make_join_plan (this=0x7f781def6860) at /qa/work/PS-5.7-trunk_dbg/sql/sql_optimizer.cc:5094 #15 0x0000000001609e40 in JOIN::optimize (this=0x7f781def6860) at /qa/work/PS-5.7-trunk_dbg/sql/sql_optimizer.cc:387 #16 0x000000000168d582 in st_select_lex::optimize (this=0x7f781def5080, thd=0x7f781dc12000) at /qa/work/PS-5.7-trunk_dbg/sql/sql_select.cc:1011 #17 0x000000000168b993 in handle_query (thd=0x7f781dc12000, lex=0x7f781dc145e8, result=0x7f781def66f0, added_options=0, removed_options=0) at /qa/work/PS-5.7-trunk_dbg/sql/sql_select.cc:165 #18 0x0000000001639584 in execute_sqlcom_select (thd=0x7f781dc12000, all_tables=0x7f781def5f88) at /qa/work/PS-5.7-trunk_dbg/sql/sql_parse.cc:5445 #19 0x0000000001631e32 in mysql_execute_command (thd=0x7f781dc12000, first_level=true) at /qa/work/PS-5.7-trunk_dbg/sql/sql_parse.cc:2942 #20 0x000000000163a694 in mysql_parse (thd=0x7f781dc12000, parser_state=0x7f786492b4a0) at /qa/work/PS-5.7-trunk_dbg/sql/sql_parse.cc:5891 #21 0x000000000162e623 in dispatch_command (thd=0x7f781dc12000, com_data=0x7f786492bda0, command=COM_QUERY) at /qa/work/PS-5.7-trunk_dbg/sql/sql_parse.cc:1493 #22 0x000000000162d3c4 in do_command (thd=0x7f781dc12000) at /qa/work/PS-5.7-trunk_dbg/sql/sql_parse.cc:1021 #23 0x000000000177fc04 in handle_connection (arg=0x7f781dc11040) at /qa/work/PS-5.7-trunk_dbg/sql/conn_handler/connection_handler_per_thread.cc:312 #24 0x00000000019c1d89 in pfs_spawn_thread (arg=0x7f7857be8820) at /qa/work/PS-5.7-trunk_dbg/storage/perfschema/pfs.cc:2188 #25 0x00007f7862fdb6ba in start_thread (arg=0x7f786492c700) at pthread_create.c:333 #26 0x00007f78624693dd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109
Testcase
# mysqld options required for replay: --plugin-load-add=tokudb=ha_tokudb.so --tokudb-check-jemalloc=0 --plugin-load-add=rocksdb=ha_rocksdb.so --rocksdb-block-size=12
CREATE TABLE t0(a INT,b INT,PRIMARY KEY(a)) engine=rocksdb;
INSERT INTO t0(a)VALUES (0.0);
SELECT t0.a FROM t0 GROUP BY t0.a;