~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/enum.h

  • Committer: Brian Aker
  • Date: 2009-07-11 19:23:04 UTC
  • mfrom: (1089.1.14 merge)
  • Revision ID: brian@gaz-20090711192304-ootijyl5yf9jq9kd
Merge Brian

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
 
24
/**
 
25
  Query type constants.
 
26
 
 
27
  QT_ORDINARY -- ordinary SQL query.
 
28
  QT_IS -- SQL query to be shown in INFORMATION_SCHEMA (in utf8 and without
 
29
  character set introducers).
 
30
 
 
31
  @TODO
 
32
 
 
33
  Move this out of here once Stew's done with UDF breakout.  The following headers need it:
 
34
 
 
35
    sql_lex.h --> included by session.h
 
36
    item.h
 
37
    table.h
 
38
    item_func.h
 
39
    item_subselect.h
 
40
    item_timefunc.h
 
41
    item_sum.h
 
42
    item_cmpfunc.h
 
43
    item_strfunc.h
 
44
*/
 
45
enum enum_query_type
 
46
{
 
47
  QT_ORDINARY,
 
48
  QT_IS
 
49
};
 
50
 
 
51
 
 
52
/**
 
53
 * @TODO Move to a separate header?
 
54
 *
 
55
 * It's needed by item.h and field.h, which are both inter-dependent
 
56
 * and contain forward declarations of many structs/classes in the
 
57
 * other header file.
 
58
 *
 
59
 * What is needed is a separate header file that is included
 
60
 * by *both* item.h and field.h to resolve inter-dependencies
 
61
 *
 
62
 * But, probably want to hold off on this until Stew finished the UDF cleanup
 
63
 */
 
64
enum Derivation
 
65
{
 
66
  DERIVATION_IGNORABLE= 5,
 
67
  DERIVATION_COERCIBLE= 4,
 
68
  DERIVATION_SYSCONST= 3,
 
69
  DERIVATION_IMPLICIT= 2,
 
70
  DERIVATION_NONE= 1,
 
71
  DERIVATION_EXPLICIT= 0
 
72
};
 
73
 
 
74
/**
 
75
 * Opening modes for open_temporary_table and open_table_from_share
 
76
 *
 
77
 * @TODO Put this into an appropriate header. It is only needed in:
 
78
 *
 
79
 *    table.cc
 
80
 *    sql_base.cc
 
81
 */
 
82
enum open_table_mode
 
83
{
 
84
  OTM_OPEN= 0,
 
85
  OTM_CREATE= 1,
 
86
  OTM_ALTER= 2
 
87
};
 
88
 
 
89
enum enum_parsing_place
 
90
{
 
91
  NO_MATTER, 
 
92
  IN_HAVING, 
 
93
  SELECT_LIST, 
 
94
  IN_WHERE, 
 
95
  IN_ON };
 
96
 
 
97
enum enum_mysql_completiontype 
 
98
{
 
99
  ROLLBACK_RELEASE= -2, 
 
100
  ROLLBACK= 1, 
 
101
  ROLLBACK_AND_CHAIN= 7, 
 
102
  COMMIT_RELEASE= -1, 
 
103
  COMMIT= 0, 
 
104
  COMMIT_AND_CHAIN= 6
 
105
};
 
106
 
 
107
enum enum_check_fields
 
108
{
 
109
  CHECK_FIELD_IGNORE, 
 
110
  CHECK_FIELD_WARN, 
 
111
  CHECK_FIELD_ERROR_FOR_NULL
 
112
};
 
113
 
 
114
enum enum_var_type
 
115
{
 
116
  OPT_DEFAULT= 0, 
 
117
  OPT_SESSION, 
 
118
  OPT_GLOBAL
 
119
};
 
120
 
 
121
enum row_type 
 
122
 
123
  ROW_TYPE_NOT_USED=-1, 
 
124
  ROW_TYPE_DEFAULT, 
 
125
  ROW_TYPE_FIXED,
 
126
  ROW_TYPE_DYNAMIC, 
 
127
  ROW_TYPE_COMPRESSED,
 
128
  ROW_TYPE_REDUNDANT, 
 
129
  ROW_TYPE_COMPACT, 
 
130
  ROW_TYPE_PAGE 
 
131
};
 
132
 
 
133
enum column_format_type 
 
134
{
 
135
  COLUMN_FORMAT_TYPE_NOT_USED= -1,
 
136
  COLUMN_FORMAT_TYPE_DEFAULT= 0,
 
137
  COLUMN_FORMAT_TYPE_FIXED= 1,
 
138
  COLUMN_FORMAT_TYPE_DYNAMIC= 2 
 
139
};
 
140
 
 
141
 
 
142
/**
 
143
  Category of table found in the table share.
 
144
*/
 
145
enum enum_table_category
 
