~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
 *
4
 *  Copyright (C) 2009 Sun Microsystems
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 row_type
111
{
112
  ROW_TYPE_NOT_USED=-1,
113
  ROW_TYPE_DEFAULT,
1089.1.11 by Brian Aker
Cleanup on enum
114
  ROW_TYPE_FIXED,
1240.3.2 by Brian Aker
Cleanup white space.
115
  ROW_TYPE_DYNAMIC,
1089.1.11 by Brian Aker
Cleanup on enum
116
  ROW_TYPE_COMPRESSED,
1240.3.2 by Brian Aker
Cleanup white space.
117
  ROW_TYPE_REDUNDANT,
118
  ROW_TYPE_COMPACT,
119
  ROW_TYPE_PAGE
1089.1.11 by Brian Aker
Cleanup on enum
120
};
121
1240.3.2 by Brian Aker
Cleanup white space.
122
enum column_format_type
1089.1.11 by Brian Aker
Cleanup on enum
123
{
124
  COLUMN_FORMAT_TYPE_NOT_USED= -1,
125
  COLUMN_FORMAT_TYPE_DEFAULT= 0,
126
  COLUMN_FORMAT_TYPE_FIXED= 1,
1240.3.2 by Brian Aker
Cleanup white space.
127
  COLUMN_FORMAT_TYPE_DYNAMIC= 2
1089.1.11 by Brian Aker
Cleanup on enum
128
};
129
130
131
/**
132
  Category of table found in the table share.
133
*/
134
enum enum_table_category
135
{
136
  /**
137
    Unknown value.
138
  */
139
  TABLE_UNKNOWN_CATEGORY=0,
140
141
  /**
142
    Temporary table.
143
    The table is visible only in the session.
144
    Therefore,
145
    - FLUSH TABLES WITH READ LOCK
146
    - SET GLOBAL READ_ONLY = ON
147
    do not apply to this table.
148
    Note that LOCK Table t FOR READ/WRITE
149
    can be used on temporary tables.
150
    Temporary tables are not part of the table cache.
151
  */
152
  TABLE_CATEGORY_TEMPORARY=1,
153
154
  /**
155
    User table.
156
    These tables do honor:
157
    - LOCK Table t FOR READ/WRITE
158
    - FLUSH TABLES WITH READ LOCK
159
    - SET GLOBAL READ_ONLY = ON
160
    User tables are cached in the table cache.
161
  */
162
  TABLE_CATEGORY_USER=2,
163
164
  /**
165
    Information schema tables.
166
    These tables are an interface provided by the system
167
    to inspect the system metadata.
168
    These tables do *not* honor:
169
    - LOCK Table t FOR READ/WRITE
170
    - FLUSH TABLES WITH READ LOCK
171
    - SET GLOBAL READ_ONLY = ON
172
    as there is no point in locking explicitely
173
    an INFORMATION_SCHEMA table.
174
    Nothing is directly written to information schema tables.
175
    Note that this value is not used currently,
176
    since information schema tables are not shared,
177
    but implemented as session specific temporary tables.
178
  */
179
  /*
180
    TODO: Fixing the performance issues of I_S will lead
181
    to I_S tables in the table cache, which should use
182
    this table type.
183
  */
184
  TABLE_CATEGORY_INFORMATION
185
};
186
1240.3.2 by Brian Aker
Cleanup white space.
187
enum enum_enable_or_disable
1089.1.11 by Brian Aker
Cleanup on enum
188
{
1240.3.2 by Brian Aker
Cleanup white space.
189
  LEAVE_AS_IS,
190
  ENABLE,
191
  DISABLE
1089.1.11 by Brian Aker
Cleanup on enum
192
};
193
194
195
enum enum_mark_columns
1240.3.2 by Brian Aker
Cleanup white space.
196
{
197
  MARK_COLUMNS_NONE,
198
  MARK_COLUMNS_READ,
1089.1.11 by Brian Aker
Cleanup on enum
199
  MARK_COLUMNS_WRITE
200
};
201
1240.3.2 by Brian Aker
Cleanup white space.
202
enum enum_filetype
203
{
204
  FILETYPE_CSV,
205
  FILETYPE_XML
1089.1.11 by Brian Aker
Cleanup on enum
206
};
207
1240.3.2 by Brian Aker
Cleanup white space.
208
enum find_item_error_report_type
1089.1.11 by Brian Aker
Cleanup on enum
209
{
1240.3.2 by Brian Aker
Cleanup white space.
210
  REPORT_ALL_ERRORS,
1089.1.11 by Brian Aker
Cleanup on enum
211
  REPORT_EXCEPT_NOT_FOUND,
1240.3.2 by Brian Aker
Cleanup white space.
212
  IGNORE_ERRORS,
1089.1.11 by Brian Aker
Cleanup on enum
213
  REPORT_EXCEPT_NON_UNIQUE,
214
  IGNORE_EXCEPT_NON_UNIQUE
215
};
216
217
enum tmp_table_type
218
{
1309.2.16 by Brian Aker
Small name change (AKA... I hate reading the NO_**@##@$# logic).
219
  STANDARD_TABLE,
1235.1.3 by Brian Aker
Remove the need for trans/non-trans temp tables for lock conditions.
220
  TEMP_TABLE,
221
  INTERNAL_TMP_TABLE,
1217.1.2 by Brian Aker
Remove dead TMP_TABLE_FRM_FILE_ONLY enum type for tmp tables.
222
  SYSTEM_TMP_TABLE
1089.1.11 by Brian Aker
Cleanup on enum
223
};
224
225
/*
226
  Values in this enum are used to indicate how a tables TIMESTAMP field
227
  should be treated. It can be set to the current timestamp on insert or
228
  update or both.
229
  WARNING: The values are used for bit operations. If you change the
230
  enum, you must keep the bitwise relation of the values. For example:
231
  (int) TIMESTAMP_AUTO_SET_ON_BOTH must be equal to
232
  (int) TIMESTAMP_AUTO_SET_ON_INSERT | (int) TIMESTAMP_AUTO_SET_ON_UPDATE.
233
  We use an enum here so that the debugger can display the value names.
234
*/
235
enum timestamp_auto_set_type
236
{
1240.3.2 by Brian Aker
Cleanup white space.
237
  TIMESTAMP_NO_AUTO_SET= 0,
1089.1.11 by Brian Aker
Cleanup on enum
238
  TIMESTAMP_AUTO_SET_ON_INSERT= 1,
1240.3.2 by Brian Aker
Cleanup white space.
239
  TIMESTAMP_AUTO_SET_ON_UPDATE= 2,
1089.1.11 by Brian Aker
Cleanup on enum
240
  TIMESTAMP_AUTO_SET_ON_BOTH= 3
241
};
242
1240.3.2 by Brian Aker
Cleanup white space.
243
enum enum_ha_read_modes
244
{
245
  RFIRST,
246
  RNEXT,
247
  RPREV,
248
  RLAST,
249
  RKEY,
250
  RNEXT_SAME
1089.1.11 by Brian Aker
Cleanup on enum
251
};
252
1240.3.2 by Brian Aker
Cleanup white space.
253
enum enum_tx_isolation
1089.1.11 by Brian Aker
Cleanup on enum
254
{
1240.3.2 by Brian Aker
Cleanup white space.
255
  ISO_READ_UNCOMMITTED,
1089.1.11 by Brian Aker
Cleanup on enum
256
  ISO_READ_COMMITTED,
1240.3.2 by Brian Aker
Cleanup white space.
257
  ISO_REPEATABLE_READ,
1089.1.11 by Brian Aker
Cleanup on enum
258
  ISO_SERIALIZABLE
259
};
260
261
1240.3.2 by Brian Aker
Cleanup white space.
262
enum SHOW_COMP_OPTION
263
{
264
  SHOW_OPTION_YES,
265
  SHOW_OPTION_NO,
1089.1.11 by Brian Aker
Cleanup on enum
266
  SHOW_OPTION_DISABLED
267
};
268
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
  If the command returns a result set or is not allowed in stored
274
  functions or triggers, please also make sure that
275
  sp_get_flags_for_command (sp_head.cc) returns proper flags for the
276
  added SQLCOM_.
277
*/
278
279
enum enum_sql_command {
1240.3.2 by Brian Aker
Cleanup white space.
280
  SQLCOM_SELECT,
281
  SQLCOM_CREATE_TABLE,
282
  SQLCOM_CREATE_INDEX,
1089.1.11 by Brian Aker
Cleanup on enum
283
  SQLCOM_ALTER_TABLE,
1240.3.2 by Brian Aker
Cleanup white space.
284
  SQLCOM_UPDATE,
285
  SQLCOM_INSERT,
1089.1.11 by Brian Aker
Cleanup on enum
286
  SQLCOM_INSERT_SELECT,
1240.3.2 by Brian Aker
Cleanup white space.
287
  SQLCOM_DELETE,
288
  SQLCOM_TRUNCATE,
289
  SQLCOM_DROP_TABLE,
1089.1.11 by Brian Aker
Cleanup on enum
290
  SQLCOM_DROP_INDEX,
291
  SQLCOM_SHOW_CREATE,
292
  SQLCOM_SHOW_CREATE_DB,
293
  SQLCOM_LOAD,
294
  SQLCOM_SET_OPTION,
295
  SQLCOM_UNLOCK_TABLES,
1240.3.2 by Brian Aker
Cleanup white space.
296
  SQLCOM_CHANGE_DB,
297
  SQLCOM_CREATE_DB,
298
  SQLCOM_DROP_DB,
1089.1.11 by Brian Aker
Cleanup on enum
299
  SQLCOM_ALTER_DB,
1240.3.2 by Brian Aker
Cleanup white space.
300
  SQLCOM_REPLACE,
1089.1.11 by Brian Aker
Cleanup on enum
301
  SQLCOM_REPLACE_SELECT,
302
  SQLCOM_CHECK,
1240.3.2 by Brian Aker
Cleanup white space.
303
  SQLCOM_FLUSH,
304
  SQLCOM_KILL,
1089.1.11 by Brian Aker
Cleanup on enum
305
  SQLCOM_ANALYZE,
1240.3.2 by Brian Aker
Cleanup white space.
306
  SQLCOM_ROLLBACK,
1089.1.11 by Brian Aker
Cleanup on enum
307
  SQLCOM_ROLLBACK_TO_SAVEPOINT,
1240.3.2 by Brian Aker
Cleanup white space.
308
  SQLCOM_COMMIT,
309
  SQLCOM_SAVEPOINT,
1089.1.11 by Brian Aker
Cleanup on enum
310
  SQLCOM_RELEASE_SAVEPOINT,
311
  SQLCOM_BEGIN,
312
  SQLCOM_RENAME_TABLE,
313
  SQLCOM_SHOW_WARNS,
314
  SQLCOM_EMPTY_QUERY,
315
  SQLCOM_SHOW_ERRORS,
316
  SQLCOM_CHECKSUM,
317
  /*
318
    When a command is added here, be sure it's also added in mysqld.cc
319
    in "struct show_var_st status_vars[]= {" ...
320
  */
321
  /* This should be the last !!! */
322
  SQLCOM_END
323
};
324
1240.3.2 by Brian Aker
Cleanup white space.
325
enum enum_duplicates
326
{
327
  DUP_ERROR,
328
  DUP_REPLACE,
329
  DUP_UPDATE
1089.1.11 by Brian Aker
Cleanup on enum
330
};
331
1280.1.10 by Monty Taylor
Put everything in drizzled into drizzled namespace.
332
} /* namespace drizzled */
333
1089.1.11 by Brian Aker
Cleanup on enum
334
#endif /* DRIZZLED_ENUM_H */