Drizzled Public API Documentation

enum.h

00001 /* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
00002  *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
00003  *
00004  *  Copyright (C) 2009 Sun Microsystems, Inc.
00005  *
00006  *  This program is free software; you can redistribute it and/or modify
00007  *  it under the terms of the GNU General Public License as published by
00008  *  the Free Software Foundation; either version 2 of the License, or
00009  *  (at your option) any later version.
00010  *
00011  *  This program is distributed in the hope that it will be useful,
00012  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  *  GNU General Public License for more details.
00015  *
00016  *  You should have received a copy of the GNU General Public License
00017  *  along with this program; if not, write to the Free Software
00018  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00019  */
00020 
00021 #pragma once
00022 
00023 namespace drizzled
00024 {
00025 
00038 enum Derivation
00039 {
00040   DERIVATION_IGNORABLE= 5,
00041   DERIVATION_COERCIBLE= 4,
00042   DERIVATION_SYSCONST= 3,
00043   DERIVATION_IMPLICIT= 2,
00044   DERIVATION_NONE= 1,
00045   DERIVATION_EXPLICIT= 0
00046 };
00047 
00048 enum enum_parsing_place
00049 {
00050   NO_MATTER,
00051   IN_HAVING,
00052   SELECT_LIST,
00053   IN_WHERE,
00054   IN_ON
00055 };
00056 
00057 enum enum_mysql_completiontype
00058 {
00059   ROLLBACK_RELEASE= -2,
00060   ROLLBACK= 1,
00061   ROLLBACK_AND_CHAIN= 7,
00062   COMMIT_RELEASE= -1,
00063   COMMIT= 0,
00064   COMMIT_AND_CHAIN= 6
00065 };
00066 
00067 enum enum_check_fields
00068 {
00069   CHECK_FIELD_IGNORE,
00070   CHECK_FIELD_WARN,
00071   CHECK_FIELD_ERROR_FOR_NULL
00072 };
00073 
00074 enum sql_var_t
00075 {
00076   OPT_DEFAULT= 0,
00077   OPT_SESSION,
00078   OPT_GLOBAL
00079 };
00080 
00081 enum column_format_type
00082 {
00083   COLUMN_FORMAT_TYPE_NOT_USED= -1,
00084   COLUMN_FORMAT_TYPE_DEFAULT= 0,
00085   COLUMN_FORMAT_TYPE_FIXED= 1,
00086   COLUMN_FORMAT_TYPE_DYNAMIC= 2
00087 };
00088 
00089 
00093 enum enum_table_category
00094 {
00098   TABLE_UNKNOWN_CATEGORY=0,
00099 
00111   TABLE_CATEGORY_TEMPORARY=1,
00112 
00121   TABLE_CATEGORY_USER=2,
00122 
00138   /*
00139     TODO: Fixing the performance issues of I_S will lead
00140     to I_S tables in the table cache, which should use
00141     this table type.
00142   */
00143   TABLE_CATEGORY_INFORMATION
00144 };
00145 
00146 enum enum_enable_or_disable
00147 {
00148   LEAVE_AS_IS,
00149   ENABLE,
00150   DISABLE
00151 };
00152 
00153 
00154 enum enum_mark_columns
00155 {
00156   MARK_COLUMNS_NONE,
00157   MARK_COLUMNS_READ,
00158   MARK_COLUMNS_WRITE
00159 };
00160 
00161 enum enum_filetype
00162 {
00163   FILETYPE_CSV,
00164   FILETYPE_XML
00165 };
00166 
00167 enum find_item_error_report_type
00168 {
00169   REPORT_ALL_ERRORS,
00170   REPORT_EXCEPT_NOT_FOUND,
00171   IGNORE_ERRORS,
00172   REPORT_EXCEPT_NON_UNIQUE,
00173   IGNORE_EXCEPT_NON_UNIQUE
00174 };
00175 
00176 /*
00177   Values in this enum are used to indicate how a tables TIMESTAMP field
00178   should be treated. It can be set to the current timestamp on insert or
00179   update or both.
00180   WARNING: The values are used for bit operations. If you change the
00181   enum, you must keep the bitwise relation of the values. For example:
00182   (int) TIMESTAMP_AUTO_SET_ON_BOTH must be equal to
00183   (int) TIMESTAMP_AUTO_SET_ON_INSERT | (int) TIMESTAMP_AUTO_SET_ON_UPDATE.
00184   We use an enum here so that the debugger can display the value names.
00185 */
00186 enum timestamp_auto_set_type
00187 {
00188   TIMESTAMP_NO_AUTO_SET= 0,
00189   TIMESTAMP_AUTO_SET_ON_INSERT= 1,
00190   TIMESTAMP_AUTO_SET_ON_UPDATE= 2,
00191   TIMESTAMP_AUTO_SET_ON_BOTH= 3
00192 };
00193 
00194 enum enum_ha_read_modes
00195 {
00196   RFIRST,
00197   RNEXT,
00198   RPREV,
00199   RLAST,
00200   RKEY,
00201   RNEXT_SAME
00202 };
00203 
00204 enum enum_tx_isolation
00205 {
00206   ISO_READ_UNCOMMITTED,
00207   ISO_READ_COMMITTED,
00208   ISO_REPEATABLE_READ,
00209   ISO_SERIALIZABLE
00210 };
00211 
00212 
00213 enum SHOW_COMP_OPTION
00214 {
00215   SHOW_OPTION_YES,
00216   SHOW_OPTION_NO,
00217   SHOW_OPTION_DISABLED
00218 };
00219 
00220 /*
00221   When a command is added here, be sure it's also added in mysqld.cc
00222   in "struct show_var_st status_vars[]= {" ...
00223 
00224   If the command returns a result set or is not allowed in stored
00225   functions or triggers, please also make sure that
00226   sp_get_flags_for_command (sp_head.cc) returns proper flags for the
00227   added SQLCOM_.
00228 */
00229 
00230 enum enum_sql_command {
00231   SQLCOM_SELECT,
00232   SQLCOM_CREATE_TABLE,
00233   SQLCOM_CREATE_INDEX,
00234   SQLCOM_ALTER_TABLE,
00235   SQLCOM_UPDATE,
00236   SQLCOM_INSERT,
00237   SQLCOM_INSERT_SELECT,
00238   SQLCOM_DELETE,
00239   SQLCOM_TRUNCATE,
00240   SQLCOM_DROP_TABLE,
00241   SQLCOM_DROP_INDEX,
00242   SQLCOM_SHOW_CREATE,
00243   SQLCOM_SHOW_CREATE_DB,
00244   SQLCOM_LOAD,
00245   SQLCOM_SET_OPTION,
00246   SQLCOM_UNLOCK_TABLES,
00247   SQLCOM_CHANGE_DB,
00248   SQLCOM_CREATE_DB,
00249   SQLCOM_DROP_DB,
00250   SQLCOM_ALTER_DB,
00251   SQLCOM_REPLACE,
00252   SQLCOM_REPLACE_SELECT,
00253   SQLCOM_CHECK,
00254   SQLCOM_FLUSH,
00255   SQLCOM_KILL,
00256   SQLCOM_ANALYZE,
00257   SQLCOM_ROLLBACK,
00258   SQLCOM_ROLLBACK_TO_SAVEPOINT,
00259   SQLCOM_COMMIT,
00260   SQLCOM_SAVEPOINT,
00261   SQLCOM_RELEASE_SAVEPOINT,
00262   SQLCOM_BEGIN,
00263   SQLCOM_RENAME_TABLE,
00264   SQLCOM_SHOW_WARNS,
00265   SQLCOM_EMPTY_QUERY,
00266   SQLCOM_SHOW_ERRORS,
00267   SQLCOM_CHECKSUM,
00268   /*
00269     When a command is added here, be sure it's also added in mysqld.cc
00270     in "struct show_var_st status_vars[]= {" ...
00271   */
00272   /* This should be the last !!! */
00273   SQLCOM_END
00274 };
00275 
00276 enum enum_duplicates
00277 {
00278   DUP_ERROR,
00279   DUP_REPLACE,
00280   DUP_UPDATE
00281 };
00282 
00283 enum drizzle_exit_codes
00284 {
00285   EXIT_UNSPECIFIED_ERROR = 1,
00286   EXIT_UNKNOWN_OPTION,
00287   EXIT_AMBIGUOUS_OPTION,
00288   EXIT_NO_ARGUMENT_ALLOWED,
00289   EXIT_ARGUMENT_REQUIRED,
00290   EXIT_VAR_PREFIX_NOT_UNIQUE,
00291   EXIT_UNKNOWN_VARIABLE,
00292   EXIT_OUT_OF_MEMORY,
00293   EXIT_UNKNOWN_SUFFIX,
00294   EXIT_NO_PTR_TO_VARIABLE,
00295   EXIT_CANNOT_CONNECT_TO_SERVICE,
00296   EXIT_OPTION_DISABLED,
00297   EXIT_ARGUMENT_INVALID
00298 };
00299 
00300 
00301 } /* namespace drizzled */
00302