Uploaded image for project: 'Percona Server for MySQL'
  1. Percona Server for MySQL
  2. PS-6069

"keys >= 0.0" assertion

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: On Hold
    • Priority: Medium
    • Resolution: Unresolved
    • Affects Version/s: 5.7.x
    • Fix Version/s: None
    • Component/s: MyRocks
    • Labels:
      None

      Description

      sql:

      # mysqld options required for replay: --plugin-load-add=RocksDB=ha_rocksdb.so
      CREATE DATABASE test;
      USE test;
      CREATE TABLE t1(a CHAR (128),b varchar(128) character set utf8,c varchar(128) character set utf8,d varchar(128) character set utf8,PRIMARY KEY (a,b,c,d)) ENGINE=RocksDB;
      insert into t1 values(0,0,5781,0);
      create trigger trg2 before insert on t1 for each row set @a:=1;
      SELECT DISTINCT a FROM t1;
      

      gdb:

      Core was generated by `/sdc/PS071119-percona-server-5.7.28-31-linux-x86_64-debug/bin/mysqld --no-defau'.
      Program terminated with signal 6, Aborted.
      #0  0x00007f60b3bdea61 in __pthread_kill (threadid=<optimized out>, signo=6) at ../nptl/sysdeps/unix/sysv/linux/pthread_kill.c:59
      59        val = INTERNAL_SYSCALL (tgkill, err, 3, THREAD_GETMEM (THREAD_SELF, pid),
      (gdb) bt
      +bt
      #0  0x00007f60b3bdea61 in __pthread_kill (threadid=<optimized out>, signo=6) at ../nptl/sysdeps/unix/sysv/linux/pthread_kill.c:59
      #1  0x000000000191dbc2 in my_write_core (sig=6) at /sdc/release-5.7.28-31_dbg/mysys/stacktrace.c:261
      #2  0x000000000169474b in handle_fatal_signal (sig=6) at /sdc/release-5.7.28-31_dbg/sql/signal_handler.cc:230
      #3  <signal handler called>
      #4  0x00007f60b1ce0337 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:55
      #5  0x00007f60b1ce1a28 in __GI_abort () at abort.c:90
      #6  0x00007f60b1cd9156 in __assert_fail_base (fmt=0x7f60b1e34be0 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x1ec2011 "keys >= 0.0", file=file@entry=0x1ec1fc8 "/sdc/release-5.7.28-31_dbg/sql/opt_costmodel.h", line=line@entry=294, function=function@entry=0x1ec72c0 <Cost_model_table::key_compare_cost(double) const::__PRETTY_FUNCTION__> "double Cost_model_table::key_compare_cost(double) const") at assert.c:92
      #7  0x00007f60b1cd9202 in __GI___assert_fail (assertion=0x1ec2011 "keys >= 0.0", file=0x1ec1fc8 "/sdc/release-5.7.28-31_dbg/sql/opt_costmodel.h", line=294, function=0x1ec72c0 <Cost_model_table::key_compare_cost(double) const::__PRETTY_FUNCTION__> "double Cost_model_table::key_compare_cost(double) const") at assert.c:101
      #8  0x0000000000f3dd90 in Cost_model_table::key_compare_cost (this=0x7f6068c56f78, keys=-nan(0x8000000000000)) at /sdc/release-5.7.28-31_dbg/sql/opt_costmodel.h:294
      #9  0x00000000017b0e0b in cost_group_min_max (table=0x7f6068c56620, 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=0x7f60b41c8790, records=0x7f60b41c94a8) at /sdc/release-5.7.28-31_dbg/sql/opt_range.cc:13413
      #10 0x00000000017af110 in get_best_group_min_max (param=0x7f60b41ca4f0, tree=0x0, cost_est=0x7f60b41ca3d0) at /sdc/release-5.7.28-31_dbg/sql/opt_range.cc:12580
      #11 0x0000000001799a92 in test_quick_select (thd=0x7f6068c19000, keys_to_use=..., prev_tables=0, limit=18446744073709551615, force_quick_range=false, interesting_order=st_order::ORDER_NOT_RELEVANT, tab=0x7f6068e709b0, cond=0x0, needed_reg=0x7f6068e709f0, quick=0x7f60b41cc8d8, ignore_table_scan=false) at /sdc/release-5.7.28-31_dbg/sql/opt_range.cc:3068
      #12 0x000000000152a475 in get_quick_record_count (thd=0x7f6068c19000, tab=0x7f6068e709b0, limit=18446744073709551615) at /sdc/release-5.7.28-31_dbg/sql/sql_optimizer.cc:6013
      #13 0x0000000001529b62 in JOIN::estimate_rowcount (this=0x7f6068e705c0) at /sdc/release-5.7.28-31_dbg/sql/sql_optimizer.cc:5760
      #14 0x0000000001527fa5 in JOIN::make_join_plan (this=0x7f6068e705c0) at /sdc/release-5.7.28-31_dbg/sql/sql_optimizer.cc:5117
      #15 0x000000000151c756 in JOIN::optimize (this=0x7f6068e705c0) at /sdc/release-5.7.28-31_dbg/sql/sql_optimizer.cc:394
      #16 0x00000000015975a7 in st_select_lex::optimize (this=0x7f6068c27070, thd=0x7f6068c19000) at /sdc/release-5.7.28-31_dbg/sql/sql_select.cc:1018
      #17 0x0000000001595cda in handle_query (thd=0x7f6068c19000, lex=0x7f6068c1b6b0, result=0x7f6068c28f30, added_options=0, removed_options=0) at /sdc/release-5.7.28-31_dbg/sql/sql_select.cc:172
      #18 0x000000000154998b in execute_sqlcom_select (thd=0x7f6068c19000, all_tables=0x7f6068c27e20) at /sdc/release-5.7.28-31_dbg/sql/sql_parse.cc:5490
      #19 0x000000000154297d in mysql_execute_command (thd=0x7f6068c19000, first_level=true) at /sdc/release-5.7.28-31_dbg/sql/sql_parse.cc:3016
      #20 0x000000000154a918 in mysql_parse (thd=0x7f6068c19000, parser_state=0x7f60b41ce440, update_userstat=false) at /sdc/release-5.7.28-31_dbg/sql/sql_parse.cc:5927
      #21 0x000000000153f2a2 in dispatch_command (thd=0x7f6068c19000, com_data=0x7f60b41cec70, command=COM_QUERY) at /sdc/release-5.7.28-31_dbg/sql/sql_parse.cc:1539
      #22 0x000000000153e0c3 in do_command (thd=0x7f6068c19000) at /sdc/release-5.7.28-31_dbg/sql/sql_parse.cc:1060
      #23 0x00000000016710f2 in handle_connection (arg=0x7f6072fac1c0) at /sdc/release-5.7.28-31_dbg/sql/conn_handler/connection_handler_per_thread.cc:325
      #24 0x00000000019418ae in pfs_spawn_thread (arg=0x7f60afc1a120) at /sdc/release-5.7.28-31_dbg/storage/perfschema/pfs.cc:2198
      #25 0x00007f60b3bd9e65 in start_thread (arg=0x7f60b41cf700) at pthread_create.c:307
      #26 0x00007f60b1da888d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
      

      I'm able to reproduce it on debug build for 5.7.28-31. Release build doesn't crash.

      Looks similar to: PS-5090 and PS-4207.

        Smart Checklist

          Attachments

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              hrvoje.matijakovic Hrvoje Matijakovic
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated: