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

total_index_blocks is uninitialized in ALTER TABLE…ALGORITHM=INPLACE of small tables

Details

    • 10.1.24

    Description

      http://buildbot.askmonty.org/buildbot/builders/work-amd64-valgrind/builds/10024/steps/test/logs/stdio

      10.1 65a43605a42c069ede604826ede2d93d72c4fdd

      innodb_fts.innodb_fts_misc 'innodb_plugin' w1 [ fail ]  Found warnings/errors in server log file!
              Test ended at 2017-04-27 13:26:03
      line
      ==1854== Thread 22:
      ==1854== Conditional jump or move depends on uninitialised value(s)
      ==1854==    at 0xC0FE0FB: row_merge_build_indexes(trx_t*, dict_table_t*, dict_table_t*, bool, dict_index_t**, unsigned long const*, unsigned long, TABLE*, dtuple_t const*, unsigned long const*, unsigned long, ib_sequence_t&) (row0merge.cc:4202)
      ==1854==    by 0xC018846: ha_innodb::inplace_alter_table(TABLE*, Alter_inplace_info*) (handler0alter.cc:4249)
      ==1854==    by 0x6E90C6: handler::ha_inplace_alter_table(TABLE*, Alter_inplace_info*) (handler.h:3704)
      ==1854==    by 0x6E1256: mysql_inplace_alter_table(THD*, TABLE_LIST*, TABLE*, TABLE*, Alter_inplace_info*, enum_alter_inplace_result, MDL_request*, Alter_table_ctx*) (sql_table.cc:7133)
      ==1854==    by 0x6E5ACF: mysql_alter_table(THD*, char*, char*, HA_CREATE_INFO*, TABLE_LIST*, Alter_info*, unsigned int, st_order*, bool) (sql_table.cc:8945)
      ==1854==    by 0x75AFCD: Sql_cmd_alter_table::execute(THD*) (sql_alter.cc:325)
      ==1854==    by 0x6266AF: mysql_execute_command(THD*) (sql_parse.cc:5695)
      ==1854==    by 0x62A952: mysql_parse(THD*, char*, unsigned int, Parser_state*) (sql_parse.cc:7343)
      ==1854==    by 0x619942: dispatch_command(enum_server_command, THD*, char*, unsigned int) (sql_parse.cc:1490)
      ==1854==    by 0x61869C: do_command(THD*) (sql_parse.cc:1109)
      ==1854==    by 0x755CD5: do_handle_one_connection(THD*) (sql_connect.cc:1349)
      ==1854==    by 0x755A39: handle_one_connection (sql_connect.cc:1261)
      ==1854== Conditional jump or move depends on uninitialised value(s)
      ==1854==    at 0xC0FE3E2: row_merge_build_indexes(trx_t*, dict_table_t*, dict_table_t*, bool, dict_index_t**, unsigned long const*, unsigned long, TABLE*, dtuple_t const*, unsigned long const*, unsigned long, ib_sequence_t&) (row0merge.cc:4249)
      ==1854==    by 0xC018846: ha_innodb::inplace_alter_table(TABLE*, Alter_inplace_info*) (handler0alter.cc:4249)
      ==1854==    by 0x6E90C6: handler::ha_inplace_alter_table(TABLE*, Alter_inplace_info*) (handler.h:3704)
      ==1854==    by 0x6E1256: mysql_inplace_alter_table(THD*, TABLE_LIST*, TABLE*, TABLE*, Alter_inplace_info*, enum_alter_inplace_result, MDL_request*, Alter_table_ctx*) (sql_table.cc:7133)
      ==1854==    by 0x6E5ACF: mysql_alter_table(THD*, char*, char*, HA_CREATE_INFO*, TABLE_LIST*, Alter_info*, unsigned int, st_order*, bool) (sql_table.cc:8945)
      ==1854==    by 0x75AFCD: Sql_cmd_alter_table::execute(THD*) (sql_alter.cc:325)
      ==1854==    by 0x6266AF: mysql_execute_command(THD*) (sql_parse.cc:5695)
      ==1854==    by 0x62A952: mysql_parse(THD*, char*, unsigned int, Parser_state*) (sql_parse.cc:7343)
      ==1854==    by 0x619942: dispatch_command(enum_server_command, THD*, char*, unsigned int) (sql_parse.cc:1490)
      ==1854==    by 0x61869C: do_command(THD*) (sql_parse.cc:1109)
      ==1854==    by 0x755CD5: do_handle_one_connection(THD*) (sql_connect.cc:1349)
      ==1854==    by 0x755A39: handle_one_connection (sql_connect.cc:1261)
      

      Also reproducible locally for me.

      Attachments

        Issue Links

          Activity

            elenst Elena Stepanova added a comment - - edited

            innodb_fts.create, innodb_fts.innodb-fts-ddl, innodb_fts.innodb_fts_multiple_index, innodb_fts.innodb_fts_stopword_charset, innodb_fts.innodb_fts_misc_1, main.alter_table, innodb_fts.innodb-fts-fic, innodb_fts.innodb_fts_proximity, innodb_fts.innodb_fts_transaction are also affected.

            elenst Elena Stepanova added a comment - - edited innodb_fts.create, innodb_fts.innodb-fts-ddl, innodb_fts.innodb_fts_multiple_index, innodb_fts.innodb_fts_stopword_charset, innodb_fts.innodb_fts_misc_1, main.alter_table, innodb_fts.innodb-fts-fic, innodb_fts.innodb_fts_proximity, innodb_fts.innodb_fts_transaction are also affected.

            10.2 doesn't seem to be affected.

            elenst Elena Stepanova added a comment - 10.2 doesn't seem to be affected.

            I can only repeat this in 10.1, not 10.0 or 10.2. It seems to me that the problem resides in code that was originally introduced in MDEV-6812.

            marko Marko Mäkelä added a comment - I can only repeat this in 10.1, not 10.0 or 10.2. It seems to me that the problem resides in code that was originally introduced in MDEV-6812 .

            Before MDEV-6812, it did not matter that merge_files[].offset was uninitialized when no files were created.
            This problem was introduced in MDEV-6812. There could be a user-visible impact that the progress reports spit into the error log are bogus.

            This could affect 10.2 as well after all, but after MDEV-10509 repeating it could require setting ./mtr -mysqld=-log-warnings=2.

            The patch is simple (same for InnoDB and XtraDB):

            diff --git a/storage/innobase/row/row0merge.cc b/storage/innobase/row/row0merge.cc
            index 9cd79bdd523..85e053de961 100644
            --- a/storage/innobase/row/row0merge.cc
            +++ b/storage/innobase/row/row0merge.cc
            @@ -4035,6 +4035,7 @@ row_merge_build_indexes(
             
             	for (i = 0; i < n_indexes; i++) {
             		merge_files[i].fd = -1;
            +		merge_files[i].offset = 0;
             	}
             
             	total_static_cost = COST_BUILD_INDEX_STATIC * n_indexes + COST_READ_CLUSTERED_INDEX;
            

            marko Marko Mäkelä added a comment - Before MDEV-6812 , it did not matter that merge_files[].offset was uninitialized when no files were created. This problem was introduced in MDEV-6812 . There could be a user-visible impact that the progress reports spit into the error log are bogus. This could affect 10.2 as well after all, but after MDEV-10509 repeating it could require setting ./mtr - mysqld= -log-warnings=2. The patch is simple (same for InnoDB and XtraDB): diff --git a/storage/innobase/row/row0merge.cc b/storage/innobase/row/row0merge.cc index 9cd79bdd523..85e053de961 100644 --- a/storage/innobase/row/row0merge.cc +++ b/storage/innobase/row/row0merge.cc @@ -4035,6 +4035,7 @@ row_merge_build_indexes( for (i = 0; i < n_indexes; i++) { merge_files[i].fd = -1; + merge_files[i].offset = 0; } total_static_cost = COST_BUILD_INDEX_STATIC * n_indexes + COST_READ_CLUSTERED_INDEX;

            People

              marko Marko Mäkelä
              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.