MySQL 9.1.0
Source Code Documentation
derror.h File Reference
#include <stddef.h>
#include <sys/types.h>
#include "my_inttypes.h"

Go to the source code of this file.

Classes

struct  server_error
 A record describing an error message. More...
 
class  MY_LOCALE_ERRMSGS
 

Functions

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)
 
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...
 
const char * mysql_errno_to_symbol (int mysql_errno)
 
int mysql_symbol_to_errno (const char *error_symbol)
 
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...
 
int errmsgs_reload (THD *thd)
 
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_INFOerror_message_charset_info
 Character set of the buildin error messages loaded from errmsg.sys. More...
 

Function Documentation

◆ deinit_errmessage()

void deinit_errmessage ( )

Unregister error messages for all languages.

◆ ER_DEFAULT()

const char * ER_DEFAULT ( int  mysql_errno)

◆ ER_DEFAULT_NONCONST()

const char * ER_DEFAULT_NONCONST ( int  mysql_errno)

◆ ER_THD()

const char * ER_THD ( const THD thd,
int  mysql_errno 
)

◆ ER_THD_NONCONST()

const char * ER_THD_NONCONST ( const THD thd,
int  mysql_errno 
)

◆ errmsgs_reload()

int errmsgs_reload ( THD thd)

◆ error_message_for_client()

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.

Parameters
mysql_errnoMySQL error-code
Return values
anerror-message if available, or nullptr

◆ error_message_for_error_log()

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).

Parameters
mysql_errnoMySQL error-code
Return values
anerror-message if available, or nullptr

◆ init_errmessage()

bool init_errmessage ( )

Read the error message file, initialize and register error messages for all languages.

Return values
trueif initialization failed, false otherwise.

◆ mysql_errno_to_builtin()

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.

Parameters
mysql_errnothe error code to look for
Return values
-1no message registered for this error code
>=0index

◆ mysql_errno_to_symbol()

const char * mysql_errno_to_symbol ( int  mysql_errno)

◆ mysql_symbol_to_errno()

int mysql_symbol_to_errno ( const char *  error_symbol)

Variable Documentation

◆ error_message_charset_info

CHARSET_INFO* error_message_charset_info
extern

Character set of the buildin error messages loaded from errmsg.sys.