- Notifications
You must be signed in to change notification settings - Fork 4k
/
Copy patherrmsg.h
148 lines (131 loc) · 5.68 KB
/
errmsg.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
#ifndefERRMSG_INCLUDED
#defineERRMSG_INCLUDED
/* Copyright (c) 2000, 2025, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
as published by the Free Software Foundation.
This program is designed to work with certain software (including
but not limited to OpenSSL) that is licensed under separate terms,
as designated in a particular file or component or in included license
documentation. The authors of MySQL hereby grant you an additional
permission to link the program and your derivative works with the
separately licensed software that they have either included with
the program or referenced in the documentation.
Without limiting anything contained in the foregoing, this file,
which is part of C Driver for MySQL (Connector/C), is also subject to the
Universal FOSS Exception, version 1.0, a copy of which can be found at
http://oss.oracle.com/licenses/universal-foss-exception.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License, version 2.0, for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/**
@file include/errmsg.h
Error messages for MySQL clients.
These are constant and use the CR_ prefix.
<mysqlclient_ername.h> will contain auto-generated mappings
containing the symbolic name and the number from this file,
and the english error messages in libmysql/errmsg.c.
Dynamic error messages for the daemon are in share/language/errmsg.sys.
The server equivalent to <errmsg.h> is <mysqld_error.h>.
The server equivalent to <mysqlclient_ername.h> is <mysqld_ername.h>.
Note that the auth subsystem also uses codes with a CR_ prefix.
*/
voidinit_client_errs(void);
voidfinish_client_errs(void);
externconstchar*client_errors[]; /* Error messages */
#defineCR_MIN_ERROR 2000 /* For easier client code */
#defineCR_MAX_ERROR 2999
#defineCLIENT_ERRMAP 2 /* Errormap used by my_error() */
/* Do not add error numbers before CR_ERROR_FIRST. */
/* If necessary to add lower numbers, change CR_ERROR_FIRST accordingly. */
#defineCR_ERROR_FIRST 2000 /*Copy first error nr.*/
#defineCR_UNKNOWN_ERROR 2000
#defineCR_SOCKET_CREATE_ERROR 2001
#defineCR_CONNECTION_ERROR 2002
#defineCR_CONN_HOST_ERROR 2003
#defineCR_IPSOCK_ERROR 2004
#defineCR_UNKNOWN_HOST 2005
#defineCR_SERVER_GONE_ERROR 2006
#defineCR_VERSION_ERROR 2007
#defineCR_OUT_OF_MEMORY 2008
#defineCR_WRONG_HOST_INFO 2009
#defineCR_LOCALHOST_CONNECTION 2010
#defineCR_TCP_CONNECTION 2011
#defineCR_SERVER_HANDSHAKE_ERR 2012
#defineCR_SERVER_LOST 2013
#defineCR_COMMANDS_OUT_OF_SYNC 2014
#defineCR_NAMEDPIPE_CONNECTION 2015
#defineCR_NAMEDPIPEWAIT_ERROR 2016
#defineCR_NAMEDPIPEOPEN_ERROR 2017
#defineCR_NAMEDPIPESETSTATE_ERROR 2018
#defineCR_CANT_READ_CHARSET 2019
#defineCR_NET_PACKET_TOO_LARGE 2020
#defineCR_EMBEDDED_CONNECTION 2021
#defineCR_PROBE_REPLICA_STATUS 2022
#defineCR_PROBE_REPLICA_HOSTS 2023
#defineCR_PROBE_REPLICA_CONNECT 2024
#defineCR_PROBE_SOURCE_CONNECT 2025
#defineCR_SSL_CONNECTION_ERROR 2026
#defineCR_MALFORMED_PACKET 2027
#defineCR_WRONG_LICENSE 2028
/* new 4.1 error codes */
#defineCR_NULL_POINTER 2029
#defineCR_NO_PREPARE_STMT 2030
#defineCR_PARAMS_NOT_BOUND 2031
#defineCR_DATA_TRUNCATED 2032
#defineCR_NO_PARAMETERS_EXISTS 2033
#defineCR_INVALID_PARAMETER_NO 2034
#defineCR_INVALID_BUFFER_USE 2035
#defineCR_UNSUPPORTED_PARAM_TYPE 2036
#defineCR_SHARED_MEMORY_CONNECTION 2037
#defineCR_SHARED_MEMORY_CONNECT_REQUEST_ERROR 2038
#defineCR_SHARED_MEMORY_CONNECT_ANSWER_ERROR 2039
#defineCR_SHARED_MEMORY_CONNECT_FILE_MAP_ERROR 2040
#defineCR_SHARED_MEMORY_CONNECT_MAP_ERROR 2041
#defineCR_SHARED_MEMORY_FILE_MAP_ERROR 2042
#defineCR_SHARED_MEMORY_MAP_ERROR 2043
#defineCR_SHARED_MEMORY_EVENT_ERROR 2044
#defineCR_SHARED_MEMORY_CONNECT_ABANDONED_ERROR 2045
#defineCR_SHARED_MEMORY_CONNECT_SET_ERROR 2046
#defineCR_CONN_UNKNOW_PROTOCOL 2047
#defineCR_INVALID_CONN_HANDLE 2048
#defineCR_UNUSED_1 2049
#defineCR_FETCH_CANCELED 2050
#defineCR_NO_DATA 2051
#defineCR_NO_STMT_METADATA 2052
#defineCR_NO_RESULT_SET 2053
#defineCR_NOT_IMPLEMENTED 2054
#defineCR_SERVER_LOST_EXTENDED 2055
#defineCR_STMT_CLOSED 2056
#defineCR_NEW_STMT_METADATA 2057
#defineCR_ALREADY_CONNECTED 2058
#defineCR_AUTH_PLUGIN_CANNOT_LOAD 2059
#defineCR_DUPLICATE_CONNECTION_ATTR 2060
#defineCR_AUTH_PLUGIN_ERR 2061
#defineCR_INSECURE_API_ERR 2062
#defineCR_FILE_NAME_TOO_LONG 2063
#defineCR_SSL_FIPS_MODE_ERR 2064
#defineCR_DEPRECATED_COMPRESSION_NOT_SUPPORTED 2065
#defineCR_COMPRESSION_WRONGLY_CONFIGURED 2066
#defineCR_KERBEROS_USER_NOT_FOUND 2067
#defineCR_LOAD_DATA_LOCAL_INFILE_REJECTED 2068
#defineCR_LOAD_DATA_LOCAL_INFILE_REALPATH_FAIL 2069
#defineCR_DNS_SRV_LOOKUP_FAILED 2070
#defineCR_MANDATORY_TRACKER_NOT_FOUND 2071
#defineCR_INVALID_FACTOR_NO 2072
#defineCR_CANT_GET_SESSION_DATA 2073
#defineCR_INVALID_CLIENT_CHARSET 2074
#defineCR_TLS_SERVER_NOT_FOUND 2075
#defineCR_ERROR_LAST/*Copy last error nr:*/ 2075
/* Add error numbers before CR_ERROR_LAST and change it accordingly. */
/* Visual Studio requires '__inline' for C code */
staticinlineconstchar*ER_CLIENT(intclient_errno) {
if (client_errno >= CR_ERROR_FIRST&&client_errno <= CR_ERROR_LAST)
returnclient_errors[client_errno-CR_ERROR_FIRST];
returnclient_errors[CR_UNKNOWN_ERROR-CR_ERROR_FIRST];
}
#endif/* ERRMSG_INCLUDED */