Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-30097

Assertion `low == (int)buckets.size()-1 || field->key_cmp((uchar*)buckets[low+1].start_value.data(), lookup_val)> 0' failed in Histogram_json_hb::find_bucket

    XMLWordPrintable

Details

    • Bug
    • Status: Confirmed (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.8(EOL), 10.9(EOL), 10.10(EOL), 10.11, 11.0(EOL), 11.1(EOL), 11.2, 11.3(EOL), 11.4
    • 10.11, 11.2, 11.4
    • Optimizer

    Description

      SET NAMES utf8mb3;
      SET histogram_type= JSON_HB;
      CREATE TABLE t (f VARCHAR(30)) CHARSET=utf8mb3;
      INSERT INTO t VALUES ('foo'),("Настройка репликации\n");
      ANALYZE TABLE `t` PERSISTENT FOR ALL;
      SELECT * FROM t WHERE f LIKE 'f%';
       
      # Cleanup
      DROP TABLE t;
      

      10.8 c0439b17

      mariadbd: /src/sql/opt_histogram_json.cc:1197: int Histogram_json_hb::find_bucket(const Field*, const uchar*, int*): Assertion `low == (int)buckets.size()-1 || field->key_cmp((uchar*)buckets[low+1].start_value.data(), lookup_val)> 0' failed.
      221125 18:20:11 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007f45d11b3662 in __GI___assert_fail (assertion=0x55b28aef5c60 "low == (int)buckets.size()-1 || field->key_cmp((uchar*)buckets[low+1].start_value.data(), lookup_val)> 0", file=0x55b28aef4e20 "/src/sql/opt_histogram_json.cc", line=1197, function=0x55b28aef5b60 "int Histogram_json_hb::find_bucket(const Field*, const uchar*, int*)") at assert.c:101
      #8  0x000055b2892675b5 in Histogram_json_hb::find_bucket (this=0x60b000007680, field=0x61900008cbb0, lookup_val=0x621000092561 "Z", cmp=0x7f45c7bc8820) at /src/sql/opt_histogram_json.cc:1197
      #9  0x000055b2892661ad in Histogram_json_hb::range_selectivity (this=0x60b000007680, field=0x61900008cbb0, min_endp=0x7f45c7bc8a60, max_endp=0x7f45c7bc8a80, avg_sel=0.5) at /src/sql/opt_histogram_json.cc:993
      #10 0x000055b288f7b6af in get_column_range_cardinality (field=0x61900008cbb0, min_endp=0x7f45c7bc8a60, max_endp=0x7f45c7bc8a80, range_flag=0) at /src/sql/sql_statistics.cc:3914
      #11 0x000055b28898dbd5 in records_in_column_ranges (param=0x7f45c7bc9660, idx=0, tree=0x621000092788) at /src/sql/opt_range.cc:3281
      #12 0x000055b28898fc70 in calculate_cond_selectivity_for_table (thd=0x62b00007e218, table=0x61900008c598, cond=0x6290000e8200) at /src/sql/opt_range.cc:3564
      #13 0x000055b288e12beb in make_join_statistics (join=0x6290000e7db0, tables_list=..., keyuse_array=0x6290000e80d0) at /src/sql/sql_select.cc:5849
      #14 0x000055b288df089a in JOIN::optimize_inner (this=0x6290000e7db0) at /src/sql/sql_select.cc:2504
      #15 0x000055b288de9977 in JOIN::optimize (this=0x6290000e7db0) at /src/sql/sql_select.cc:1843
      #16 0x000055b288e0af76 in mysql_select (thd=0x62b00007e218, tables=0x6290000e68f8, fields=..., conds=0x6290000e7280, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x6290000e7d80, unit=0x62b000082630, select_lex=0x6290000e62e8) at /src/sql/sql_select.cc:5036
      #17 0x000055b288ddb725 in handle_select (thd=0x62b00007e218, lex=0x62b000082558, result=0x6290000e7d80, setup_tables_done_option=0) at /src/sql/sql_select.cc:553
      #18 0x000055b288d05c79 in execute_sqlcom_select (thd=0x62b00007e218, all_tables=0x6290000e68f8) at /src/sql/sql_parse.cc:6253
      #19 0x000055b288cf48b7 in mysql_execute_command (thd=0x62b00007e218, is_called_from_prepared_stmt=false) at /src/sql/sql_parse.cc:3944
      #20 0x000055b288d10a0d in mysql_parse (thd=0x62b00007e218, rawbuf=0x6290000e6238 "SELECT * FROM t WHERE f LIKE 'f%'", length=33, parser_state=0x7f45c7bcb990) at /src/sql/sql_parse.cc:8014
      #21 0x000055b288ce73b3 in dispatch_command (command=COM_QUERY, thd=0x62b00007e218, packet=0x62900025d219 "SELECT * FROM t WHERE f LIKE 'f%'", packet_length=33, blocking=true) at /src/sql/sql_parse.cc:1894
      #22 0x000055b288ce4186 in do_command (thd=0x62b00007e218, blocking=true) at /src/sql/sql_parse.cc:1407
      #23 0x000055b28917dd31 in do_handle_one_connection (connect=0x6080000026b8, put_in_cache=true) at /src/sql/sql_connect.cc:1415
      #24 0x000055b28917d6c7 in handle_one_connection (arg=0x608000002638) at /src/sql/sql_connect.cc:1317
      #25 0x000055b289d47fca in pfs_spawn_thread (arg=0x617000004d98) at /src/storage/perfschema/pfs.cc:2201
      #26 0x00007f45d1691ea7 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #27 0x00007f45d127eaef in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      No obvious problem on a non-debug build.

      Attachments

        Issue Links

          Activity

            People

              psergei Sergei Petrunia
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.