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

Assertion `0' fails in Field_null::can_optimize_keypart_ref when number of NULLs in IN list reaches in_predicate_conversion_threshold

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 10.3
    • 10.3.5
    • Optimizer
    • None

    Description

      Note: same principle as in MDEV-14835, but different case and different presentation, so filing separately just in case.

      SET in_predicate_conversion_threshold= 5;
       
      CREATE TABLE t1 (i INT);
      SELECT * from t1 WHERE i IN (NULL, NULL, NULL, NULL, NULL);
      

      10.3 8ce53849db04e0c42da7fa3df95545017e12584a

      mysqld: /data/src/bb-10.3-release/sql/field.h:2375: virtual bool Field_null::can_optimize_keypart_ref(const Item_bool_func*, const Item*) const: Assertion `0' failed.
      180114 23:29:47 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007fcd866ffee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
      #8  0x000055e24a040b26 in Field_null::can_optimize_keypart_ref (this=0x7fcd70070ed8, cond=0x7fcd70019d70, item=0x7fcd700154c8) at /data/src/bb-10.3-release/sql/field.h:2375
      #9  0x000055e24a03f385 in Field::can_optimize_hash_join (this=0x7fcd70070ed8, cond=0x7fcd70019d70, item=0x7fcd700154c8) at /data/src/bb-10.3-release/sql/field.h:1543
      #10 0x000055e249dbc7d5 in add_key_part (keyuse_array=0x7fcd70015ec0, key_field=0x7fcd7001a2d0) at /data/src/bb-10.3-release/sql/sql_select.cc:5944
      #11 0x000055e249dbd8ee in update_ref_and_keys (thd=0x7fcd70000b00, keyuse=0x7fcd70015ec0, join_tab=0x7fcd70148ad8, tables=2, cond=0x7fcd70019d70, normal_tables=18446744073709551615, select_lex=0x7fcd70004fe8, sargables=0x7fcd8096c968) at /data/src/bb-10.3-release/sql/sql_select.cc:6285
      #12 0x000055e249db8028 in make_join_statistics (join=0x7fcd70015bd0, tables_list=..., keyuse_array=0x7fcd70015ec0) at /data/src/bb-10.3-release/sql/sql_select.cc:4540
      #13 0x000055e249daef95 in JOIN::optimize_inner (this=0x7fcd70015bd0) at /data/src/bb-10.3-release/sql/sql_select.cc:1959
      #14 0x000055e249dad861 in JOIN::optimize (this=0x7fcd70015bd0) at /data/src/bb-10.3-release/sql/sql_select.cc:1544
      #15 0x000055e249db701c in mysql_select (thd=0x7fcd70000b00, tables=0x7fcd70014e78, wild_num=1, fields=..., conds=0x7fcd700158f0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7fcd70015bb0, unit=0x7fcd70004890, select_lex=0x7fcd70004fe8) at /data/src/bb-10.3-release/sql/sql_select.cc:4236
      #16 0x000055e249da900a in handle_select (thd=0x7fcd70000b00, lex=0x7fcd700047c8, result=0x7fcd70015bb0, setup_tables_done_option=0) at /data/src/bb-10.3-release/sql/sql_select.cc:379
      #17 0x000055e249d74136 in execute_sqlcom_select (thd=0x7fcd70000b00, all_tables=0x7fcd70014e78) at /data/src/bb-10.3-release/sql/sql_parse.cc:6524
      #18 0x000055e249d6a820 in mysql_execute_command (thd=0x7fcd70000b00) at /data/src/bb-10.3-release/sql/sql_parse.cc:3745
      #19 0x000055e249d77a8a in mysql_parse (thd=0x7fcd70000b00, rawbuf=0x7fcd70014c38 "SELECT * from t1 WHERE i IN (NULL, NULL, NULL, NULL, NULL)", length=58, parser_state=0x7fcd8096e5f0, is_com_multi=false, is_next_command=false) at /data/src/bb-10.3-release/sql/sql_parse.cc:7981
      #20 0x000055e249d652cf in dispatch_command (command=COM_QUERY, thd=0x7fcd70000b00, packet=0x7fcd7000b141 "SELECT * from t1 WHERE i IN (NULL, NULL, NULL, NULL, NULL)", packet_length=58, is_com_multi=false, is_next_command=false) at /data/src/bb-10.3-release/sql/sql_parse.cc:1826
      #21 0x000055e249d63d03 in do_command (thd=0x7fcd70000b00) at /data/src/bb-10.3-release/sql/sql_parse.cc:1370
      #22 0x000055e249ecb044 in do_handle_one_connection (connect=0x55e24c93d190) at /data/src/bb-10.3-release/sql/sql_connect.cc:1401
      #23 0x000055e249ecadd1 in handle_one_connection (arg=0x55e24c93d190) at /data/src/bb-10.3-release/sql/sql_connect.cc:1307
      #24 0x000055e24a368b98 in pfs_spawn_thread (arg=0x55e24ca00670) at /data/src/bb-10.3-release/storage/perfschema/pfs.cc:1863
      #25 0x00007fcd883d6494 in start_thread (arg=0x7fcd8096f700) at pthread_create.c:333
      #26 0x00007fcd867bc93f in clone () from /lib/x86_64-linux-gnu/libc.so.6
      

      Attachments

        Issue Links

          Activity

            People

              igor Igor Babaev
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

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