MDEV-8578: Wrong error code/message with enforce_storage_engine and

NO_ENGINE_SUBSTITUTION

Analysis:
When the error is hit, wrong error code is passed in my_error
Fix:
Pass a better error code.
This commit is contained in:
Rucha Deodhar 2024-03-20 00:42:28 +05:30
commit e14d2b7974
5 changed files with 5 additions and 6 deletions

View file

@ -12304,8 +12304,7 @@ bool check_engine(THD *thd, const char *db_name,
{
if (no_substitution)
{
const char *engine_name= ha_resolve_storage_engine_name(req_engine);
my_error(ER_UNKNOWN_STORAGE_ENGINE, MYF(0), engine_name);
my_error(ER_OPTION_PREVENTS_STATEMENT, MYF(0), "NO_ENGINE_SUBSTITUTION");
DBUG_RETURN(TRUE);
}
*new_engine= enf_engine;