1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
4
* Copyright (C) 2009 Sun Microsystems
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.
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.
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
21
#ifndef DRIZZLED_ENUM_H
22
#define DRIZZLED_ENUM_H
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).
36
Move this out of here once Stew's done with UDF breakout. The following headers need it:
38
sql_lex.h --> included by session.h
56
* @TODO Move to a separate header?
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
62
* What is needed is a separate header file that is included
63
* by *both* item.h and field.h to resolve inter-dependencies
65
* But, probably want to hold off on this until Stew finished the UDF cleanup
69
DERIVATION_IGNORABLE= 5,
70
DERIVATION_COERCIBLE= 4,
71
DERIVATION_SYSCONST= 3,
72
DERIVATION_IMPLICIT= 2,
74
DERIVATION_EXPLICIT= 0
77
enum enum_parsing_place
86
enum enum_mysql_completiontype
90
ROLLBACK_AND_CHAIN= 7,
96
enum enum_check_fields
100
CHECK_FIELD_ERROR_FOR_NULL
110
enum column_format_type
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
120
Category of table found in the table share.
122
enum enum_table_category
127
TABLE_UNKNOWN_CATEGORY=0,
131
The table is visible only in the session.
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.
140
TABLE_CATEGORY_TEMPORARY=1,
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.
150
TABLE_CATEGORY_USER=2,
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.
168
TODO: Fixing the performance issues of I_S will lead
169
to I_S tables in the table cache, which should use
172
TABLE_CATEGORY_INFORMATION
175
enum enum_enable_or_disable
183
enum enum_mark_columns
196
enum find_item_error_report_type
199
REPORT_EXCEPT_NOT_FOUND,
201
REPORT_EXCEPT_NON_UNIQUE,
202
IGNORE_EXCEPT_NON_UNIQUE
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
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.
215
enum timestamp_auto_set_type
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
223
enum enum_ha_read_modes
233
enum enum_tx_isolation
235
ISO_READ_UNCOMMITTED,
242
enum SHOW_COMP_OPTION
250
When a command is added here, be sure it's also added in mysqld.cc
251
in "struct show_var_st status_vars[]= {" ...
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
259
enum enum_sql_command {
266
SQLCOM_INSERT_SELECT,
272
SQLCOM_SHOW_CREATE_DB,
275
SQLCOM_UNLOCK_TABLES,
281
SQLCOM_REPLACE_SELECT,
287
SQLCOM_ROLLBACK_TO_SAVEPOINT,
290
SQLCOM_RELEASE_SAVEPOINT,
298
When a command is added here, be sure it's also added in mysqld.cc
299
in "struct show_var_st status_vars[]= {" ...
301
/* This should be the last !!! */
312
enum drizzled_error_code {
334
EE_OUT_OF_FILERESOURCES,
339
EE_UNKNOWN_COLLATION,
342
EE_ERROR_LAST= EE_FILE_NOT_CLOSED,
344
ER_ERROR_FIRST= 1000,
345
ER_UNUSED1000= ER_ERROR_FIRST,
350
ER_CANT_CREATE_TABLE,
383
ER_OUT_OF_SORTMEMORY,
389
ER_DBACCESS_DENIED_ERROR,
390
ER_ACCESS_DENIED_ERROR,
392
ER_UNKNOWN_COM_ERROR,
395
ER_TABLE_EXISTS_ERROR,
400
ER_WRONG_FIELD_WITH_GROUP,
401
ER_WRONG_GROUP_FIELD,
403
ER_WRONG_VALUE_COUNT,
415
ER_TOO_MANY_KEY_PARTS,
417
ER_KEY_COLUMN_DOES_NOT_EXITS,
419
ER_TOO_BIG_FIELDLENGTH,
424
ER_SHUTDOWN_COMPLETE,
428
ER_WRONG_FIELD_TERMINATORS,
429
ER_BLOBS_AND_NO_TERMINATED,
430
ER_TEXTFILE_NOT_READABLE,
431
ER_FILE_EXISTS_ERROR,
435
ER_CANT_REMOVE_ALL_FIELDS,
436
ER_CANT_DROP_FIELD_OR_KEY,
438
ER_UPDATE_TABLE_USED,
440
ER_KILL_DENIED_ERROR,
446
ER_BLOB_CANT_HAVE_DEFAULT,
451
ER_UNKNOWN_PROCEDURE,
452
ER_WRONG_PARAMCOUNT_TO_PROCEDURE,
455
ER_FIELD_SPECIFIED_TWICE,
456
ER_INVALID_GROUP_FUNC_USE,
457
ER_UNSUPPORTED_EXTENSION,
458
ER_TABLE_MUST_HAVE_COLUMNS,
466
ER_NULL_COLUMN_IN_INDEX,
471
ER_CANT_OPEN_LIBRARY,
472
ER_CANT_FIND_DL_ENTRY,
480
ER_CANT_CREATE_THREAD,
481
ER_WRONG_VALUE_COUNT_ON_ROW,
482
ER_CANT_REOPEN_TABLE,
485
ER_MIX_OF_GROUP_FUNC_AND_FIELDS,
498
ER_NET_PACKET_TOO_LARGE,
501
ER_NET_PACKETS_OUT_OF_ORDER,
508
ER_TABLE_CANT_HANDLE_BLOB,
509
ER_TABLE_CANT_HANDLE_AUTO_INCREMENT,
511
ER_WRONG_COLUMN_NAME,
515
ER_BLOB_KEY_WITHOUT_LENGTH,
516
ER_PRIMARY_CANT_HAVE_NULL,
518
ER_REQUIRES_PRIMARY_KEY,
521
ER_KEY_DOES_NOT_EXITS,
522
ER_CHECK_NO_SUCH_TABLE,
523
ER_CHECK_NOT_IMPLEMENTED,
525
ER_ERROR_DURING_COMMIT,
526
ER_ERROR_DURING_ROLLBACK,
529
ER_NEW_ABORTING_CONNECTION,
537
ER_LOCK_OR_ACTIVE_TRANSACTION,
538
ER_UNKNOWN_SYSTEM_VARIABLE,
540
ER_CRASHED_ON_REPAIR,
541
ER_WARNING_NOT_COMPLETE_ROLLBACK,
549
ER_SET_CONSTANTS_ONLY,
550
ER_LOCK_WAIT_TIMEOUT,
552
ER_READ_ONLY_TRANSACTION,
553
ER_DROP_DB_WITH_READ_LOCK,
559
ER_TABLE_CANT_HANDLE_FT,
560
ER_CANNOT_ADD_FOREIGN,
561
ER_NO_REFERENCED_ROW,
562
ER_ROW_IS_REFERENCED,
567
ER_WRONG_NUMBER_OF_COLUMNS_IN_SELECT,
568
ER_CANT_UPDATE_WITH_READLOCK,
576
ER_WRONG_VALUE_FOR_VAR,
577
ER_WRONG_TYPE_FOR_VAR,
579
ER_CANT_USE_OPTION_HERE,
580
ER_NOT_SUPPORTED_YET,
583
ER_INCORRECT_GLOBAL_LOCAL_VAR,
585
ER_KEY_REF_DO_NOT_MATCH_TABLE_REF,
587
ER_SUBQUERY_NO_1_ROW,
592
ER_ILLEGAL_REFERENCE,
593
ER_DERIVED_MUST_HAVE_ALIAS,
595
ER_TABLENAME_NOT_ALLOWED_HERE,
597
ER_SPATIAL_CANT_HAVE_NULL,
598
ER_COLLATION_CHARSET_MISMATCH,
601
ER_TOO_BIG_FOR_UNCOMPRESS,
604
ER_ZLIB_Z_DATA_ERROR,
605
ER_CUT_VALUE_GROUP_CONCAT,
606
ER_WARN_TOO_FEW_RECORDS,
607
ER_WARN_TOO_MANY_RECORDS,
608
ER_WARN_NULL_TO_NOTNULL,
609
ER_WARN_DATA_OUT_OF_RANGE,
610
ER_WARN_DATA_TRUNCATED,
612
ER_CANT_AGGREGATE_2COLLATIONS,
615
ER_CANT_AGGREGATE_3COLLATIONS,
616
ER_CANT_AGGREGATE_NCOLLATIONS,
617
ER_VARIABLE_IS_NOT_STRUCT,
618
ER_UNKNOWN_COLLATION,
621
ER_WARN_FIELD_RESOLVED,
625
ER_WRONG_NAME_FOR_INDEX,
626
ER_WRONG_NAME_FOR_CATALOG,
631
ER_UNKNOWN_STORAGE_ENGINE,
633
ER_NON_UPDATABLE_TABLE,
635
ER_OPTION_PREVENTS_STATEMENT,
636
ER_DUPLICATED_VALUE_IN_TYPE,
637
ER_TRUNCATED_WRONG_VALUE,
638
ER_TOO_MUCH_AUTO_TIMESTAMP_COLS,
639
ER_INVALID_ON_UPDATE,
642
ER_GET_TEMPORARY_ERRMSG,
643
ER_UNKNOWN_TIME_ZONE,
645
ER_INVALID_CHARACTER_STRING,
646
ER_WARN_ALLOWED_PACKET_OVERFLOWED,
650
ER_SP_DOES_NOT_EXIST,
662
ER_QUERY_INTERRUPTED,
709
ER_NO_DEFAULT_FOR_FIELD,
711
ER_TRUNCATED_WRONG_VALUE_FOR_FIELD,
712
ER_ILLEGAL_VALUE_FOR_TYPE,
754
ER_LOAD_FROM_FIXED_SIZE_ROWS_TO_VAR,
756
ER_WRONG_VALUE_FOR_TYPE,
757
ER_TABLE_DEF_CHANGED,
761
ER_CANT_CREATE_GEOMETRY_OBJECT,
767
ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG,
771
ER_TOO_BIG_PRECISION,
780
ER_TRG_IN_WRONG_SCHEMA,
781
ER_STACK_OVERRUN_NEED_MORE=1436, // TODO: Test case looks for this int
784
ER_TOO_BIG_DISPLAYWIDTH,
786
ER_DATETIME_FUNCTION_OVERFLOW,
796
ER_ROW_IS_REFERENCED_2,
797
ER_NO_REFERENCED_ROW_2,
804
ER_TABLE_NEEDS_UPGRADE,
808
ER_NON_GROUPING_FIELD_USED,
809
ER_TABLE_CANT_HANDLE_SPKEYS,
812
ER_AUTOINC_READ_FAILED,
815
ER_WRONG_STRING_LENGTH,
818
ER_TOO_HIGH_LEVEL_OF_NESTING_FOR_SELECT,
819
ER_NAME_BECOMES_EMPTY,
820
ER_AMBIGUOUS_FIELD_TERM,
823
ER_ILLEGAL_HA_CREATE_OPTION,
869
ER_INVALID_OPTION_VALUE,
871
ER_NO_PARTITION_FOR_GIVEN_VALUE,
879
ER_BINLOG_ROW_LOGGING_FAILED,
902
ER_FOREIGN_DUPLICATE_KEY,
913
ER_CANT_CHANGE_TX_ISOLATION,
927
ER_WRONG_PARAMCOUNT_TO_FUNCTION,
928
ER_WRONG_PARAMETERS_TO_NATIVE_FCT,
931
ER_DUP_ENTRY_WITH_KEY_NAME,
956
ER_LOAD_DATA_INVALID_COLUMN,
1030
ER_INVALID_UNIX_TIMESTAMP_VALUE,
1031
ER_INVALID_DATETIME_VALUE,
1032
ER_INVALID_NULL_ARGUMENT,
1034
ER_ARGUMENT_OUT_OF_RANGE,
1036
ER_INVALID_ENUM_VALUE,
1037
ER_NO_PRIMARY_KEY_ON_REPLICATED_TABLE,
1038
ER_CORRUPT_TABLE_DEFINITION,
1039
ER_SCHEMA_DOES_NOT_EXIST,
1042
ER_USE_SQL_BIG_RESULT,
1043
ER_UNKNOWN_ENGINE_OPTION,
1044
ER_UNKNOWN_SCHEMA_OPTION,
1045
ER_EVENT_OBSERVER_PLUGIN,
1046
ER_CORRUPT_SCHEMA_DEFINITION,
1047
ER_OUT_OF_GLOBAL_SORTMEMORY,
1048
ER_OUT_OF_GLOBAL_JOINMEMORY,
1049
ER_OUT_OF_GLOBAL_READRNDMEMORY,
1050
ER_OUT_OF_GLOBAL_READMEMORY,
1051
ER_USER_LOCKS_CANT_WAIT_ON_OWN_BARRIER,
1052
ER_USER_LOCKS_UNKNOWN_BARRIER,
1053
ER_USER_LOCKS_NOT_OWNER_OF_BARRIER,
1054
ER_USER_LOCKS_CANT_WAIT_ON_OWN_LOCK,
1055
ER_USER_LOCKS_NOT_OWNER_OF_LOCK,
1056
ER_USER_LOCKS_INVALID_NAME_BARRIER,
1057
ER_USER_LOCKS_INVALID_NAME_LOCK,
1058
ER_KILL_DENY_SELF_ERROR,
1059
ER_INVALID_ALTER_TABLE_FOR_NOT_NULL,
1061
ER_ERROR_LAST= ER_INVALID_ALTER_TABLE_FOR_NOT_NULL
1064
enum drizzle_exit_codes {
1065
EXIT_UNSPECIFIED_ERROR = 1,
1066
EXIT_UNKNOWN_OPTION,
1067
EXIT_AMBIGUOUS_OPTION,
1068
EXIT_NO_ARGUMENT_ALLOWED,
1069
EXIT_ARGUMENT_REQUIRED,
1070
EXIT_VAR_PREFIX_NOT_UNIQUE,
1071
EXIT_UNKNOWN_VARIABLE,
1073
EXIT_UNKNOWN_SUFFIX,
1074
EXIT_NO_PTR_TO_VARIABLE,
1075
EXIT_CANNOT_CONNECT_TO_SERVICE,
1076
EXIT_OPTION_DISABLED,
1077
EXIT_ARGUMENT_INVALID
1081
} /* namespace drizzled */
1083
#endif /* DRIZZLED_ENUM_H */