~drizzle-trunk/drizzle/development

971.7.10 by Eric Day
Duplicated oldlibdrizzle module, one for Drizzle protocol and one for MySQL, per Brian's request from merge proposal. Port options are now --drizzle-protocol-port and --mysql-protocol-port.
1
/* - mode: c; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
 *
4
 *  Copyright (C) 2008 Sun Microsystems, Inc.
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
971.7.11 by Eric Day
Fixed header file guards and fixed test cases.
20
#ifndef PLUGIN_MYSQL_PROTOCOL_ERRMSG_H
21
#define PLUGIN_MYSQL_PROTOCOL_ERRMSG_H
971.7.10 by Eric Day
Duplicated oldlibdrizzle module, one for Drizzle protocol and one for MySQL, per Brian's request from merge proposal. Port options are now --drizzle-protocol-port and --mysql-protocol-port.
22
23
/* Error messages for MySQL clients */
24
/* (Error messages for the daemon are in sql/share/errmsg.txt) */
25
26
#ifdef  __cplusplus
27
extern "C"
28
#endif
29
const char * drizzleclient_get_client_error(unsigned int err_index);
30
31
#define CR_MIN_ERROR    2000  /* For easier client code */
32
#define CR_MAX_ERROR    2999
33
#if !defined(ER)
34
#define ER(X) drizzleclient_get_client_error((X)-CR_MIN_ERROR)
35
#endif
36
#define CLIENT_ERRMAP    2  /* Errormap used by my_error() */
37
38
/* Do not add error numbers before CR_ERROR_FIRST. */
39
/* If necessary to add lower numbers, change CR_ERROR_FIRST accordingly. */
40
enum CR_CLIENT_ERRORS {
41
  CR_ERROR_FIRST    =2000, /*Copy first error nr.*/
42
  CR_UNKNOWN_ERROR  =2000,
43
  CR_SOCKET_CREATE_ERROR  =2001,
44
  CR_CONNECTION_ERROR  =2002,
45
  CR_CONN_HOST_ERROR  =2003,
46
  CR_IPSOCK_ERROR    =2004,
47
  CR_UNKNOWN_HOST    =2005,
48
  CR_SERVER_GONE_ERROR  =2006,
49
  CR_VERSION_ERROR  =2007,
50
  CR_OUT_OF_MEMORY  =2008,
51
  CR_WRONG_HOST_INFO  =2009,
52
  CR_LOCALHOST_CONNECTION =2010,
53
  CR_TCP_CONNECTION  =2011,
54
  CR_SERVER_HANDSHAKE_ERR =2012,
55
  CR_SERVER_LOST    =2013,
56
  CR_COMMANDS_OUT_OF_SYNC =2014,
57
  CR_NAMEDPIPE_CONNECTION =2015,
58
  CR_NAMEDPIPEWAIT_ERROR  =2016,
59
  CR_NAMEDPIPEOPEN_ERROR  =2017,
60
  CR_NAMEDPIPESETSTATE_ERROR =2018,
61
  CR_CANT_READ_CHARSET  =2019,
62
  CR_NET_PACKET_TOO_LARGE =2020,
63
  CR_EMBEDDED_CONNECTION  =2021,
64
  CR_PROBE_SLAVE_STATUS   =2022,
65
  CR_PROBE_SLAVE_HOSTS    =2023,
66
  CR_PROBE_SLAVE_CONNECT  =2024,
67
  CR_PROBE_MASTER_CONNECT =2025,
68
  CR_SSL_CONNECTION_ERROR =2026,
69
  CR_MALFORMED_PACKET     =2027,
70
71
  CR_NULL_POINTER    =2029,
72
  CR_NO_PREPARE_STMT  =2030,
73
  CR_PARAMS_NOT_BOUND  =2031,
74
  CR_DATA_TRUNCATED  =2032,
75
  CR_NO_PARAMETERS_EXISTS =2033,
76
  CR_INVALID_PARAMETER_NO =2034,
77
  CR_INVALID_BUFFER_USE  =2035,
78
  CR_UNSUPPORTED_PARAM_TYPE =2036,
79
80
  CR_CONN_UNKNOW_PROTOCOL     =2047,
81
  CR_INVALID_CONN_HANDLE      =2048,
82
  CR_SECURE_AUTH                          =2049,
83
  CR_FETCH_CANCELED                       =2050,
84
  CR_NO_DATA                              =2051,
85
  CR_NO_STMT_METADATA                     =2052,
86
  CR_NO_RESULT_SET                        =2053,
87
  CR_NOT_IMPLEMENTED                      =2054,
88
  CR_SERVER_LOST_INITIAL_COMM_WAIT  =2055,
89
  CR_SERVER_LOST_INITIAL_COMM_READ  =2056,
90
  CR_SERVER_LOST_SEND_AUTH    =2057,
91
  CR_SERVER_LOST_READ_AUTH    =2058,
92
  CR_SERVER_LOST_SETTING_DB    =2059,
93
94
  CR_STMT_CLOSED  =2060,
95
96
  CR_NET_UNCOMPRESS_ERROR= 2061,
97
  CR_NET_READ_ERROR= 2062,
98
  CR_NET_READ_INTERRUPTED= 2063,
99
  CR_NET_ERROR_ON_WRITE= 2064,
100
  CR_NET_WRITE_INTERRUPTED= 2065,
101
102
  /* Add error numbers before CR_ERROR_LAST and change it accordingly. */
103
  CR_ERROR_LAST    =2065 /*Copy last error nr:*/
104
};
105
971.7.11 by Eric Day
Fixed header file guards and fixed test cases.
106
#endif /* PLUGIN_MYSQL_PROTOCOL_ERRMSG_H */