~drizzle-trunk/drizzle/development

1089.1.11 by Brian Aker
Cleanup on enum
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
 *
1999.6.1 by kalebral at gmail
update Copyright strings to a more common format to help with creating the master debian copyright file
4
 *  Copyright (C) 2009 Sun Microsystems, Inc.
1089.1.11 by Brian Aker
Cleanup on enum
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; either version 2 of the License, or
9
 *  (at your option) any later version.
10
 *
11
 *  This program is distributed in the hope that it will be useful,
12
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 *  GNU General Public License for more details.
15
 *
16
 *  You should have received a copy of the GNU General Public License
17
 *  along with this program; if not, write to the Free Software
18
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19
 */
20
21
#ifndef DRIZZLED_ENUM_H
22
#define DRIZZLED_ENUM_H
23
1280.1.10 by Monty Taylor
Put everything in drizzled into drizzled namespace.
24
namespace drizzled
25
{
26
1089.1.11 by Brian Aker
Cleanup on enum
27
/**
28
 * @TODO Move to a separate header?
29
 *
30
 * It's needed by item.h and field.h, which are both inter-dependent
31
 * and contain forward declarations of many structs/classes in the
32
 * other header file.
33
 *
34
 * What is needed is a separate header file that is included
35
 * by *both* item.h and field.h to resolve inter-dependencies
36
 *
37
 * But, probably want to hold off on this until Stew finished the UDF cleanup
38
 */
39
enum Derivation
40
{
41
  DERIVATION_IGNORABLE= 5,
42
  DERIVATION_COERCIBLE= 4,
43
  DERIVATION_SYSCONST= 3,
44
  DERIVATION_IMPLICIT= 2,
45
  DERIVATION_NONE= 1,
46
  DERIVATION_EXPLICIT= 0
47
};
48
49
enum enum_parsing_place
50
{
1240.3.2 by Brian Aker
Cleanup white space.
51
  NO_MATTER,
52
  IN_HAVING,
53
  SELECT_LIST,
54
  IN_WHERE,
55
  IN_ON
1100.2.3 by Brian Aker
Remove final bits on SJ
56
};
1089.1.11 by Brian Aker
Cleanup on enum
57
1240.3.2 by Brian Aker
Cleanup white space.
58
enum enum_mysql_completiontype
1089.1.11 by Brian Aker
Cleanup on enum
59
{
1240.3.2 by Brian Aker
Cleanup white space.
60
  ROLLBACK_RELEASE= -2,
61
  ROLLBACK= 1,
62
  ROLLBACK_AND_CHAIN= 7,
63
  COMMIT_RELEASE= -1,
64
  COMMIT= 0,
1089.1.11 by Brian Aker
Cleanup on enum
65
  COMMIT_AND_CHAIN= 6
66
};
67
68
enum enum_check_fields
69
{
1240.3.2 by Brian Aker
Cleanup white space.
70
  CHECK_FIELD_IGNORE,
71
  CHECK_FIELD_WARN,
1089.1.11 by Brian Aker
Cleanup on enum
72
  CHECK_FIELD_ERROR_FOR_NULL
73
};
74
1273.13.24 by Brian Aker
Updating style, simplified code.
75
enum sql_var_t
1089.1.11 by Brian Aker
Cleanup on enum
76
{
1240.3.2 by Brian Aker
Cleanup white space.
77
  OPT_DEFAULT= 0,
78
  OPT_SESSION,
1089.1.11 by Brian Aker
Cleanup on enum
79
  OPT_GLOBAL
80
};
81
1240.3.2 by Brian Aker
Cleanup white space.
82
enum column_format_type
1089.1.11 by Brian Aker
Cleanup on enum
83
{
84
  COLUMN_FORMAT_TYPE_NOT_USED= -1,
85
  COLUMN_FORMAT_TYPE_DEFAULT= 0,
86
  COLUMN_FORMAT_TYPE_FIXED= 1,
1240.3.2 by Brian Aker
Cleanup white space.
87
  COLUMN_FORMAT_TYPE_DYNAMIC= 2
1089.1.11 by Brian Aker
Cleanup on enum
88
};
89
90
91
/**
92
  Category of table found in the table share.
93
*/
94
enum enum_table_category
95
{
96
  /**
97
    Unknown value.
98
  */
99
  TABLE_UNKNOWN_CATEGORY=0,
100
101
  /**
102
    Temporary table.
103
    The table is visible only in the session.
104
    Therefore,
105
    - FLUSH TABLES WITH READ LOCK
106
    - SET GLOBAL READ_ONLY = ON
107
    do not apply to this table.
108
    Note that LOCK Table t FOR READ/WRITE
109
    can be used on temporary tables.
110
    Temporary tables are not part of the table cache.
111
  */
112
  TABLE_CATEGORY_TEMPORARY=1,
113
114
  /**
115
    User table.
116
    These tables do honor:
117
    - LOCK Table t FOR READ/WRITE
118
    - FLUSH TABLES WITH READ LOCK
119
    - SET GLOBAL READ_ONLY = ON
120
    User tables are cached in the table cache.
121
  */
122
  TABLE_CATEGORY_USER=2,
123
124
  /**
125
    Information schema tables.
126
    These tables are an interface provided by the system
127
    to inspect the system metadata.
128
    These tables do *not* honor:
129
    - LOCK Table t FOR READ/WRITE
130
    - FLUSH TABLES WITH READ LOCK
131
    - SET GLOBAL READ_ONLY = ON
132
    as there is no point in locking explicitely
133
    an INFORMATION_SCHEMA table.
134
    Nothing is directly written to information schema tables.
135
    Note that this value is not used currently,
136
    since information schema tables are not shared,
137
    but implemented as session specific temporary tables.
138
  */
139
  /*
140
    TODO: Fixing the performance issues of I_S will lead
141
    to I_S tables in the table cache, which should use
142
    this table type.
143
  */
144
  TABLE_CATEGORY_INFORMATION
145
};
146
1240.3.2 by Brian Aker
Cleanup white space.
147
enum enum_enable_or_disable
1089.1.11 by Brian Aker
Cleanup on enum
148
{
1240.3.2 by Brian Aker
Cleanup white space.
149
  LEAVE_AS_IS,
150
  ENABLE,
151
  DISABLE
1089.1.11 by Brian Aker
Cleanup on enum
152
};
153
154
155
enum enum_mark_columns
1240.3.2 by Brian Aker
Cleanup white space.
156
{
157
  MARK_COLUMNS_NONE,
158
  MARK_COLUMNS_READ,
1089.1.11 by Brian Aker
Cleanup on enum
159
  MARK_COLUMNS_WRITE
160
};
161
1240.3.2 by Brian Aker
Cleanup white space.
162
enum enum_filetype
163
{
164
  FILETYPE_CSV,
165
  FILETYPE_XML
1089.1.11 by Brian Aker
Cleanup on enum
166
};
167
1240.3.2 by Brian Aker
Cleanup white space.
168
enum find_item_error_report_type
1089.1.11 by Brian Aker
Cleanup on enum
169
{
1240.3.2 by Brian Aker
Cleanup white space.
170
  REPORT_ALL_ERRORS,
1089.1.11 by Brian Aker
Cleanup on enum
171
  REPORT_EXCEPT_NOT_FOUND,
1240.3.2 by Brian Aker
Cleanup white space.
172
  IGNORE_ERRORS,
1089.1.11 by Brian Aker
Cleanup on enum
173
  REPORT_EXCEPT_NON_UNIQUE,
174
  IGNORE_EXCEPT_NON_UNIQUE
175
};
176
177
/*
178
  Values in this enum are used to indicate how a tables TIMESTAMP field
179
  should be treated. It can be set to the current timestamp on insert or
180
  update or both.
181
  WARNING: The values are used for bit operations. If you change the
182
  enum, you must keep the bitwise relation of the values. For example:
183
  (int) TIMESTAMP_AUTO_SET_ON_BOTH must be equal to
184
  (int) TIMESTAMP_AUTO_SET_ON_INSERT | (int) TIMESTAMP_AUTO_SET_ON_UPDATE.
185
  We use an enum here so that the debugger can display the value names.
186
*/
187
enum timestamp_auto_set_type
188
{
1240.3.2 by Brian Aker
Cleanup white space.
189
  TIMESTAMP_NO_AUTO_SET= 0,
1089.1.11 by Brian Aker
Cleanup on enum
190
  TIMESTAMP_AUTO_SET_ON_INSERT= 1,
1240.3.2 by Brian Aker
Cleanup white space.
191
  TIMESTAMP_AUTO_SET_ON_UPDATE= 2,
1089.1.11 by Brian Aker
Cleanup on enum
192
  TIMESTAMP_AUTO_SET_ON_BOTH= 3
193
};
194
1240.3.2 by Brian Aker
Cleanup white space.
195
enum enum_ha_read_modes
196
{
197
  RFIRST,
198
  RNEXT,
199
  RPREV,
200
  RLAST,
201
  RKEY,
202
  RNEXT_SAME
1089.1.11 by Brian Aker
Cleanup on enum
203
};
204
1240.3.2 by Brian Aker
Cleanup white space.
205
enum enum_tx_isolation
1089.1.11 by Brian Aker
Cleanup on enum
206
{
1240.3.2 by Brian Aker
Cleanup white space.
207
  ISO_READ_UNCOMMITTED,
1089.1.11 by Brian Aker
Cleanup on enum
208
  ISO_READ_COMMITTED,
1240.3.2 by Brian Aker
Cleanup white space.
209
  ISO_REPEATABLE_READ,
1089.1.11 by Brian Aker
Cleanup on enum
210
  ISO_SERIALIZABLE
211
};
212
213
1240.3.2 by Brian Aker
Cleanup white space.
214
enum SHOW_COMP_OPTION
215
{
216
  SHOW_OPTION_YES,
217
  SHOW_OPTION_NO,
1089.1.11 by Brian Aker
Cleanup on enum
218
  SHOW_OPTION_DISABLED
219
};
220
221
/*
222
  When a command is added here, be sure it's also added in mysqld.cc
223
  in "struct show_var_st status_vars[]= {" ...
224
225
  If the command returns a result set or is not allowed in stored
226
  functions or triggers, please also make sure that
227
  sp_get_flags_for_command (sp_head.cc) returns proper flags for the
228
  added SQLCOM_.
229
*/
230
231
enum enum_sql_command {
1240.3.2 by Brian Aker
Cleanup white space.
232
  SQLCOM_SELECT,
233
  SQLCOM_CREATE_TABLE,
234
  SQLCOM_CREATE_INDEX,
1089.1.11 by Brian Aker
Cleanup on enum
235
  SQLCOM_ALTER_TABLE,
1240.3.2 by Brian Aker
Cleanup white space.
236
  SQLCOM_UPDATE,
237
  SQLCOM_INSERT,
1089.1.11 by Brian Aker
Cleanup on enum
238
  SQLCOM_INSERT_SELECT,
1240.3.2 by Brian Aker
Cleanup white space.
239
  SQLCOM_DELETE,
240
  SQLCOM_TRUNCATE,
241
  SQLCOM_DROP_TABLE,
1089.1.11 by Brian Aker
Cleanup on enum
242
  SQLCOM_DROP_INDEX,
243
  SQLCOM_SHOW_CREATE,
244
  SQLCOM_SHOW_CREATE_DB,
245
  SQLCOM_LOAD,
246
  SQLCOM_SET_OPTION,
247
  SQLCOM_UNLOCK_TABLES,
1240.3.2 by Brian Aker
Cleanup white space.
248
  SQLCOM_CHANGE_DB,
249
  SQLCOM_CREATE_DB,
250
  SQLCOM_DROP_DB,
1089.1.11 by Brian Aker
Cleanup on enum
251
  SQLCOM_ALTER_DB,
1240.3.2 by Brian Aker
Cleanup white space.
252
  SQLCOM_REPLACE,
1089.1.11 by Brian Aker
Cleanup on enum
253
  SQLCOM_REPLACE_SELECT,
254
  SQLCOM_CHECK,
1240.3.2 by Brian Aker
Cleanup white space.
255
  SQLCOM_FLUSH,
256
  SQLCOM_KILL,
1089.1.11 by Brian Aker
Cleanup on enum
257
  SQLCOM_ANALYZE,
1240.3.2 by Brian Aker
Cleanup white space.
258
  SQLCOM_ROLLBACK,
1089.1.11 by Brian Aker
Cleanup on enum
259
  SQLCOM_ROLLBACK_TO_SAVEPOINT,
1240.3.2 by Brian Aker
Cleanup white space.
260
  SQLCOM_COMMIT,
261
  SQLCOM_SAVEPOINT,
1089.1.11 by Brian Aker
Cleanup on enum
262
  SQLCOM_RELEASE_SAVEPOINT,
263
  SQLCOM_BEGIN,
264
  SQLCOM_RENAME_TABLE,
265
  SQLCOM_SHOW_WARNS,
266
  SQLCOM_EMPTY_QUERY,
267
  SQLCOM_SHOW_ERRORS,
268
  SQLCOM_CHECKSUM,
269
  /*
270
    When a command is added here, be sure it's also added in mysqld.cc
271
    in "struct show_var_st status_vars[]= {" ...
272
  */
273
  /* This should be the last !!! */
274
  SQLCOM_END
275
};
276
1240.3.2 by Brian Aker
Cleanup white space.
277
enum enum_duplicates
278
{
279
  DUP_ERROR,
280
  DUP_REPLACE,
281
  DUP_UPDATE
1089.1.11 by Brian Aker
Cleanup on enum
282
};
283
2060.2.1 by Brian Aker
Merge in SQL reserved word patch
284
enum drizzle_exit_codes
285
{
1271.7.7 by Tim Penhey
Move the error enums into the enum header.
286
  EXIT_UNSPECIFIED_ERROR = 1,
287
  EXIT_UNKNOWN_OPTION,
288
  EXIT_AMBIGUOUS_OPTION,
289
  EXIT_NO_ARGUMENT_ALLOWED,
290
  EXIT_ARGUMENT_REQUIRED,
291
  EXIT_VAR_PREFIX_NOT_UNIQUE,
292
  EXIT_UNKNOWN_VARIABLE,
293
  EXIT_OUT_OF_MEMORY,
294
  EXIT_UNKNOWN_SUFFIX,
295
  EXIT_NO_PTR_TO_VARIABLE,
296
  EXIT_CANNOT_CONNECT_TO_SERVICE,
297
  EXIT_OPTION_DISABLED,
298
  EXIT_ARGUMENT_INVALID
299
};
300
301
1280.1.10 by Monty Taylor
Put everything in drizzled into drizzled namespace.
302
} /* namespace drizzled */
303
1089.1.11 by Brian Aker
Cleanup on enum
304
#endif /* DRIZZLED_ENUM_H */