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