1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-24 11:21:21 +03:00

Bug#42364 SHOW ERRORS returns empty resultset after dropping non existent table

partial backport of bug43138 fix


mysql-test/r/warnings.result:
  test result
mysql-test/t/warnings.test:
  test case
sql/sql_class.cc:
  partial backport of bug43138 fix
sql/sql_class.h:
  partial backport of bug43138 fix
sql/sql_table.cc:
  partial backport of bug43138 fix
This commit is contained in:
Sergey Glukhov
2009-09-10 13:49:49 +05:00
parent 6d3e743d5b
commit 104d9ce76a
5 changed files with 66 additions and 4 deletions

View File

@@ -399,6 +399,31 @@ char *thd_security_context(THD *thd, char *buffer, unsigned int length,
return buffer;
}
/**
Implementation of Drop_table_error_handler::handle_error().
The reason in having this implementation is to silence technical low-level
warnings during DROP TABLE operation. Currently we don't want to expose
the following warnings during DROP TABLE:
- Some of table files are missed or invalid (the table is going to be
deleted anyway, so why bother that something was missed);
- A trigger associated with the table does not have DEFINER (One of the
MySQL specifics now is that triggers are loaded for the table being
dropped. So, we may have a warning that trigger does not have DEFINER
attribute during DROP TABLE operation).
@return TRUE if the condition is handled.
*/
bool Drop_table_error_handler::handle_error(uint sql_errno,
const char *message,
MYSQL_ERROR::enum_warning_level level,
THD *thd)
{
return ((sql_errno == EE_DELETE && my_errno == ENOENT) ||
sql_errno == ER_TRG_NO_DEFINER);
}
/**
Clear this diagnostics area.