MySQL 9.1.0
Source Code Documentation
|
The purpose of this error handler is to print out more user friendly error messages when an error regarding a functional index happens. More...
#include <error_handler.h>
Public Member Functions | |
Functional_index_error_handler (const Field *field, THD *thd) | |
Functional_index_error_handler (Create_field *field, const std::string &functional_index_name, THD *thd) | |
Functional_index_error_handler (const std::string &functional_index_name, THD *thd) | |
bool | handle_condition (THD *thd, uint sql_errno, const char *, Sql_condition::enum_severity_level *level, const char *message) override |
Handle a sql condition. More... | |
~Functional_index_error_handler () override | |
void | force_error_code (int error_code) |
Private Attributes | |
std::string | m_functional_index_name |
THD * | m_thd |
bool | m_pop_error_handler |
int | m_force_error_code |
Additional Inherited Members | |
Protected Member Functions inherited from Internal_error_handler | |
Internal_error_handler () | |
Internal_error_handler * | prev_internal_handler () const |
virtual | ~Internal_error_handler ()=default |
The purpose of this error handler is to print out more user friendly error messages when an error regarding a functional index happens.
Since functional indexes are implemented as hidden generated columns with an auto-generated name, we would end up printing errors like "Out of range value for column '912ec803b2ce49e4a541068d495ab570' at row 0". With this error handler, we end up printing something like "Out of range value for functional index 'functional_index_2' at row 0" instead.
The handler keeps track of the previous error handler that was in use, and calls that error handler to get the correct severity among other things.
Functional_index_error_handler::Functional_index_error_handler | ( | Create_field * | field, |
const std::string & | functional_index_name, | ||
THD * | thd | ||
) |
Functional_index_error_handler::Functional_index_error_handler | ( | const std::string & | functional_index_name, |
THD * | thd | ||
) |
|
override |
|
inline |
|
overridevirtual |
Handle a sql condition.
This method can be implemented by a subclass to achieve any of the following:
This mechanism is similar to C++ try/throw/catch:
THD::push_internal_handler()
,my_error()
, which invokes my_message_sql()
,THD::pop_internal_handler()
.thd | the calling thread |
sql_errno | the error number for the condition raised. |
sqlstate | the SQLSTATE for the condition raised. |
level | the severity level for the condition raised. |
msg | the error message for the condition raised. |
Implements Internal_error_handler.
|
private |
|
private |
|
private |
|
private |