~drizzle-trunk/drizzle/development

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