Commit 52a0cd3c authored by Sergei Golubchik's avatar Sergei Golubchik

remove Silence_deprecated_warning

it was introduced in ff8651c4 to suppress deprecated
warnings for CALL under the flawed logic that "It's doesn't
make sense to print out deprecated syntax warnings when the
routine is being executed because this kind of warning only
matters when the routine is being created".

Which is incorrect, a feature might become deprecated after
the routine was created and a user has to know that to be able
to update the procedure before it stops working when a
deprecated feature is removed.
parent 6b9e1220
......@@ -797,40 +797,6 @@ Sp_handler::db_find_and_cache_routine(THD *thd,
}
/**
Silence DEPRECATED SYNTAX warnings when loading a stored procedure
into the cache.
*/
struct Silence_deprecated_warning : public Internal_error_handler
{
public:
virtual bool handle_condition(THD *thd,
uint sql_errno,
const char* sqlstate,
Sql_condition::enum_warning_level *level,
const char* msg,
Sql_condition ** cond_hdl);
};
bool
Silence_deprecated_warning::handle_condition(
THD *,
uint sql_errno,
const char*,
Sql_condition::enum_warning_level *level,
const char*,
Sql_condition ** cond_hdl)
{
*cond_hdl= NULL;
if (sql_errno == ER_WARN_DEPRECATED_SYNTAX &&
*level == Sql_condition::WARN_LEVEL_WARN)
return TRUE;
return FALSE;
}
/**
Make a copy of a SQL statement used for creation of a stored routine.
......@@ -893,7 +859,6 @@ static sp_head *sp_compile(THD *thd, String *defstr, sql_mode_t sql_mode,
sql_mode_t old_sql_mode= thd->variables.sql_mode;
ha_rows old_select_limit= thd->variables.select_limit;
sp_rcontext *old_spcont= thd->spcont;
Silence_deprecated_warning warning_handler;
Parser_state parser_state;
thd->variables.sql_mode= sql_mode;
......@@ -927,7 +892,6 @@ static sp_head *sp_compile(THD *thd, String *defstr, sql_mode_t sql_mode,
}
thd->lex->sphead= parent;
thd->push_internal_handler(&warning_handler);
thd->spcont= 0;
if (parse_sql(thd, & parser_state, creation_ctx) || thd->lex == NULL)
......@@ -942,7 +906,6 @@ static sp_head *sp_compile(THD *thd, String *defstr, sql_mode_t sql_mode,
sp->set_definition_string(definition_string);
}
thd->pop_internal_handler();
thd->spcont= old_spcont;
thd->variables.sql_mode= old_sql_mode;
thd->variables.select_limit= old_select_limit;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment