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

MSAN / Valgrind errors in Item_func_like::get_mm_leaf with temporal field

    XMLWordPrintable

Details

    Description

      Note: A fix for MDEV-32388 is already in the branch, and the test case from there no longer fails.

      CREATE TABLE t (f DATE);
      INSERT INTO t VALUES ('1978-08-27'),('1906-04-30');
      ANALYZE TABLE t PERSISTENT FOR ALL;
      SELECT * FROM t WHERE f LIKE '2023%';
       
      # Cleanup
      DROP TABLE t;
      

      10.6 4941ac9192394a1489f0bf01b6dd2ee5ec2906c9

      ==1828722==WARNING: MemorySanitizer: use-of-uninitialized-value
          #0 0x559bc07ef38c in Item_func_like::get_mm_leaf(RANGE_OPT_PARAM*, Field*, KEY_PART*, Item_func::Functype, Item*) /data/src/10.6-msan/sql/opt_range.cc:8760:9
          #1 0x559bc07db8b6 in Item_bool_func::get_mm_parts(RANGE_OPT_PARAM*, Field*, Item_func::Functype, Item*) /data/src/10.6-msan/sql/opt_range.cc:8661:18
          #2 0x559bc0843af3 in Item_func_like::get_func_mm_tree(RANGE_OPT_PARAM*, Field*, Item*) /data/src/10.6-msan/sql/item_cmpfunc.h:2875:5
          #3 0x559bc07e831c in Item_bool_func::get_full_func_mm_tree(RANGE_OPT_PARAM*, Item_field*, Item*) /data/src/10.6-msan/sql/opt_range.cc:8320:12
          #4 0x559bbf6934ed in Item_bool_func::get_full_func_mm_tree_for_args(RANGE_OPT_PARAM*, Item*, Item*) /data/src/10.6-msan/sql/item_cmpfunc.h:208:7
          #5 0x559bbf691070 in Item_bool_func2::get_mm_tree(RANGE_OPT_PARAM*, Item**) /data/src/10.6-msan/sql/item_cmpfunc.h:464:22
          #6 0x559bc02a6551 in Item_func_like::get_mm_tree(RANGE_OPT_PARAM*, Item**) /data/src/10.6-msan/sql/item_cmpfunc.cc:5902:22
          #7 0x559bc07c5754 in calculate_cond_selectivity_for_table(THD*, TABLE*, Item**) /data/src/10.6-msan/sql/opt_range.cc:3537:20
          #8 0x559bbf55c570 in make_join_statistics(JOIN*, List<TABLE_LIST>&, st_dynamic_array*) /data/src/10.6-msan/sql/sql_select.cc:5896:13
          #9 0x559bbf543314 in JOIN::optimize_inner() /data/src/10.6-msan/sql/sql_select.cc:2531:7
          #10 0x559bbf526ddc in JOIN::optimize() /data/src/10.6-msan/sql/sql_select.cc:1868:10
          #11 0x559bbf507ae0 in mysql_select(THD*, TABLE_LIST*, List<Item>&, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, unsigned long long, select_result*, st_select_lex_unit*, st_select_lex*) /data/src/10.6-msan/sql/sql_select.cc:5077:19
          #12 0x559bbf5066d6 in handle_select(THD*, LEX*, select_result*, unsigned long) /data/src/10.6-msan/sql/sql_select.cc:559:10
          #13 0x559bbf43bb3a in execute_sqlcom_select(THD*, TABLE_LIST*) /data/src/10.6-msan/sql/sql_parse.cc:6285:12
          #14 0x559bbf4157ee in mysql_execute_command(THD*, bool) /data/src/10.6-msan/sql/sql_parse.cc:3961:12
          #15 0x559bbf3fd24a in mysql_parse(THD*, char*, unsigned int, Parser_state*) /data/src/10.6-msan/sql/sql_parse.cc:8050:18
          #16 0x559bbf3f1790 in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool) /data/src/10.6-msan/sql/sql_parse.cc:1896:7
          #17 0x559bbf3ff640 in do_command(THD*, bool) /data/src/10.6-msan/sql/sql_parse.cc:1409:17
          #18 0x559bbfa2fe7f in do_handle_one_connection(CONNECT*, bool) /data/src/10.6-msan/sql/sql_connect.cc:1416:11
          #19 0x559bbfa2f465 in handle_one_connection /data/src/10.6-msan/sql/sql_connect.cc:1318:5
          #20 0x559bc0ea718a in pfs_spawn_thread /data/src/10.6-msan/storage/perfschema/pfs.cc:2201:3
          #21 0x7f3fb83b7fd3 in start_thread nptl/./nptl/pthread_create.c:442:8
          #22 0x7f3fb84385bb in clone3 misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
       
        Uninitialized value was created by an allocation of 'param' in the stack frame of function '_Z36calculate_cond_selectivity_for_tableP3THDP5TABLEPP4Item'
          #0 0x559bc07c1230 in calculate_cond_selectivity_for_table(THD*, TABLE*, Item**) /data/src/10.6-msan/sql/opt_range.cc:3363
       
      SUMMARY: MemorySanitizer: use-of-uninitialized-value /data/src/10.6-msan/sql/opt_range.cc:8760:9 in Item_func_like::get_mm_leaf(RANGE_OPT_PARAM*, Field*, KEY_PART*, Item_func::Functype, Item*)
      Exiting
      

      The failure started happening after this commit in 10.6:

      commit 4e9322e2ff25d638013e6e6cf051754084e2f16b
      Author:     Monty
      AuthorDate: Wed Sep 20 15:46:55 2023 +0300
      CommitDate: Tue Oct 3 08:25:31 2023 +030
       
          MDEV-32203 Raise notes when an index cannot be used on data type mismatch
      

      Attachments

        Issue Links

          Activity

            People

              monty Michael Widenius
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              3 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.