|
1 | | -#ifndef ERRMSG_INCLUDED |
2 | | -#define ERRMSG_INCLUDED |
3 | | - |
4 | | -/* Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved. |
5 | | -
|
6 | | - This program is free software; you can redistribute it and/or modify |
7 | | - it under the terms of the GNU General Public License, version 2.0, |
8 | | - as published by the Free Software Foundation. |
9 | | -
|
10 | | - This program is also distributed with certain software (including |
11 | | - but not limited to OpenSSL) that is licensed under separate terms, |
12 | | - as designated in a particular file or component or in included license |
13 | | - documentation. The authors of MySQL hereby grant you an additional |
14 | | - permission to link the program and your derivative works with the |
15 | | - separately licensed software that they have included with MySQL. |
16 | | -
|
17 | | - Without limiting anything contained in the foregoing, this file, |
18 | | - which is part of C Driver for MySQL (Connector/C), is also subject to the |
19 | | - Universal FOSS Exception, version 1.0, a copy of which can be found at |
20 | | - http://oss.oracle.com/licenses/universal-foss-exception. |
21 | | -
|
22 | | - This program is distributed in the hope that it will be useful, |
| 1 | +/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB |
| 2 | + 2012-2016 SkySQL AB, MariaDB Corporation AB |
| 3 | + |
| 4 | + This library is free software; you can redistribute it and/or |
| 5 | + modify it under the terms of the GNU Library General Public |
| 6 | + License as published by the Free Software Foundation; either |
| 7 | + version 2 of the License, or (at your option) any later version. |
| 8 | + |
| 9 | + This library is distributed in the hope that it will be useful, |
23 | 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
24 | | - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
25 | | - GNU General Public License, version 2.0, for more details. |
26 | | -
|
27 | | - You should have received a copy of the GNU General Public License |
28 | | - along with this program; if not, write to the Free Software |
29 | | - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ |
30 | | - |
31 | | -/** |
32 | | - @file include/errmsg.h |
33 | | -
|
34 | | - Error messages for MySQL clients. |
35 | | - These are constant and use the CR_ prefix. |
36 | | - <mysqlclient_ername.h> will contain auto-generated mappings |
37 | | - containing the symbolic name and the number from this file, |
38 | | - and the english error messages in libmysql/errmsg.c. |
39 | | -
|
40 | | - Dynamic error messages for the daemon are in share/language/errmsg.sys. |
41 | | - The server equivalent to <errmsg.h> is <mysqld_error.h>. |
42 | | - The server equivalent to <mysqlclient_ername.h> is <mysqld_ername.h>. |
43 | | -
|
44 | | - Note that the auth subsystem also uses codes with a CR_ prefix. |
45 | | -*/ |
46 | | - |
47 | | -void init_client_errs(void); |
48 | | -void finish_client_errs(void); |
49 | | -extern const char *client_errors[]; /* Error messages */ |
50 | | - |
51 | | -#define CR_MIN_ERROR 2000 /* For easier client code */ |
52 | | -#define CR_MAX_ERROR 2999 |
53 | | -#define CLIENT_ERRMAP 2 /* Errormap used by my_error() */ |
54 | | - |
55 | | -/* Do not add error numbers before CR_ERROR_FIRST. */ |
56 | | -/* If necessary to add lower numbers, change CR_ERROR_FIRST accordingly. */ |
57 | | -#define CR_ERROR_FIRST 2000 /*Copy first error nr.*/ |
58 | | -#define CR_UNKNOWN_ERROR 2000 |
59 | | -#define CR_SOCKET_CREATE_ERROR 2001 |
60 | | -#define CR_CONNECTION_ERROR 2002 |
61 | | -#define CR_CONN_HOST_ERROR 2003 |
62 | | -#define CR_IPSOCK_ERROR 2004 |
63 | | -#define CR_UNKNOWN_HOST 2005 |
64 | | -#define CR_SERVER_GONE_ERROR 2006 |
65 | | -#define CR_VERSION_ERROR 2007 |
66 | | -#define CR_OUT_OF_MEMORY 2008 |
67 | | -#define CR_WRONG_HOST_INFO 2009 |
| 11 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 12 | + Library General Public License for more details. |
| 13 | + |
| 14 | + You should have received a copy of the GNU Library General Public |
| 15 | + License along with this library; if not, write to the Free |
| 16 | + Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
| 17 | + MA 02111-1301, USA */ |
| 18 | + |
| 19 | +/* Error messages for mysql clients */ |
| 20 | +/* error messages for the demon is in share/language/errmsg.sys */ |
| 21 | +#ifndef _errmsg_h_ |
| 22 | +#define _errmsg_h_ |
| 23 | + |
| 24 | +#ifdef __cplusplus |
| 25 | +extern "C" { |
| 26 | +#endif |
| 27 | +void init_client_errs(void); |
| 28 | +extern const char *client_errors[]; /* Error messages */ |
| 29 | +extern const char *mariadb_client_errors[]; /* Error messages */ |
| 30 | +#ifdef __cplusplus |
| 31 | +} |
| 32 | +#endif |
| 33 | + |
| 34 | + |
| 35 | + |
| 36 | +#define CR_MIN_ERROR 2000 /* For easier client code */ |
| 37 | +#define CR_MAX_ERROR 2999 |
| 38 | +#define CER_MIN_ERROR 5000 |
| 39 | +#define CER_MAX_ERROR 5999 |
| 40 | +#define CER(X) mariadb_client_errors[(X)-CER_MIN_ERROR] |
| 41 | +#define ER(X) client_errors[(X)-CR_MIN_ERROR] |
| 42 | +#define CLIENT_ERRMAP 2 /* Errormap used by ma_error() */ |
| 43 | + |
| 44 | +#define CR_UNKNOWN_ERROR 2000 |
| 45 | +#define CR_SOCKET_CREATE_ERROR 2001 |
| 46 | +#define CR_CONNECTION_ERROR 2002 |
| 47 | +#define CR_CONN_HOST_ERROR 2003 /* never sent to a client, message only */ |
| 48 | +#define CR_IPSOCK_ERROR 2004 |
| 49 | +#define CR_UNKNOWN_HOST 2005 |
| 50 | +#define CR_SERVER_GONE_ERROR 2006 /* disappeared _between_ queries */ |
| 51 | +#define CR_VERSION_ERROR 2007 |
| 52 | +#define CR_OUT_OF_MEMORY 2008 |
| 53 | +#define CR_WRONG_HOST_INFO 2009 |
68 | 54 | #define CR_LOCALHOST_CONNECTION 2010 |
69 | | -#define CR_TCP_CONNECTION 2011 |
| 55 | +#define CR_TCP_CONNECTION 2011 |
70 | 56 | #define CR_SERVER_HANDSHAKE_ERR 2012 |
71 | | -#define CR_SERVER_LOST 2013 |
| 57 | +#define CR_SERVER_LOST 2013 /* disappeared _during_ a query */ |
72 | 58 | #define CR_COMMANDS_OUT_OF_SYNC 2014 |
73 | 59 | #define CR_NAMEDPIPE_CONNECTION 2015 |
74 | 60 | #define CR_NAMEDPIPEWAIT_ERROR 2016 |
75 | 61 | #define CR_NAMEDPIPEOPEN_ERROR 2017 |
76 | 62 | #define CR_NAMEDPIPESETSTATE_ERROR 2018 |
77 | | -#define CR_CANT_READ_CHARSET 2019 |
| 63 | +#define CR_CANT_READ_CHARSET 2019 |
78 | 64 | #define CR_NET_PACKET_TOO_LARGE 2020 |
79 | | -#define CR_EMBEDDED_CONNECTION 2021 |
80 | | -#define CR_PROBE_SLAVE_STATUS 2022 |
81 | | -#define CR_PROBE_SLAVE_HOSTS 2023 |
82 | | -#define CR_PROBE_SLAVE_CONNECT 2024 |
83 | | -#define CR_PROBE_MASTER_CONNECT 2025 |
84 | 65 | #define CR_SSL_CONNECTION_ERROR 2026 |
85 | | -#define CR_MALFORMED_PACKET 2027 |
86 | | -#define CR_WRONG_LICENSE 2028 |
87 | | - |
88 | | -/* new 4.1 error codes */ |
89 | | -#define CR_NULL_POINTER 2029 |
90 | | -#define CR_NO_PREPARE_STMT 2030 |
91 | | -#define CR_PARAMS_NOT_BOUND 2031 |
92 | | -#define CR_DATA_TRUNCATED 2032 |
93 | | -#define CR_NO_PARAMETERS_EXISTS 2033 |
94 | | -#define CR_INVALID_PARAMETER_NO 2034 |
95 | | -#define CR_INVALID_BUFFER_USE 2035 |
| 66 | +#define CR_MALFORMED_PACKET 2027 |
| 67 | +#define CR_NO_PREPARE_STMT 2030 |
| 68 | +#define CR_PARAMS_NOT_BOUND 2031 |
| 69 | +#define CR_INVALID_PARAMETER_NO 2034 |
| 70 | +#define CR_INVALID_BUFFER_USE 2035 |
96 | 71 | #define CR_UNSUPPORTED_PARAM_TYPE 2036 |
97 | 72 |
|
98 | 73 | #define CR_SHARED_MEMORY_CONNECTION 2037 |
99 | | -#define CR_SHARED_MEMORY_CONNECT_REQUEST_ERROR 2038 |
100 | | -#define CR_SHARED_MEMORY_CONNECT_ANSWER_ERROR 2039 |
101 | | -#define CR_SHARED_MEMORY_CONNECT_FILE_MAP_ERROR 2040 |
102 | | -#define CR_SHARED_MEMORY_CONNECT_MAP_ERROR 2041 |
103 | | -#define CR_SHARED_MEMORY_FILE_MAP_ERROR 2042 |
104 | | -#define CR_SHARED_MEMORY_MAP_ERROR 2043 |
105 | | -#define CR_SHARED_MEMORY_EVENT_ERROR 2044 |
106 | | -#define CR_SHARED_MEMORY_CONNECT_ABANDONED_ERROR 2045 |
107 | | -#define CR_SHARED_MEMORY_CONNECT_SET_ERROR 2046 |
108 | | -#define CR_CONN_UNKNOW_PROTOCOL 2047 |
109 | | -#define CR_INVALID_CONN_HANDLE 2048 |
110 | | -#define CR_UNUSED_1 2049 |
111 | | -#define CR_FETCH_CANCELED 2050 |
112 | | -#define CR_NO_DATA 2051 |
113 | | -#define CR_NO_STMT_METADATA 2052 |
114 | | -#define CR_NO_RESULT_SET 2053 |
115 | | -#define CR_NOT_IMPLEMENTED 2054 |
116 | | -#define CR_SERVER_LOST_EXTENDED 2055 |
117 | | -#define CR_STMT_CLOSED 2056 |
118 | | -#define CR_NEW_STMT_METADATA 2057 |
119 | | -#define CR_ALREADY_CONNECTED 2058 |
| 74 | +#define CR_SHARED_MEMORY_CONNECT_ERROR 2038 |
| 75 | + |
| 76 | +#define CR_CONN_UNKNOWN_PROTOCOL 2047 |
| 77 | +#define CR_SECURE_AUTH 2049 |
| 78 | +#define CR_NO_DATA 2051 |
| 79 | +#define CR_NO_STMT_METADATA 2052 |
| 80 | +#define CR_NOT_IMPLEMENTED 2054 |
| 81 | +#define CR_SERVER_LOST_EXTENDED 2055 /* never sent to a client, message only */ |
| 82 | +#define CR_STMT_CLOSED 2056 |
| 83 | +#define CR_NEW_STMT_METADATA 2057 |
| 84 | +#define CR_ALREADY_CONNECTED 2058 |
120 | 85 | #define CR_AUTH_PLUGIN_CANNOT_LOAD 2059 |
121 | 86 | #define CR_DUPLICATE_CONNECTION_ATTR 2060 |
122 | 87 | #define CR_AUTH_PLUGIN_ERR 2061 |
123 | | -#define CR_INSECURE_API_ERR 2062 |
124 | | -#define CR_FILE_NAME_TOO_LONG 2063 |
125 | | -#define CR_SSL_FIPS_MODE_ERR 2064 |
126 | | -#define CR_DEPRECATED_COMPRESSION_NOT_SUPPORTED 2065 |
127 | | -#define CR_COMPRESSION_WRONGLY_CONFIGURED 2066 |
128 | | -#define CR_KERBEROS_USER_NOT_FOUND 2067 |
129 | | -#define CR_LOAD_DATA_LOCAL_INFILE_REJECTED 2068 |
130 | | -#define CR_LOAD_DATA_LOCAL_INFILE_REALPATH_FAIL 2069 |
131 | | -#define CR_ERROR_LAST /*Copy last error nr:*/ 2069 |
132 | | -/* Add error numbers before CR_ERROR_LAST and change it accordingly. */ |
133 | | - |
134 | | -/* Visual Studio requires '__inline' for C code */ |
135 | | -static inline const char *ER_CLIENT(int client_errno) { |
136 | | - if (client_errno >= CR_ERROR_FIRST && client_errno <= CR_ERROR_LAST) |
137 | | - return client_errors[client_errno - CR_ERROR_FIRST]; |
138 | | - return client_errors[CR_UNKNOWN_ERROR]; |
139 | | -} |
140 | | - |
141 | | -#endif /* ERRMSG_INCLUDED */ |
| 88 | +/* Always last, if you add new error codes please update the |
| 89 | + value for CR_MYSQL_LAST_ERROR */ |
| 90 | +#define CR_MYSQL_LAST_ERROR CR_AUTH_PLUGIN_ERR |
| 91 | + |
| 92 | +/* |
| 93 | + * MariaDB Connector/C errors: |
| 94 | + */ |
| 95 | +#define CR_EVENT_CREATE_FAILED 5000 |
| 96 | +#define CR_BIND_ADDR_FAILED 5001 |
| 97 | +#define CR_ASYNC_NOT_SUPPORTED 5002 |
| 98 | +#define CR_FUNCTION_NOT_SUPPORTED 5003 |
| 99 | +#define CR_FILE_NOT_FOUND 5004 |
| 100 | +#define CR_FILE_READ 5005 |
| 101 | +#define CR_BULK_WITHOUT_PARAMETERS 5006 |
| 102 | +#define CR_INVALID_STMT 5007 |
| 103 | +#define CR_VERSION_MISMATCH 5008 |
| 104 | +/* Always last, if you add new error codes please update the |
| 105 | + value for CR_MARIADB_LAST_ERROR */ |
| 106 | +#define CR_MARIADB_LAST_ERROR CR_VERSION_MISMATCH |
| 107 | +#endif |
0 commit comments