146
{
 
147
  /**
 
148
    Unknown value.
 
149
  */
 
150
  TABLE_UNKNOWN_CATEGORY=0,
 
151
 
 
152
  /**
 
153
    Temporary table.
 
154
    The table is visible only in the session.
 
155
    Therefore,
 
156
    - FLUSH TABLES WITH READ LOCK
 
157
    - SET GLOBAL READ_ONLY = ON
 
158
    do not apply to this table.
 
159
    Note that LOCK Table t FOR READ/WRITE
 
160
    can be used on temporary tables.
 
161
    Temporary tables are not part of the table cache.
 
162
  */
 
163
  TABLE_CATEGORY_TEMPORARY=1,
 
164
 
 
165
  /**
 
166
    User table.
 
167
    These tables do honor:
 
168
    - LOCK Table t FOR READ/WRITE
 
169
    - FLUSH TABLES WITH READ LOCK
 
170
    - SET GLOBAL READ_ONLY = ON
 
171
    User tables are cached in the table cache.
 
172
  */
 
173
  TABLE_CATEGORY_USER=2,
 
174
 
 
175
  /**
 
176
    Information schema tables.
 
177
    These tables are an interface provided by the system
 
178
    to inspect the system metadata.
 
179
    These tables do *not* honor:
 
180
    - LOCK Table t FOR READ/WRITE
 
181
    - FLUSH TABLES WITH READ LOCK
 
182
    - SET GLOBAL READ_ONLY = ON
 
183
    as there is no point in locking explicitely
 
184
    an INFORMATION_SCHEMA table.
 
185
    Nothing is directly written to information schema tables.
 
186
    Note that this value is not used currently,
 
187
    since information schema tables are not shared,
 
188
    but implemented as session specific temporary tables.
 
189
  */
 
190
  /*
 
191
    TODO: Fixing the performance issues of I_S will lead
 
192
    to I_S tables in the table cache, which should use
 
193
    this table type.
 
194
  */
 
195
  TABLE_CATEGORY_INFORMATION
 
196
};
 
197
 
 
198
enum enum_enable_or_disable 
 
199
{
 
200
  LEAVE_AS_IS, 
 
201
  ENABLE, 
 
202
  DISABLE 
 
203
};
 
204
 
 
205
 
 
206
enum enum_delay_key_write 
 
207
 
208
  DELAY_KEY_WRITE_NONE, 
 
209
  DELAY_KEY_WRITE_ON,
 
210
  DELAY_KEY_WRITE_ALL 
 
211
};
 
212
 
 
213
 
 
214
enum enum_mark_columns
 
215
 
216
  MARK_COLUMNS_NONE, 
 
217
  MARK_COLUMNS_READ, 
 
218
  MARK_COLUMNS_WRITE
 
219
};
 
220
 
 
221
enum enum_filetype 
 
222
 
223
  FILETYPE_CSV, 
 
224
  FILETYPE_XML 
 
225
};
 
226
 
 
227
enum find_item_error_report_type 
 
228
{
 
229
  REPORT_ALL_ERRORS, 
 
230
  REPORT_EXCEPT_NOT_FOUND,
 
231
  IGNORE_ERRORS, 
 
232
  REPORT_EXCEPT_NON_UNIQUE,
 
233
  IGNORE_EXCEPT_NON_UNIQUE
 
234
};
 
235
 
 
236
enum enum_schema_table_state
 
237
{
 
238
  NOT_PROCESSED= 0,
 
239
  PROCESSED_BY_CREATE_SORT_INDEX,
 
240
  PROCESSED_BY_JOIN_EXEC
 
241
};
 
242
 
 
243
 
 
244
enum tmp_table_type
 
245
{
 
246
  NO_TMP_TABLE, 
 
247
  NON_TRANSACTIONAL_TMP_TABLE, 
 
248
  TRANSACTIONAL_TMP_TABLE,
 
249
  INTERNAL_TMP_TABLE, 
 
250
  SYSTEM_TMP_TABLE, 
 
251
  TMP_TABLE_FRM_FILE_ONLY
 
252
};
 
253
 
 
254
/*
 
255
  Values in this enum are used to indicate how a tables TIMESTAMP field
 
256
  should be treated. It can be set to the current timestamp on insert or
 
257
  update or both.
 
258
  WARNING: The values are used for bit operations. If you change the
 
259
  enum, you must keep the bitwise relation of the values. For example:
 
260
  (int) TIMESTAMP_AUTO_SET_ON_BOTH must be equal to
 
261
  (int) TIMESTAMP_AUTO_SET_ON_INSERT | (int) TIMESTAMP_AUTO_SET_ON_UPDATE.
 
262
  We use an enum here so that the debugger can display the value names.
 
263
*/
 
264
enum timestamp_auto_set_type
 
265
{
 
266
  TIMESTAMP_NO_AUTO_SET= 0, 
 
267
  TIMESTAMP_AUTO_SET_ON_INSERT= 1,
 
268
  TIMESTAMP_AUTO_SET_ON_UPDATE= 2, 
 
269
  TIMESTAMP_AUTO_SET_ON_BOTH= 3
 
270
};
 
271
 
 
272
enum ha_choice 
 
273
 
274
  HA_CHOICE_UNDEF,
 
275
  HA_CHOICE_NO,
 
276
  HA_CHOICE_YES 
 
277
};
 
