~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/enum.h

  • Committer: Lee
  • Date: 2008-10-30 22:02:01 UTC
  • mto: (572.1.2 devel)
  • mto: This revision was merged to the branch mainline in revision 573.
  • Revision ID: lbieber@lbieber-desktop-20081030220201-elb6qprbzpn7c5a4
add my name to the AUTHORS file

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, Inc.
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
 
namespace drizzled
25
 
{
26
 
 
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
 
{
79
 
  NO_MATTER,
80
 
  IN_HAVING,
81
 
  SELECT_LIST,
82
 
  IN_WHERE,
83
 
  IN_ON
84
 
};
85
 
 
86
 
enum enum_mysql_completiontype
87
 
{
88
 
  ROLLBACK_RELEASE= -2,
89
 
  ROLLBACK= 1,
90
 
  ROLLBACK_AND_CHAIN= 7,
91
 
  COMMIT_RELEASE= -1,
92
 
  COMMIT= 0,
93
 
  COMMIT_AND_CHAIN= 6
94
 
};
95
 
 
96
 
enum enum_check_fields
97
 
{
98
 
  CHECK_FIELD_IGNORE,
99
 
  CHECK_FIELD_WARN,
100
 
  CHECK_FIELD_ERROR_FOR_NULL
101
 
};
102
 
 
103
 
enum sql_var_t
104
 
{
105
 
  OPT_DEFAULT= 0,
106
 
  OPT_SESSION,
107
 
  OPT_GLOBAL
108
 
};
109
 
 
110
 
enum column_format_type
111
 
{
112
 
  COLUMN_FORMAT_TYPE_NOT_USED= -1,
113
 
  COLUMN_FORMAT_TYPE_DEFAULT= 0,
114
 
  COLUMN_FORMAT_TYPE_FIXED= 1,
115
 
  COLUMN_FORMAT_TYPE_DYNAMIC= 2
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
 
 
175
 
enum enum_enable_or_disable
176
 
{
177
 
  LEAVE_AS_IS,
178
 
  ENABLE,
179
 
  DISABLE
180
 
};
181
 
 
182
 
 
183
 
enum enum_mark_columns
184
 
{
185
 
  MARK_COLUMNS_NONE,
186
 
  MARK_COLUMNS_READ,
187
 
  MARK_COLUMNS_WRITE
188
 
};
189
 
 
190
 
enum enum_filetype
191
 
{
192
 
  FILETYPE_CSV,
193
 
  FILETYPE_XML
194
 
};
195
 
 
196
 
enum find_item_error_report_type
197
 
{
198
 
  REPORT_ALL_ERRORS,
199
 
  REPORT_EXCEPT_NOT_FOUND,
200
 
  IGNORE_ERRORS,
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
 
{
217
 
  TIMESTAMP_NO_AUTO_SET= 0,
218
 
  TIMESTAMP_AUTO_SET_ON_INSERT= 1,
219
 
  TIMESTAMP_AUTO_SET_ON_UPDATE= 2,
220
 
  TIMESTAMP_AUTO_SET_ON_BOTH= 3
221
 
};
222
 
 
223
 
enum enum_ha_read_modes
224
 
{
225
 
  RFIRST,
226
 
  RNEXT,
227
 
  RPREV,
228
 
  RLAST,
229
 
  RKEY,
230
 
  RNEXT_SAME
231
 
};
232
 
 
233
 
enum enum_tx_isolation
234
 
{
235
 
  ISO_READ_UNCOMMITTED,
236
 
  ISO_READ_COMMITTED,
237
 
  ISO_REPEATABLE_READ,
238
 
  ISO_SERIALIZABLE
239
 
};
240
 
 
241
 
 
242
 
enum SHOW_COMP_OPTION
243
 
{
244
 
  SHOW_OPTION_YES,
245
 
  SHOW_OPTION_NO,
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 {
260
 
  SQLCOM_SELECT,
261
 
  SQLCOM_CREATE_TABLE,
262
 
  SQLCOM_CREATE_INDEX,
263
 
  SQLCOM_ALTER_TABLE,
264
 
  SQLCOM_UPDATE,
265
 
  SQLCOM_INSERT,
266
 
  SQLCOM_INSERT_SELECT,
267
 
  SQLCOM_DELETE,
268
 
  SQLCOM_TRUNCATE,
269
 
  SQLCOM_DROP_TABLE,
270
 
  SQLCOM_DROP_INDEX,
271
 
  SQLCOM_SHOW_CREATE,
272
 
  SQLCOM_SHOW_CREATE_DB,
273
 
  SQLCOM_LOAD,
274
 
  SQLCOM_SET_OPTION,
275
 
  SQLCOM_UNLOCK_TABLES,
276
 
  SQLCOM_CHANGE_DB,
277
 
  SQLCOM_CREATE_DB,
278
 
  SQLCOM_DROP_DB,
279
 
  SQLCOM_ALTER_DB,
280
 
  SQLCOM_REPLACE,
281
 
  SQLCOM_REPLACE_SELECT,
282
 
  SQLCOM_CHECK,
283
 
  SQLCOM_FLUSH,
284
 
  SQLCOM_KILL,
285
 
  SQLCOM_ANALYZE,
286
 
  SQLCOM_ROLLBACK,
287
 
  SQLCOM_ROLLBACK_TO_SAVEPOINT,
288
 
  SQLCOM_COMMIT,
289
 
  SQLCOM_SAVEPOINT,
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
 
 
305
 
enum enum_duplicates
306
 
{
307
 
  DUP_ERROR,
308
 
  DUP_REPLACE,
309
 
  DUP_UPDATE
310
 
};
311
 
 
312
 
enum drizzle_exit_codes
313
 
{
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
 
 
330
 
} /* namespace drizzled */
331
 
 
332
 
#endif /* DRIZZLED_ENUM_H */