24#ifndef ERROR_HANDLER_INCLUDED
25#define ERROR_HANDLER_INCLUDED
32#include "mysqld_error.h"
103 const char *)
override {
126 const char *)
override {
153 const char *msg)
override;
167 const char *)
override {
168 if (sql_errno == ER_LOCK_ABORTED || sql_errno == ER_LOCK_DEADLOCK)
209 const char *message)
override;
222 const char *)
override {
223 if (sql_errno == ER_BAD_DB_ERROR || sql_errno == ER_NO_SUCH_TABLE) {
260 const char *msg)
override;
284 const char *msg)
override;
313 const std::string &functional_index_name,
321 const char *message)
override;
348 const char *)
override {
349 return (sql_errno == ER_WRONG_TABLESPACE_NAME ||
350 sql_errno == ER_TOO_LONG_IDENT);
363 const char *)
override {
364 return (sql_errno == ER_TOO_LONG_KEY);
384 const char *)
override;
421 const char *message)
override;
429 const char *)
override {
441 const char *)
override;
Kerberos Client Authentication nullptr
Definition: auth_kerberos_client_plugin.cc:251
Create_field is a description a field/column that may or may not exists in a table.
Definition: create_field.h:51
This class is an internal error handler implementation for DROP TABLE statements.
Definition: error_handler.h:149
bool handle_condition(THD *thd, uint sql_errno, const char *sqlstate, Sql_condition::enum_severity_level *level, const char *msg) override
Implementation of Drop_table_error_handler::handle_condition().
Definition: error_handler.cc:57
Implements the trivial error handler which cancels all error states and prevents an SQLSTATE to be se...
Definition: error_handler.h:99
bool handle_condition(THD *, uint, const char *, Sql_condition::enum_severity_level *, const char *) override
Handle a sql condition.
Definition: error_handler.h:101
An Internal_error_handler that prevents revealing parent and child tables information when the foreig...
Definition: error_handler.h:412
THD * m_thd
Definition: error_handler.h:414
Foreign_key_error_handler(THD *thd, handler *table_handler)
Definition: error_handler.h:417
bool handle_condition(THD *, uint sql_errno, const char *, Sql_condition::enum_severity_level *level, const char *message) override
Handle a sql condition.
Definition: error_handler.cc:498
handler * m_table_handler
Definition: error_handler.h:413
The purpose of this error handler is to print out more user friendly error messages when an error reg...
Definition: error_handler.h:308
Functional_index_error_handler(const Field *field, THD *thd)
Definition: error_handler.cc:230
~Functional_index_error_handler() override
Definition: error_handler.cc:284
bool m_pop_error_handler
Definition: error_handler.h:330
void force_error_code(int error_code)
Definition: error_handler.h:325
bool handle_condition(THD *thd, uint sql_errno, const char *, Sql_condition::enum_severity_level *level, const char *message) override
Handle a sql condition.
Definition: error_handler.cc:330
THD * m_thd
Definition: error_handler.h:329
int m_force_error_code
Definition: error_handler.h:331
std::string m_functional_index_name
Definition: error_handler.h:328
This internal handler implements downgrade from SL_ERROR to SL_WARNING for statements which support I...
Definition: error_handler.h:256
bool handle_condition(THD *thd, uint sql_errno, const char *sqlstate, Sql_condition::enum_severity_level *level, const char *msg) override
This handler is used for the statements which support IGNORE keyword.
Definition: error_handler.cc:73
An error handler which downgrades JSON syntax errors to warnings.
Definition: error_handler.h:435
bool handle_condition(THD *, uint, const char *, Sql_condition::enum_severity_level *, const char *) override
Handle a sql condition.
Definition: error_handler.cc:545
Ignore_json_syntax_handler(THD *thd, bool enabled)
Definition: error_handler.cc:536
~Ignore_json_syntax_handler() override
Definition: error_handler.cc:541
bool m_enabled
Definition: error_handler.h:445
THD * m_thd
Definition: error_handler.h:444
An error handler that silences all warnings.
Definition: error_handler.h:425
bool handle_condition(THD *, unsigned, const char *, Sql_condition::enum_severity_level *level, const char *) override
Definition: error_handler.h:427
Error handler class to convert ER_LOCK_DEADLOCK error to ER_WARN_I_S_SKIPPED_TABLE/TABLESPACE error.
Definition: error_handler.h:375
bool m_error_handled
Definition: error_handler.h:404
bool handle_condition(THD *, uint sql_errno, const char *, Sql_condition::enum_severity_level *, const char *) override
Handle a sql condition.
Definition: error_handler.cc:479
Mdl_object_type
Definition: error_handler.h:400
Mdl_object_type m_object_type
Definition: error_handler.h:401
const String * m_schema_name
Definition: error_handler.h:392
Info_schema_error_handler(THD *thd, const String *schema_name, const String *table_name)
Following are implementation of error handler to convert ER_LOCK_DEADLOCK error when executing I_S....
Definition: error_handler.cc:465
bool is_error_handled() const
Definition: error_handler.h:386
const String * m_tablespace_name
Definition: error_handler.h:398
const String * m_table_name
Definition: error_handler.h:395
bool m_can_deadlock
Definition: error_handler.h:389
This class represents the interface for internal error handlers.
Definition: error_handler.h:47
virtual ~Internal_error_handler()=default
Internal_error_handler()
Definition: error_handler.h:49
Internal_error_handler * prev_internal_handler() const
Definition: error_handler.h:51
Internal_error_handler * m_prev_internal_handler
Definition: error_handler.h:90
virtual bool handle_condition(THD *thd, uint sql_errno, const char *sqlstate, Sql_condition::enum_severity_level *level, const char *msg)=0
Handle a sql condition.
Definition: error_handler.h:359
bool handle_condition(THD *, uint sql_errno, const char *, Sql_condition::enum_severity_level *, const char *) override
Handle a sql condition.
Definition: error_handler.h:361
Internal error handler to process an error from MDL_context::upgrade_lock() and mysql_lock_tables().
Definition: error_handler.h:163
void init()
Definition: error_handler.h:175
bool m_need_reopen
Definition: error_handler.h:178
bool need_reopen() const
Definition: error_handler.h:174
bool handle_condition(THD *, uint sql_errno, const char *, Sql_condition::enum_severity_level *, const char *) override
Handle a sql condition.
Definition: error_handler.h:165
This internal handler is used to trap ER_NO_SUCH_TABLE and ER_BAD_DB_ERROR.
Definition: error_handler.h:216
bool safely_trapped_errors() const
Returns true if one or more ER_NO_SUCH_TABLE and ER_BAD_DB_ERROR errors have been trapped and no othe...
Definition: error_handler.h:236
int m_handled_errors
Definition: error_handler.h:247
int m_unhandled_errors
Definition: error_handler.h:248
bool handle_condition(THD *, uint sql_errno, const char *, Sql_condition::enum_severity_level *, const char *) override
Handle a sql condition.
Definition: error_handler.h:220
No_such_table_error_handler()
Definition: error_handler.h:218
Implements the error handler for SET_VAR hint.
Definition: error_handler.h:117
Set_var_error_handler(bool ignore_warn_arg)
Definition: error_handler.h:119
bool handle_condition(THD *, uint, const char *, Sql_condition::enum_severity_level *level, const char *) override
Handle a sql condition.
Definition: error_handler.h:124
bool ignore_subsequent_messages
Definition: error_handler.h:139
bool ignore_warn
Definition: error_handler.h:138
void reset_state()
Definition: error_handler.h:135
enum_severity_level
Enumeration value describing the severity of the condition.
Definition: sql_error.h:63
@ SL_ERROR
Definition: sql_error.h:63
@ SL_WARNING
Definition: sql_error.h:63
This internal handler implements upgrade from SL_WARNING to SL_ERROR for the error codes affected by ...
Definition: error_handler.h:269
Strict_error_handler(enum_set_select_behavior param)
Definition: error_handler.h:279
enum_set_select_behavior
Definition: error_handler.h:271
@ DISABLE_SET_SELECT_STRICT_ERROR_HANDLER
Definition: error_handler.h:272
@ ENABLE_SET_SELECT_STRICT_ERROR_HANDLER
Definition: error_handler.h:273
Strict_error_handler()
Definition: error_handler.h:276
bool handle_condition(THD *thd, uint sql_errno, const char *sqlstate, Sql_condition::enum_severity_level *level, const char *msg) override
Implementation of STRICT mode.
Definition: error_handler.cc:155
enum_set_select_behavior m_set_select_behavior
Definition: error_handler.h:293
Using this class is fraught with peril, and you need to be very careful when doing so.
Definition: sql_string.h:167
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:36
After retrieving the tablespace name, the tablespace name is validated.
Definition: error_handler.h:344
bool handle_condition(THD *, uint sql_errno, const char *, Sql_condition::enum_severity_level *, const char *) override
Handle a sql condition.
Definition: error_handler.h:346
An Internal_error_handler that suppresses errors regarding views' underlying tables that occur during...
Definition: error_handler.h:202
Table_ref * m_top_view
Definition: error_handler.h:203
View_error_handler(Table_ref *top_view)
Definition: error_handler.h:206
bool handle_condition(THD *thd, uint sql_errno, const char *, Sql_condition::enum_severity_level *level, const char *message) override
Handle a sql condition.
Definition: error_handler.cc:117
The handler class is the interface for dynamically loadable storage engines.
Definition: handler.h:4571
const char * table_name
Definition: rules_table_service.cc:56
required bool enabled
Definition: replication_group_member_actions.proto:33