1#ifndef ERRMSG_INCLUDED
2#define ERRMSG_INCLUDED
3
4/* Copyright (c) 2000, 2014, 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 as published by
8 the Free Software Foundation; version 2 of the License.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
18
19/*
20 Error messages numbers for MySQL clients.
21 The error messages itself are in libmysql/errmsg.c
22
23 Error messages for the mysqld daemon are in sql/share/errmsg.txt
24*/
25
26#ifdef __cplusplus
27extern "C" {
28#endif
29void init_client_errs(void);
30void finish_client_errs(void);
31extern const char *client_errors[]; /* Error messages */
32#ifdef __cplusplus
33}
34#endif
35
36#define CR_MIN_ERROR 2000 /* For easier client code */
37#define CR_MAX_ERROR 2999
38#if !defined(ER)
39#define ER(X) (((X) >= CR_ERROR_FIRST && (X) <= CR_ERROR_LAST)? \
40 client_errors[(X)-CR_ERROR_FIRST]: client_errors[CR_UNKNOWN_ERROR])
41
42#endif
43#define CLIENT_ERRMAP 2 /* Errormap used by my_error() */
44
45/* Do not add error numbers before CR_ERROR_FIRST. */
46/* If necessary to add lower numbers, change CR_ERROR_FIRST accordingly. */
47#define CR_ERROR_FIRST 2000 /*Copy first error nr.*/
48#define CR_UNKNOWN_ERROR 2000
49#define CR_SOCKET_CREATE_ERROR 2001
50#define CR_CONNECTION_ERROR 2002
51#define CR_CONN_HOST_ERROR 2003
52#define CR_IPSOCK_ERROR 2004
53#define CR_UNKNOWN_HOST 2005
54#define CR_SERVER_GONE_ERROR 2006
55#define CR_VERSION_ERROR 2007
56#define CR_OUT_OF_MEMORY 2008
57#define CR_WRONG_HOST_INFO 2009
58#define CR_LOCALHOST_CONNECTION 2010
59#define CR_TCP_CONNECTION 2011
60#define CR_SERVER_HANDSHAKE_ERR 2012
61#define CR_SERVER_LOST 2013
62#define CR_COMMANDS_OUT_OF_SYNC 2014
63#define CR_NAMEDPIPE_CONNECTION 2015
64#define CR_NAMEDPIPEWAIT_ERROR 2016
65#define CR_NAMEDPIPEOPEN_ERROR 2017
66#define CR_NAMEDPIPESETSTATE_ERROR 2018
67#define CR_CANT_READ_CHARSET 2019
68#define CR_NET_PACKET_TOO_LARGE 2020
69#define CR_EMBEDDED_CONNECTION 2021
70#define CR_PROBE_SLAVE_STATUS 2022
71#define CR_PROBE_SLAVE_HOSTS 2023
72#define CR_PROBE_SLAVE_CONNECT 2024
73#define CR_PROBE_MASTER_CONNECT 2025
74#define CR_SSL_CONNECTION_ERROR 2026
75#define CR_MALFORMED_PACKET 2027
76#define CR_WRONG_LICENSE 2028
77
78/* new 4.1 error codes */
79#define CR_NULL_POINTER 2029
80#define CR_NO_PREPARE_STMT 2030
81#define CR_PARAMS_NOT_BOUND 2031
82#define CR_DATA_TRUNCATED 2032
83#define CR_NO_PARAMETERS_EXISTS 2033
84#define CR_INVALID_PARAMETER_NO 2034
85#define CR_INVALID_BUFFER_USE 2035
86#define CR_UNSUPPORTED_PARAM_TYPE 2036
87
88#define CR_SHARED_MEMORY_CONNECTION 2037
89#define CR_SHARED_MEMORY_CONNECT_REQUEST_ERROR 2038
90#define CR_SHARED_MEMORY_CONNECT_ANSWER_ERROR 2039
91#define CR_SHARED_MEMORY_CONNECT_FILE_MAP_ERROR 2040
92#define CR_SHARED_MEMORY_CONNECT_MAP_ERROR 2041
93#define CR_SHARED_MEMORY_FILE_MAP_ERROR 2042
94#define CR_SHARED_MEMORY_MAP_ERROR 2043
95#define CR_SHARED_MEMORY_EVENT_ERROR 2044
96#define CR_SHARED_MEMORY_CONNECT_ABANDONED_ERROR 2045
97#define CR_SHARED_MEMORY_CONNECT_SET_ERROR 2046
98#define CR_CONN_UNKNOW_PROTOCOL 2047
99#define CR_INVALID_CONN_HANDLE 2048
100#define CR_SECURE_AUTH 2049
101#define CR_FETCH_CANCELED 2050
102#define CR_NO_DATA 2051
103#define CR_NO_STMT_METADATA 2052
104#define CR_NO_RESULT_SET 2053
105#define CR_NOT_IMPLEMENTED 2054
106#define CR_SERVER_LOST_EXTENDED 2055
107#define CR_STMT_CLOSED 2056
108#define CR_NEW_STMT_METADATA 2057
109#define CR_ALREADY_CONNECTED 2058
110#define CR_AUTH_PLUGIN_CANNOT_LOAD 2059
111#define CR_DUPLICATE_CONNECTION_ATTR 2060
112#define CR_AUTH_PLUGIN_ERR 2061
113#define CR_ERROR_LAST /*Copy last error nr:*/ 2061
114/* Add error numbers before CR_ERROR_LAST and change it accordingly. */
115
116#endif /* ERRMSG_INCLUDED */
117