~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/drizzle_protocol/errmsg.h

  • Committer: Brian Aker
  • Date: 2010-05-27 01:25:56 UTC
  • mfrom: (1567.1.4 new-staging)
  • Revision ID: brian@gaz-20100527012556-5zgkirkl7swbigd6
Merge of Brian, Paul. PBXT compile issue, and test framework cleanup. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* - mode: c; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
3
 *
4
 
 *  Copyright (C) 2008 MySQL
 
4
 *  Copyright (C) 2008 Sun Microsystems, Inc.
5
5
 *
6
6
 *  This program is free software; you can redistribute it and/or modify
7
7
 *  it under the terms of the GNU General Public License as published by
8
 
 *  the Free Software Foundation; either version 2 of the License, or
9
 
 *  (at your option) any later version.
 
8
 *  the Free Software Foundation; version 2 of the License.
10
9
 *
11
10
 *  This program is distributed in the hope that it will be useful,
12
11
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
18
17
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19
18
 */
20
19
 
21
 
#ifndef _libdrizzle_errmsg_h
22
 
#define _libdrizzle_errmsg_h
 
20
#ifndef PLUGIN_DRIZZLE_PROTOCOL_ERRMSG_H
 
21
#define PLUGIN_DRIZZLE_PROTOCOL_ERRMSG_H
 
22
 
 
23
namespace drizzle_protocol
 
24
{
23
25
 
24
26
/* Error messages for MySQL clients */
25
27
/* (Error messages for the daemon are in sql/share/errmsg.txt) */
26
28
 
27
 
#ifdef  __cplusplus
28
 
extern "C" {
29
 
#endif
30
 
const char * get_client_error(unsigned int err_index);
31
 
#ifdef  __cplusplus
32
 
}
33
 
#endif
 
29
const char * drizzleclient_get_client_error(unsigned int err_index);
34
30
 
35
 
#define CR_MIN_ERROR            2000    /* For easier client code */
36
 
#define CR_MAX_ERROR            2999
 
31
#define CR_MIN_ERROR    2000  /* For easier client code */
 
32
#define CR_MAX_ERROR    2999
37
33
#if !defined(ER)
38
 
#define ER(X) get_client_error((X)-CR_MIN_ERROR)
 
34
#define ER(X) drizzleclient_get_client_error((X)-CR_MIN_ERROR)
39
35
#endif
40
 
#define CLIENT_ERRMAP           2       /* Errormap used by my_error() */
 
36
#define CLIENT_ERRMAP    2  /* Errormap used by my_error() */
41
37
 
42
38
/* Do not add error numbers before CR_ERROR_FIRST. */
43
39
/* If necessary to add lower numbers, change CR_ERROR_FIRST accordingly. */
44
 
#define CR_ERROR_FIRST          2000 /*Copy first error nr.*/
45
 
#define CR_UNKNOWN_ERROR        2000
46
 
#define CR_SOCKET_CREATE_ERROR  2001
47
 
#define CR_CONNECTION_ERROR     2002
48
 
#define CR_CONN_HOST_ERROR      2003
49
 
#define CR_IPSOCK_ERROR         2004
50
 
#define CR_UNKNOWN_HOST         2005
51
 
#define CR_SERVER_GONE_ERROR    2006
52
 
#define CR_VERSION_ERROR        2007
53
 
#define CR_OUT_OF_MEMORY        2008
54
 
#define CR_WRONG_HOST_INFO      2009
55
 
#define CR_LOCALHOST_CONNECTION 2010
56
 
#define CR_TCP_CONNECTION       2011
57
 
#define CR_SERVER_HANDSHAKE_ERR 2012
58
 
#define CR_SERVER_LOST          2013
59
 
#define CR_COMMANDS_OUT_OF_SYNC 2014
60
 
#define CR_NAMEDPIPE_CONNECTION 2015
61
 
#define CR_NAMEDPIPEWAIT_ERROR  2016
62
 
#define CR_NAMEDPIPEOPEN_ERROR  2017
63
 
#define CR_NAMEDPIPESETSTATE_ERROR 2018
64
 
#define CR_CANT_READ_CHARSET    2019
65
 
#define CR_NET_PACKET_TOO_LARGE 2020
66
 
#define CR_EMBEDDED_CONNECTION  2021
67
 
#define CR_PROBE_SLAVE_STATUS   2022
68
 
#define CR_PROBE_SLAVE_HOSTS    2023
69
 
#define CR_PROBE_SLAVE_CONNECT  2024
70
 
#define CR_PROBE_MASTER_CONNECT 2025
71
 
#define CR_SSL_CONNECTION_ERROR 2026
72
 
#define CR_MALFORMED_PACKET     2027
73
 
#define CR_WRONG_LICENSE        2028
74
 
 
75
 
/* new 4.1 error codes */
76
 
#define CR_NULL_POINTER         2029
77
 
#define CR_NO_PREPARE_STMT      2030
78
 
#define CR_PARAMS_NOT_BOUND     2031
79
 
#define CR_DATA_TRUNCATED       2032
80
 
#define CR_NO_PARAMETERS_EXISTS 2033
81
 
#define CR_INVALID_PARAMETER_NO 2034
82
 
#define CR_INVALID_BUFFER_USE   2035
83
 
#define CR_UNSUPPORTED_PARAM_TYPE 2036
84
 
 
85
 
#define CR_SHARED_MEMORY_CONNECTION             2037
86
 
#define CR_SHARED_MEMORY_CONNECT_REQUEST_ERROR  2038
87
 
#define CR_SHARED_MEMORY_CONNECT_ANSWER_ERROR   2039
88
 
#define CR_SHARED_MEMORY_CONNECT_FILE_MAP_ERROR 2040
89
 
#define CR_SHARED_MEMORY_CONNECT_MAP_ERROR      2041
90
 
#define CR_SHARED_MEMORY_FILE_MAP_ERROR         2042
91
 
#define CR_SHARED_MEMORY_MAP_ERROR              2043
92
 
#define CR_SHARED_MEMORY_EVENT_ERROR            2044
93
 
#define CR_SHARED_MEMORY_CONNECT_ABANDONED_ERROR 2045
94
 
#define CR_SHARED_MEMORY_CONNECT_SET_ERROR      2046
95
 
#define CR_CONN_UNKNOW_PROTOCOL                 2047
96
 
#define CR_INVALID_CONN_HANDLE                  2048
97
 
#define CR_SECURE_AUTH                          2049
98
 
#define CR_FETCH_CANCELED                       2050
99
 
#define CR_NO_DATA                              2051
100
 
#define CR_NO_STMT_METADATA                     2052
101
 
#define CR_NO_RESULT_SET                        2053
102
 
#define CR_NOT_IMPLEMENTED                      2054
103
 
#define CR_SERVER_LOST_EXTENDED                 2055
104
 
#define CR_STMT_CLOSED                          2056
105
 
#define CR_ERROR_LAST  /*Copy last error nr:*/  2056
106
 
/* Add error numbers before CR_ERROR_LAST and change it accordingly. */
107
 
 
108
 
 
109
 
#endif
 
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
 
 
106
} /* namespace drizzle_protocol */
 
107
 
 
108
#endif /* PLUGIN_DRIZZLE_PROTOCOL_ERRMSG_H */