~ubuntu-branches/ubuntu/precise/mysql-5.1/precise

« back to all changes in this revision

Viewing changes to storage/ndb/include/ndbapi/ndberror.h

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Tretkowski
  • Date: 2010-03-17 14:56:02 UTC
  • Revision ID: james.westby@ubuntu.com-20100317145602-x7e30l1b2sb5s6w6
Tags: upstream-5.1.45
ImportĀ upstreamĀ versionĀ 5.1.45

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Copyright (C) 2003 MySQL AB
 
2
 
 
3
   This program is free software; you can redistribute it and/or modify
 
4
   it under the terms of the GNU General Public License as published by
 
5
   the Free Software Foundation; version 2 of the License.
 
6
 
 
7
   This program is distributed in the hope that it will be useful,
 
8
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
9
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
10
   GNU General Public License for more details.
 
11
 
 
12
   You should have received a copy of the GNU General Public License
 
13
   along with this program; if not, write to the Free Software
 
14
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
15
 
 
16
#ifndef NDBERROR_H
 
17
#define NDBERROR_H
 
18
 
 
19
#ifdef __cplusplus
 
20
extern "C" {
 
21
#endif
 
22
 
 
23
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
 
24
 
 
25
typedef enum
 
26
{
 
27
  ndberror_st_success = 0,
 
28
  ndberror_st_temporary = 1,
 
29
  ndberror_st_permanent = 2,
 
30
  ndberror_st_unknown = 3
 
31
} ndberror_status_enum;
 
32
 
 
33
typedef enum
 
34
{
 
35
  ndberror_cl_none = 0,  
 
36
  ndberror_cl_application = 1,  
 
37
  ndberror_cl_no_data_found = 2,
 
38
  ndberror_cl_constraint_violation = 3,
 
39
  ndberror_cl_schema_error = 4,
 
40
  ndberror_cl_user_defined = 5,
 
41
  ndberror_cl_insufficient_space = 6,
 
42
  ndberror_cl_temporary_resource = 7,
 
43
  ndberror_cl_node_recovery = 8,
 
44
  ndberror_cl_overload = 9,
 
45
  ndberror_cl_timeout_expired = 10,
 
46
  ndberror_cl_unknown_result = 11,
 
47
  ndberror_cl_internal_error = 12,
 
48
  ndberror_cl_function_not_implemented = 13,
 
49
  ndberror_cl_unknown_error_code = 14,
 
50
  ndberror_cl_node_shutdown = 15,
 
51
  ndberror_cl_configuration = 16,
 
52
  ndberror_cl_schema_object_already_exists = 17,
 
53
  ndberror_cl_internal_temporary = 18
 
54
} ndberror_classification_enum;
 
55
 
 
56
 
 
57
typedef struct {
 
58
 
 
59
  /**
 
60
   * Error status.  
 
61
   */
 
62
  ndberror_status_enum status;
 
63
 
 
64
  /**
 
65
   * Error type
 
66
   */
 
67
  ndberror_classification_enum classification;
 
68
  
 
69
  /**
 
70
   * Error code
 
71
   */
 
72
  int code;
 
73
 
 
74
  /**
 
75
   * Mysql error code
 
76
   */
 
77
  int mysql_code;
 
78
 
 
79
  /**
 
80
   * Error message
 
81
   */
 
82
  const char * message;
 
83
 
 
84
  /**
 
85
   * The detailed description.  This is extra information regarding the 
 
86
   * error which is not included in the error message.
 
87
   *
 
88
   * @note Is NULL when no details specified
 
89
   */
 
90
  char * details;
 
91
 
 
92
} ndberror_struct;
 
93
 
 
94
 
 
95
typedef ndberror_status_enum ndberror_status;
 
96
typedef  ndberror_classification_enum ndberror_classification;
 
97
 
 
98
const char *ndberror_status_message(ndberror_status);
 
99
const char *ndberror_classification_message(ndberror_classification);
 
100
void ndberror_update(ndberror_struct *);
 
101
int ndb_error_string(int err_no, char *str, int size);
 
102
 
 
103
#endif /* doxygen skip internal*/
 
104
 
 
105
#ifdef __cplusplus
 
106
}
 
107
#endif
 
108
 
 
109
#endif