23#ifndef ERROR_HANDLER_INCLUDED
24#define ERROR_HANDLER_INCLUDED
31#include "mysqld_error.h"
102 const char *)
override {
125 const char *)
override {
152 const char *msg)
override;
166 const char *)
override {
167 if (sql_errno == ER_LOCK_ABORTED || sql_errno == ER_LOCK_DEADLOCK)
208 const char *message)
override;
221 const char *)
override {
222 if (sql_errno == ER_BAD_DB_ERROR || sql_errno == ER_NO_SUCH_TABLE) {
259 const char *msg)
override;
283 const char *msg)
override;
312 const std::string &functional_index_name,
320 const char *message)
override;
347 const char *)
override {
348 return (sql_errno == ER_WRONG_TABLESPACE_NAME ||
349 sql_errno == ER_TOO_LONG_IDENT);
362 const char *)
override {
363 return (sql_errno == ER_TOO_LONG_KEY);
383 const char *)
override;
423 const char *message)
override;
431 const char *)
override {
443 const char *)
override;
Create_field is a description a field/column that may or may not exists in a table.
Definition: create_field.h:50
This class is an internal error handler implementation for DROP TABLE statements.
Definition: error_handler.h:148
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:56
Implements the trivial error handler which cancels all error states and prevents an SQLSTATE to be se...
Definition: error_handler.h:98
bool handle_condition(THD *, uint, const char *, Sql_condition::enum_severity_level *, const char *) override
Handle a sql condition.
Definition: error_handler.h:100
An Internal_error_handler that converts errors related to foreign key constraint checks 'ER_NO_REFERE...
Definition: error_handler.h:414
THD * m_thd
Definition: error_handler.h:416
Foreign_key_error_handler(THD *thd, handler *table_handler)
Definition: error_handler.h:419
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:497
handler * m_table_handler
Definition: error_handler.h:415
The purpose of this error handler is to print out more user friendly error messages when an error reg...
Definition: error_handler.h:307
Functional_index_error_handler(const Field *field, THD *thd)
Definition: error_handler.cc:229
~Functional_index_error_handler() override
Definition: error_handler.cc:283
bool m_pop_error_handler
Definition: error_handler.h:329
void force_error_code(int error_code)
Definition: error_handler.h:324
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:329
THD * m_thd
Definition: error_handler.h:328
int m_force_error_code
Definition: error_handler.h:330
std::string m_functional_index_name
Definition: error_handler.h:327
This internal handler implements downgrade from SL_ERROR to SL_WARNING for statements which support I...
Definition: error_handler.h:255
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:72
An error handler which downgrades JSON syntax errors to warnings.
Definition: error_handler.h:437
bool handle_condition(THD *, uint, const char *, Sql_condition::enum_severity_level *, const char *) override
Handle a sql condition.
Definition: error_handler.cc:540
Ignore_json_syntax_handler(THD *thd, bool enabled)
Definition: error_handler.cc:531
~Ignore_json_syntax_handler() override
Definition: error_handler.cc:536
bool m_enabled
Definition: error_handler.h:447
THD * m_thd
Definition: error_handler.h:446
An error handler that silences all warnings.
Definition: error_handler.h:427
bool handle_condition(THD *, unsigned, const char *, Sql_condition::enum_severity_level *level, const char *) override
Definition: error_handler.h:429
Error handler class to convert ER_LOCK_DEADLOCK error to ER_WARN_I_S_SKIPPED_TABLE/TABLESPACE error.
Definition: error_handler.h:374
bool m_error_handled
Definition: error_handler.h:403
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:478
Mdl_object_type
Definition: error_handler.h:399
Mdl_object_type m_object_type
Definition: error_handler.h:400
const String * m_schema_name
Definition: error_handler.h:391
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:464
bool is_error_handled() const
Definition: error_handler.h:385
const String * m_tablespace_name
Definition: error_handler.h:397
const String * m_table_name
Definition: error_handler.h:394
bool m_can_deadlock
Definition: error_handler.h:388
This class represents the interface for internal error handlers.
Definition: error_handler.h:46
virtual ~Internal_error_handler()=default
Internal_error_handler()
Definition: error_handler.h:48
Internal_error_handler * prev_internal_handler() const
Definition: error_handler.h:50
Internal_error_handler * m_prev_internal_handler
Definition: error_handler.h:89
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:358
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:360
Internal error handler to process an error from MDL_context::upgrade_lock() and mysql_lock_tables().
Definition: error_handler.h:162
void init()
Definition: error_handler.h:174
bool m_need_reopen
Definition: error_handler.h:177
bool need_reopen() const
Definition: error_handler.h:173
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:164
This internal handler is used to trap ER_NO_SUCH_TABLE and ER_BAD_DB_ERROR.
Definition: error_handler.h:215
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:235
int m_handled_errors
Definition: error_handler.h:246
int m_unhandled_errors
Definition: error_handler.h:247
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:219
No_such_table_error_handler()
Definition: error_handler.h:217
Implements the error handler for SET_VAR hint.
Definition: error_handler.h:116
Set_var_error_handler(bool ignore_warn_arg)
Definition: error_handler.h:118
bool handle_condition(THD *, uint, const char *, Sql_condition::enum_severity_level *level, const char *) override
Handle a sql condition.
Definition: error_handler.h:123
bool ignore_subsequent_messages
Definition: error_handler.h:138
bool ignore_warn
Definition: error_handler.h:137
void reset_state()
Definition: error_handler.h:134
enum_severity_level
Enumeration value describing the severity of the condition.
Definition: sql_error.h:62
@ SL_ERROR
Definition: sql_error.h:62
@ SL_WARNING
Definition: sql_error.h:62
This internal handler implements upgrade from SL_WARNING to SL_ERROR for the error codes affected by ...
Definition: error_handler.h:268
Strict_error_handler(enum_set_select_behavior param)
Definition: error_handler.h:278
enum_set_select_behavior
Definition: error_handler.h:270
@ DISABLE_SET_SELECT_STRICT_ERROR_HANDLER
Definition: error_handler.h:271
@ ENABLE_SET_SELECT_STRICT_ERROR_HANDLER
Definition: error_handler.h:272
Strict_error_handler()
Definition: error_handler.h:275
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:154
enum_set_select_behavior m_set_select_behavior
Definition: error_handler.h:292
Using this class is fraught with peril, and you need to be very careful when doing so.
Definition: sql_string.h:166
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:33
After retrieving the tablespace name, the tablespace name is validated.
Definition: error_handler.h:343
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:345
An Internal_error_handler that suppresses errors regarding views' underlying tables that occur during...
Definition: error_handler.h:201
Table_ref * m_top_view
Definition: error_handler.h:202
View_error_handler(Table_ref *top_view)
Definition: error_handler.h:205
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:116
The handler class is the interface for dynamically loadable storage engines.
Definition: handler.h:4354
Fido Client Authentication nullptr
Definition: fido_client_plugin.cc:221
const char * table_name
Definition: rules_table_service.cc:55
required bool enabled
Definition: replication_group_member_actions.proto:32
unsigned int uint
Definition: uca-dump.cc:29