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.
This commit is contained in:
Marko Mäkelä 2023-07-04 15:24:57 +03:00
parent f7b8a2c953
commit cb364a78d6

View File

@ -514,15 +514,17 @@ static bool dict_stats_persistent_storage_check(bool dict_already_locked)
dict_sys.unlock(); dict_sys.unlock();
} }
if (ret != DB_SUCCESS && ret != DB_STATS_DO_NOT_EXIST) { switch (ret) {
ib::error() << errstr; case DB_SUCCESS:
return(false); return true;
} else if (ret == DB_STATS_DO_NOT_EXIST) { default:
if (!opt_bootstrap) {
ib::error() << errstr;
}
/* fall through */
case DB_STATS_DO_NOT_EXIST:
return false; return false;
} }
/* else */
return(true);
} }
/** Executes a given SQL statement using the InnoDB internal SQL parser. /** Executes a given SQL statement using the InnoDB internal SQL parser.