24
24
/* Error messages for MySQL clients */
25
25
/* (Error messages for the daemon are in sql/share/errmsg.txt) */
30
void init_client_errs(void);
31
void finish_client_errs(void);
32
extern const char *client_errors[]; /* Error messages */
30
const char * get_client_error(unsigned int err_index);
37
#define CR_MIN_ERROR 2000 /* For easier client code */
38
#define CR_MAX_ERROR 2999
35
#define CR_MIN_ERROR 2000 /* For easier client code */
36
#define CR_MAX_ERROR 2999
40
#define ER(X) client_errors[(X)-CR_MIN_ERROR]
38
#define ER(X) get_client_error((X)-CR_MIN_ERROR)
42
#define CLIENT_ERRMAP 2 /* Errormap used by my_error() */
40
#define CLIENT_ERRMAP 2 /* Errormap used by my_error() */
44
42
/* Do not add error numbers before CR_ERROR_FIRST. */
45
43
/* If necessary to add lower numbers, change CR_ERROR_FIRST accordingly. */
46
#define CR_ERROR_FIRST 2000 /*Copy first error nr.*/
47
#define CR_UNKNOWN_ERROR 2000
48
#define CR_SOCKET_CREATE_ERROR 2001
49
#define CR_CONNECTION_ERROR 2002
50
#define CR_CONN_HOST_ERROR 2003
51
#define CR_IPSOCK_ERROR 2004
52
#define CR_UNKNOWN_HOST 2005
53
#define CR_SERVER_GONE_ERROR 2006
54
#define CR_VERSION_ERROR 2007
55
#define CR_OUT_OF_MEMORY 2008
56
#define CR_WRONG_HOST_INFO 2009
57
#define CR_LOCALHOST_CONNECTION 2010
58
#define CR_TCP_CONNECTION 2011
59
#define CR_SERVER_HANDSHAKE_ERR 2012
60
#define CR_SERVER_LOST 2013
61
#define CR_COMMANDS_OUT_OF_SYNC 2014
62
#define CR_NAMEDPIPE_CONNECTION 2015
63
#define CR_NAMEDPIPEWAIT_ERROR 2016
64
#define CR_NAMEDPIPEOPEN_ERROR 2017
65
#define CR_NAMEDPIPESETSTATE_ERROR 2018
66
#define CR_CANT_READ_CHARSET 2019
67
#define CR_NET_PACKET_TOO_LARGE 2020
68
#define CR_EMBEDDED_CONNECTION 2021
69
#define CR_PROBE_SLAVE_STATUS 2022
70
#define CR_PROBE_SLAVE_HOSTS 2023
71
#define CR_PROBE_SLAVE_CONNECT 2024
72
#define CR_PROBE_MASTER_CONNECT 2025
73
#define CR_SSL_CONNECTION_ERROR 2026
74
#define CR_MALFORMED_PACKET 2027
75
#define CR_WRONG_LICENSE 2028
77
/* new 4.1 error codes */
78
#define CR_NULL_POINTER 2029
79
#define CR_NO_PREPARE_STMT 2030
80
#define CR_PARAMS_NOT_BOUND 2031
81
#define CR_DATA_TRUNCATED 2032
82
#define CR_NO_PARAMETERS_EXISTS 2033
83
#define CR_INVALID_PARAMETER_NO 2034
84
#define CR_INVALID_BUFFER_USE 2035
85
#define CR_UNSUPPORTED_PARAM_TYPE 2036
87
#define CR_SHARED_MEMORY_CONNECTION 2037
88
#define CR_SHARED_MEMORY_CONNECT_REQUEST_ERROR 2038
89
#define CR_SHARED_MEMORY_CONNECT_ANSWER_ERROR 2039
90
#define CR_SHARED_MEMORY_CONNECT_FILE_MAP_ERROR 2040
91
#define CR_SHARED_MEMORY_CONNECT_MAP_ERROR 2041
92
#define CR_SHARED_MEMORY_FILE_MAP_ERROR 2042
93
#define CR_SHARED_MEMORY_MAP_ERROR 2043
94
#define CR_SHARED_MEMORY_EVENT_ERROR 2044
95
#define CR_SHARED_MEMORY_CONNECT_ABANDONED_ERROR 2045
96
#define CR_SHARED_MEMORY_CONNECT_SET_ERROR 2046
97
#define CR_CONN_UNKNOW_PROTOCOL 2047
98
#define CR_INVALID_CONN_HANDLE 2048
99
#define CR_SECURE_AUTH 2049
100
#define CR_FETCH_CANCELED 2050
101
#define CR_NO_DATA 2051
102
#define CR_NO_STMT_METADATA 2052
103
#define CR_NO_RESULT_SET 2053
104
#define CR_NOT_IMPLEMENTED 2054
105
#define CR_SERVER_LOST_EXTENDED 2055
106
#define CR_STMT_CLOSED 2056
107
#define CR_ERROR_LAST /*Copy last error nr:*/ 2056
108
/* Add error numbers before CR_ERROR_LAST and change it accordingly. */
44
enum CR_CLIENT_ERRORS {
45
CR_ERROR_FIRST =2000, /*Copy first error nr.*/
46
CR_UNKNOWN_ERROR =2000,
47
CR_SOCKET_CREATE_ERROR =2001,
48
CR_CONNECTION_ERROR =2002,
49
CR_CONN_HOST_ERROR =2003,
50
CR_IPSOCK_ERROR =2004,
51
CR_UNKNOWN_HOST =2005,
52
CR_SERVER_GONE_ERROR =2006,
53
CR_VERSION_ERROR =2007,
54
CR_OUT_OF_MEMORY =2008,
55
CR_WRONG_HOST_INFO =2009,
56
CR_LOCALHOST_CONNECTION =2010,
57
CR_TCP_CONNECTION =2011,
58
CR_SERVER_HANDSHAKE_ERR =2012,
60
CR_COMMANDS_OUT_OF_SYNC =2014,
61
CR_NAMEDPIPE_CONNECTION =2015,
62
CR_NAMEDPIPEWAIT_ERROR =2016,
63
CR_NAMEDPIPEOPEN_ERROR =2017,
64
CR_NAMEDPIPESETSTATE_ERROR =2018,
65
CR_CANT_READ_CHARSET =2019,
66
CR_NET_PACKET_TOO_LARGE =2020,
67
CR_EMBEDDED_CONNECTION =2021,
68
CR_PROBE_SLAVE_STATUS =2022,
69
CR_PROBE_SLAVE_HOSTS =2023,
70
CR_PROBE_SLAVE_CONNECT =2024,
71
CR_PROBE_MASTER_CONNECT =2025,
72
CR_SSL_CONNECTION_ERROR =2026,
73
CR_MALFORMED_PACKET =2027,
75
CR_NULL_POINTER =2029,
76
CR_NO_PREPARE_STMT =2030,
77
CR_PARAMS_NOT_BOUND =2031,
78
CR_DATA_TRUNCATED =2032,
79
CR_NO_PARAMETERS_EXISTS =2033,
80
CR_INVALID_PARAMETER_NO =2034,
81
CR_INVALID_BUFFER_USE =2035,
82
CR_UNSUPPORTED_PARAM_TYPE =2036,
84
CR_CONN_UNKNOW_PROTOCOL =2047,
85
CR_INVALID_CONN_HANDLE =2048,
87
CR_FETCH_CANCELED =2050,
89
CR_NO_STMT_METADATA =2052,
90
CR_NO_RESULT_SET =2053,
91
CR_NOT_IMPLEMENTED =2054,
92
CR_SERVER_LOST_INITIAL_COMM_WAIT =2055,
93
CR_SERVER_LOST_INITIAL_COMM_READ =2056,
94
CR_SERVER_LOST_SEND_AUTH =2057,
95
CR_SERVER_LOST_READ_AUTH =2058,
96
CR_SERVER_LOST_SETTING_DB =2059,
99
/* Add error numbers before CR_ERROR_LAST and change it accordingly. */
100
CR_ERROR_LAST =2060 /*Copy last error nr:*/