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

Valgrind warnings (Conditional jump or move depends on uninitialised value) with InnoDB, semijoin

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 10.0.3, 5.5.31, 5.3.12
    • 10.0.5, 5.5.32
    • None
    • None

    Description

      ==5586== Conditional jump or move depends on uninitialised value(s)
      ==5586==    at 0x99843B: ha_innobase::store_key_val_for_row(unsigned int, char*, unsigned int, unsigned char const*) (ha_innodb.cc:5334)
      ==5586==    by 0x99C6DA: ha_innobase::position(unsigned char const*) (ha_innodb.cc:7506)
      ==5586==    by 0x66C16B: sub_select(JOIN*, st_join_table*, bool) (sql_select.cc:16302)
      ==5586==    by 0x66BA38: do_select(JOIN*, List<Item>*, TABLE*, Procedure*) (sql_select.cc:15973)
      ==5586==    by 0x64B51E: JOIN::exec() (sql_select.cc:2834)
      ==5586==    by 0x64BD1C: mysql_select(THD*, Item***, TABLE_LIST*, unsigned int, List<Item>&, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, unsigned long long, select_result*, st_select_lex_unit*, st_select_lex*) (sql_select.cc:3054)
      ==5586==    by 0x64273F: handle_select(THD*, LEX*, select_result*, unsigned long) (sql_select.cc:318)
      ==5586==    by 0x61A7DF: execute_sqlcom_select(THD*, TABLE_LIST*) (sql_parse.cc:4646)
      ==5586==    by 0x613225: mysql_execute_command(THD*) (sql_parse.cc:2200)
      ==5586==    by 0x61D07F: mysql_parse(THD*, char*, unsigned int, Parser_state*) (sql_parse.cc:5764)
      ==5586==    by 0x610756: dispatch_command(enum_server_command, THD*, char*, unsigned int) (sql_parse.cc:1071)
      ==5586==    by 0x60F966: do_command(THD*) (sql_parse.cc:794)
      ==5586==    by 0x71BD32: do_handle_one_connection(THD*) (sql_connect.cc:1266)
      ==5586==    by 0x71B719: handle_one_connection (sql_connect.cc:1181)
      ==5586==    by 0x9787AD: pfs_spawn_thread (pfs.cc:1015)
      ==5586==    by 0x545AE99: start_thread (pthread_create.c:308)
      ==5586== Conditional jump or move depends on uninitialised value(s)
      ==5586==    at 0x9984B5: ha_innobase::store_key_val_for_row(unsigned int, char*, unsigned int, unsigned char const*) (ha_innodb.cc:5346)
      ==5586==    by 0x99C6DA: ha_innobase::position(unsigned char const*) (ha_innodb.cc:7506)
      ==5586==    by 0x66C16B: sub_select(JOIN*, st_join_table*, bool) (sql_select.cc:16302)
      ==5586==    by 0x66BA38: do_select(JOIN*, List<Item>*, TABLE*, Procedure*) (sql_select.cc:15973)
      ==5586==    by 0x64B51E: JOIN::exec() (sql_select.cc:2834)
      ==5586==    by 0x64BD1C: mysql_select(THD*, Item***, TABLE_LIST*, unsigned int, List<Item>&, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, unsigned long long, select_result*, st_select_lex_unit*, st_select_lex*) (sql_select.cc:3054)
      ==5586==    by 0x64273F: handle_select(THD*, LEX*, select_result*, unsigned long) (sql_select.cc:318)
      ==5586==    by 0x61A7DF: execute_sqlcom_select(THD*, TABLE_LIST*) (sql_parse.cc:4646)
      ==5586==    by 0x613225: mysql_execute_command(THD*) (sql_parse.cc:2200)
      ==5586==    by 0x61D07F: mysql_parse(THD*, char*, unsigned int, Parser_state*) (sql_parse.cc:5764)
      ==5586==    by 0x610756: dispatch_command(enum_server_command, THD*, char*, unsigned int) (sql_parse.cc:1071)
      ==5586==    by 0x60F966: do_command(THD*) (sql_parse.cc:794)
      ==5586==    by 0x71BD32: do_handle_one_connection(THD*) (sql_connect.cc:1266)
      ==5586==    by 0x71B719: handle_one_connection (sql_connect.cc:1181)
      ==5586==    by 0x9787AD: pfs_spawn_thread (pfs.cc:1015)
      ==5586==    by 0x545AE99: start_thread (pthread_create.c:308)

      5331:                   /* For multi byte character sets we need to calculate
      5332:                   the true length of the key */
      5333:
      5334:                   if (len > 0 && cs->mbmaxlen > 1) {
      5335:                           true_len = (ulint) cs->cset->well_formed_len(cs,
      5336:                                           (const char *) data,
      5337:                                           (const char *) data + len,
      5338:                                                (uint) (key_len /
      5339:                                                        cs->mbmaxlen),
      5340:                                           &error);
      5341:                   }
      5342:
      5343:                   /* In a column prefix index, we may need to truncate
      5344:                   the stored value: */

      bzr version-info

      revision-id: psergey@askmonty.org-20130711111250-ako2z33co7o9tl5x
      revno: 3827
      branch-nick: 5.5

      Reproducible with XtraDB and InnoDB (stack trace above is with XtraDB).

      Minimal optimizer_switch: semijoin=on

      Test case:

      --source include/have_innodb.inc
       
      SET optimizer_switch = 'semijoin=on';
       
      CREATE TABLE t1 ( t1_pk1 varchar(3), t1_pk2 varchar(52), PRIMARY KEY (t1_pk1,t1_pk2)) ENGINE=InnoDB;
      INSERT INTO t1 VALUES ('CHN','Chinese'),('USA','English');
       
      CREATE TABLE t2 ( t2_i int(11), t2_c varchar(52)) ENGINE=InnoDB;
      INSERT INTO t2 VALUES (86,'English');
       
      CREATE TABLE t3 ( t3_i int(11), t3_c varchar(35)) ENGINE=InnoDB;
      INSERT INTO t3 VALUES (3989,'Abilene'),(3873,'Akron');
       
      SELECT * FROM t1, t3 WHERE t3_c IN ( SELECT t1_pk2 FROM t1, t2 WHERE t2_c = t1_pk2 AND t2_i >= t3_i ) AND ( t1_pk1 = 'POL' );

      EXPLAIN:

      id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
      1	PRIMARY	t1	ref	PRIMARY	PRIMARY	5	const	1	100.00	Using where; Using index
      1	PRIMARY	t2	ALL	NULL	NULL	NULL	NULL	1	100.00	Start temporary; Using join buffer (flat, BNL join)
      1	PRIMARY	t3	ALL	NULL	NULL	NULL	NULL	2	100.00	Using where; Using join buffer (incremental, BNL join)
      1	PRIMARY	t1	index	NULL	PRIMARY	59	NULL	2	100.00	Using where; Using index; End temporary; Using join buffer (incremental, BNL join)
      Warnings:
      Note	1276	Field or reference 'test.t3.t3_i' of SELECT #2 was resolved in SELECT #1
      Note	1003	select `test`.`t1`.`t1_pk1` AS `t1_pk1`,`test`.`t1`.`t1_pk2` AS `t1_pk2`,`test`.`t3`.`t3_i` AS `t3_i`,`test`.`t3`.`t3_c` AS `t3_c` from `test`.`t1` semi join (`test`.`t1` join `test`.`t2`) join `test`.`t3` where ((`test`.`t1`.`t1_pk1` = 'POL') and (`test`.`t1`.`t1_pk2` = `test`.`t2`.`t2_c`) and (`test`.`t2`.`t2_i` >= `test`.`t3`.`t3_i`) and (`test`.`t3`.`t3_c` = `test`.`t2`.`t2_c`))

      Attachments

        Activity

          People

            psergei Sergei Petrunia
            elenst Elena Stepanova
            Votes:
            0 Vote for this issue
            Watchers:
            1 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.