Skip to content

Commit cb364a7

Browse files
committed
MDEV-31619 dict_stats_persistent_storage_check() may show garbage during --bootstrap
dict_stats_persistent_storage_check(): Do not output errmsg if opt_bootstrap holds, because the message buffer would likely be uninitialized.
1 parent f7b8a2c commit cb364a7

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

storage/innobase/dict/dict0stats.cc

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -514,15 +514,17 @@ static bool dict_stats_persistent_storage_check(bool dict_already_locked)
514514
dict_sys.unlock();
515515
}
516516

517-
if (ret != DB_SUCCESS && ret != DB_STATS_DO_NOT_EXIST) {
518-
ib::error() << errstr;
519-
return(false);
520-
} else if (ret == DB_STATS_DO_NOT_EXIST) {
517+
switch (ret) {
518+
case DB_SUCCESS:
519+
return true;
520+
default:
521+
if (!opt_bootstrap) {
522+
ib::error() << errstr;
523+
}
524+
/* fall through */
525+
case DB_STATS_DO_NOT_EXIST:
521526
return false;
522527
}
523-
/* else */
524-
525-
return(true);
526528
}
527529

528530
/** Executes a given SQL statement using the InnoDB internal SQL parser.

0 commit comments

Comments
 (0)