278
 
 
279
enum enum_ha_read_modes 
 
280
 
281
  RFIRST, 
 
282
  RNEXT, 
 
283
  RPREV, 
 
284
  RLAST, 
 
285
  RKEY, 
 
286
  RNEXT_SAME 
 
287
};
 
288
 
 
289
enum enum_tx_isolation 
 
290
{
 
291
  ISO_READ_UNCOMMITTED, 
 
292
  ISO_READ_COMMITTED,
 
293
  ISO_REPEATABLE_READ, 
 
294
  ISO_SERIALIZABLE
 
295
};
 
296
 
 
297
 
 
298
enum SHOW_COMP_OPTION 
 
299
 
300
  SHOW_OPTION_YES, 
 
301
  SHOW_OPTION_NO, 
 
302
  SHOW_OPTION_DISABLED
 
303
};
 
304
 
 
305
/*
 
306
  When a command is added here, be sure it's also added in mysqld.cc
 
307
  in "struct show_var_st status_vars[]= {" ...
 
308
 
 
309
  If the command returns a result set or is not allowed in stored
 
310
  functions or triggers, please also make sure that
 
311
  sp_get_flags_for_command (sp_head.cc) returns proper flags for the
 
312
  added SQLCOM_.
 
313
*/
 
314
 
 
315
enum enum_sql_command {
 
316
  SQLCOM_SELECT, 
 
317
  SQLCOM_CREATE_TABLE, 
 
318
  SQLCOM_CREATE_INDEX, 
 
319
  SQLCOM_ALTER_TABLE,
 
320
  SQLCOM_UPDATE, 
 
321
  SQLCOM_INSERT, 
 
322
  SQLCOM_INSERT_SELECT,
 
323
  SQLCOM_DELETE, 
 
324
  SQLCOM_TRUNCATE, 
 
325
  SQLCOM_DROP_TABLE, 
 
326
  SQLCOM_DROP_INDEX,
 
327
  SQLCOM_SHOW_DATABASES, 
 
328
  SQLCOM_SHOW_TABLES, 
 
329
  SQLCOM_SHOW_FIELDS,
 
330
  SQLCOM_SHOW_KEYS, 
 
331
  SQLCOM_SHOW_VARIABLES, 
 
332
  SQLCOM_SHOW_STATUS,
 
333
  SQLCOM_SHOW_ENGINE_STATUS, 
 
334
  SQLCOM_SHOW_ENGINE_MUTEX,
 
335
  SQLCOM_SHOW_PROCESSLIST,
 
336
  SQLCOM_SHOW_CREATE,
 
337
  SQLCOM_SHOW_CREATE_DB,
 
338
  SQLCOM_SHOW_TABLE_STATUS,
 
339
  SQLCOM_LOAD,
 
340
  SQLCOM_SET_OPTION,
 
341
  SQLCOM_UNLOCK_TABLES,
 
342
  SQLCOM_CHANGE_DB, 
 
343
  SQLCOM_CREATE_DB, 
 
344
  SQLCOM_DROP_DB, 
 
345
  SQLCOM_ALTER_DB,
 
346
  SQLCOM_REPLACE, 
 
347
  SQLCOM_REPLACE_SELECT,
 
348
  SQLCOM_OPTIMIZE, 
 
349
  SQLCOM_CHECK,
 
350
  SQLCOM_ASSIGN_TO_KEYCACHE,
 
351
  SQLCOM_FLUSH, 
 
352
  SQLCOM_KILL, 
 
353
  SQLCOM_ANALYZE,
 
354
  SQLCOM_ROLLBACK, 
 
355
  SQLCOM_ROLLBACK_TO_SAVEPOINT,
 
356
  SQLCOM_COMMIT, 
 
357
  SQLCOM_SAVEPOINT, 
 
358
  SQLCOM_RELEASE_SAVEPOINT,
 
359
  SQLCOM_SLAVE_START, 
 
360
  SQLCOM_SLAVE_STOP,
 
361
  SQLCOM_BEGIN,
 
362
  SQLCOM_RENAME_TABLE,
 
363
  SQLCOM_SHOW_OPEN_TABLES,
 
364
  SQLCOM_DELETE_MULTI, 
 
365
  SQLCOM_UPDATE_MULTI,
 
366
  SQLCOM_SHOW_WARNS,
 
367
  SQLCOM_EMPTY_QUERY,
 
368
  SQLCOM_SHOW_ERRORS,
 
369
  SQLCOM_CHECKSUM,
 
370
  SQLCOM_SHOW_PLUGINS,
 
371
  /*
 
372
    When a command is added here, be sure it's also added in mysqld.cc
 
373
    in "struct show_var_st status_vars[]= {" ...
 
374
  */
 
375
  /* This should be the last !!! */
 
376
  SQLCOM_END
 
377
};
 
378
 
 
379
enum enum_duplicates 
 
380
 
381
  DUP_ERROR, 
 
382
  DUP_REPLACE, 
 
383
  DUP_UPDATE 
 
384
};
 
385
 
 
386
 
 
387
#endif /* DRIZZLED_ENUM_H */