MySQL 8.0.40
Source Code Documentation
|
#include "sql/derror.h"
#include <fcntl.h>
#include <stddef.h>
#include <sys/types.h>
#include "m_ctype.h"
#include "m_string.h"
#include "my_byteorder.h"
#include "my_dbug.h"
#include "my_inttypes.h"
#include "my_io.h"
#include "my_loglevel.h"
#include "my_sys.h"
#include "mysql/components/services/log_builtins.h"
#include "mysql/psi/mysql_file.h"
#include "mysql/service_mysql_alloc.h"
#include "mysqld_error.h"
#include "sql/current_thd.h"
#include "sql/log.h"
#include "sql/mysqld.h"
#include "sql/psi_memory_key.h"
#include "sql/sql_class.h"
#include "sql/sql_locale.h"
#include "sql/system_variables.h"
#include "storage/perfschema/pfs_error.h"
Functions | |
int | mysql_errno_to_builtin (uint mysql_errno) |
Find the error message record for a given MySQL error code in the array of registered messages. More... | |
const char * | ER_DEFAULT (int mysql_errno) |
const char * | ER_THD (const THD *thd, int mysql_errno) |
const char * | ER_DEFAULT_NONCONST (int mysql_errno) |
const char * | ER_THD_NONCONST (const THD *thd, int mysql_errno) |
static const char * | error_message_fetch (int mysql_errno) |
Get the error-message corresponding to the given MySQL error-code, or nullptr if no message is available for that code (this may indicate a bug in the caller). More... | |
const char * | error_message_for_error_log (int mysql_errno) |
Get the error-message corresponding to the given MySQL error-code, or nullptr if no message is available for that code (this may indicate a bug in the caller). More... | |
const char * | error_message_for_client (int mysql_errno) |
Get the error-message corresponding to the given MySQL error-code, or nullptr if no message is available for that code (this may indicate a bug in the caller). More... | |
bool | init_errmessage () |
Read the error message file, initialize and register error messages for all languages. More... | |
void | deinit_errmessage () |
Unregister error messages for all languages. More... | |
Variables | |
CHARSET_INFO * | error_message_charset_info |
Character set of the buildin error messages loaded from errmsg.sys. More... | |
static const char * | ERRMSG_FILE = "errmsg.sys" |
void deinit_errmessage | ( | ) |
Unregister error messages for all languages.
const char * ER_DEFAULT | ( | int | mysql_errno | ) |
const char * ER_DEFAULT_NONCONST | ( | int | mysql_errno | ) |
const char * ER_THD | ( | const THD * | thd, |
int | mysql_errno | ||
) |
const char * ER_THD_NONCONST | ( | const THD * | thd, |
int | mysql_errno | ||
) |
|
static |
Get the error-message corresponding to the given MySQL error-code, or nullptr if no message is available for that code (this may indicate a bug in the caller).
If error messages have been loaded, return the appropriate message in the configured default language; otherwise, retrieve the message from the compiled-in set (in English).
mysql_errno | MySQL error-code |
an | error-message if available, or nullptr |
const char * error_message_for_client | ( | int | mysql_errno | ) |
Get the error-message corresponding to the given MySQL error-code, or nullptr if no message is available for that code (this may indicate a bug in the caller).
Use this variant for messages intended for sending to a client.
If the session language is known, the message will be returned in that language if available; otherwise, we will fall back on the configured default language if loaded, or finally on the built-in default, English.
mysql_errno | MySQL error-code |
an | error-message if available, or nullptr |
const char * error_message_for_error_log | ( | int | mysql_errno | ) |
Get the error-message corresponding to the given MySQL error-code, or nullptr if no message is available for that code (this may indicate a bug in the caller).
Use this variant for messages intended for the server's error-log.
If error messages have been loaded, return the appropriate message in the configured default language; otherwise, retrieve the message from the compiled-in set (in English).
mysql_errno | MySQL error-code |
an | error-message if available, or nullptr |
bool init_errmessage | ( | ) |
Read the error message file, initialize and register error messages for all languages.
true | if initialization failed, false otherwise. |
int mysql_errno_to_builtin | ( | uint | mysql_errno | ) |
Find the error message record for a given MySQL error code in the array of registered messages.
The result is an index for said array; this value should not be considered stable between subsequent invocations of the server.
mysql_errno | the error code to look for |
-1 | no message registered for this error code |
>=0 | index |
|
static |
CHARSET_INFO* error_message_charset_info |
Character set of the buildin error messages loaded from errmsg.sys.