1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
4
* Copyright (C) 2008 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; version 2 of the License.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
1
/* Copyright (C) 2000-2006 MySQL AB
3
This program is free software; you can redistribute it and/or modify
4
it under the terms of the GNU General Public License as published by
5
the Free Software Foundation; version 2 of the License.
7
This program is distributed in the hope that it will be useful,
8
but WITHOUT ANY WARRANTY; without even the implied warranty of
9
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
GNU General Public License for more details.
12
You should have received a copy of the GNU General Public License
13
along with this program; if not, write to the Free Software
14
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
121
117
#define ME_ERROR (ME_BELL+ME_OLDWIN+ME_NOREFRESH)
122
118
#define MYF_RW MYF(MY_WME+MY_NABP) /* Vid my_read & my_write */
120
#define SPECIAL_USE_LOCKS 1 /* Lock used databases */
121
#define SPECIAL_NO_NEW_FUNC 2 /* Skip new functions */
122
#define SPECIAL_SKIP_SHOW_DB 4 /* Don't allow 'show db' */
123
#define SPECIAL_WAIT_IF_LOCKED 8 /* Wait if locked database */
124
#define SPECIAL_SAME_DB_NAME 16 /* form name = file name */
125
#define SPECIAL_ENGLISH 32 /* English error messages */
126
#define SPECIAL_NO_RESOLVE 64 /* Don't use gethostname */
127
#define SPECIAL_NO_PRIOR 128 /* Don't prioritize threads */
128
#define SPECIAL_BIG_SELECTS 256 /* Don't use heap tables */
129
#define SPECIAL_NO_HOST_CACHE 512 /* Don't cache hosts */
130
#define SPECIAL_SHORT_LOG_FORMAT 1024
131
#define SPECIAL_SAFE_MODE 2048
132
#define SPECIAL_LOG_QUERIES_NOT_USING_INDEXES 4096 /* Obsolete */
124
134
/* Extern defines */
125
135
#define store_record(A,B) memcpy((A)->B,(A)->record[0],(size_t) (A)->s->reclength)
126
136
#define restore_record(A,B) memcpy((A)->record[0],(A)->B,(size_t) (A)->s->reclength)
136
146
#define READ_ALL 1 /* openfrm: Read all parameters */
137
147
#define CHANGE_FRM 2 /* openfrm: open .frm as O_RDWR */
148
#define READ_KEYINFO 4 /* L{s nyckeldata fr}n filen */
138
149
#define EXTRA_RECORD 8 /* Reservera plats f|r extra record */
150
#define DONT_OPEN_TABLES 8 /* Don't open database-files (frd) */
151
#define DONT_OPEN_MASTER_REG 16 /* Don't open first reg-file (prt) */
152
#define EXTRA_LONG_RECORD 16 /* Plats f|r dubbel s|k-record */
153
#define COMPUTE_TYPES 32 /* Kontrollera type f|r f{ltena */
154
#define SEARCH_PRG 64 /* S|k efter registret i 'prg_dev' */
155
#define READ_USED_NAMES 128 /* L{s anv{nda formul{rnamn */
139
156
#define DONT_GIVE_ERROR 256 /* Don't do frm_error on openfrm */
157
#define READ_SCREENS 1024 /* Read screens, info and helpfile */
140
158
#define DELAYED_OPEN 4096 /* Open table later */
159
#define OPEN_VIEW 8192 /* Allow open on view */
160
#define OPEN_VIEW_NO_PARSE 16384 /* Open frm only if it's a view,
161
but do not parse view itself */
142
163
This flag is used in function get_all_tables() which fills
143
164
I_S tables with data which are retrieved from frm files and storage engine
153
174
#define OPEN_TABLE_ONLY OPEN_FRM_FILE_ONLY*2
155
176
This flag is used in function get_all_tables() which fills
177
I_S tables with data which are retrieved from frm files and storage engine
178
The flag means that we need to process views only to get necessary data.
179
Tables are not processed.
181
#define OPEN_VIEW_ONLY OPEN_TABLE_ONLY*2
183
This flag is used in function get_all_tables() which fills
184
I_S tables with data which are retrieved from frm files and storage engine.
185
The flag means that we need to open a view using
186
open_normal_and_derived_tables() function.
188
#define OPEN_VIEW_FULL OPEN_VIEW_ONLY*2
190
This flag is used in function get_all_tables() which fills
156
191
I_S tables with data which are retrieved from frm files and storage engine.
157
192
The flag means that I_S table uses optimization algorithm.
159
#define OPTIMIZE_I_S_TABLE OPEN_TABLE_ONLY*2
194
#define OPTIMIZE_I_S_TABLE OPEN_VIEW_FULL*2
161
196
#define SC_INFO_LENGTH 4 /* Form format constant */
162
197
#define TE_INFO_LENGTH 3
163
198
#define MTYP_NOEMPTY_BIT 128
165
200
#define FRM_VER_TRUE_VARCHAR (FRM_VER+4) /* 10 */
166
#define DRIZZLE_VERSION_TABLESPACE_IN_FRM_CGE 50120
167
#define DRIZZLE_VERSION_TABLESPACE_IN_FRM 50205
168
#define DRIZZLE_VERSION_TABLESPACE_IN_FRM_STR "50205"
201
#define MYSQL_VERSION_TABLESPACE_IN_FRM_CGE 50120
202
#define MYSQL_VERSION_TABLESPACE_IN_FRM 50205
203
#define MYSQL_VERSION_TABLESPACE_IN_FRM_STR "50205"
171
206
Minimum length pattern before Turbo Boyer-Moore is used
320
355
#define TEST_NO_STACKTRACE 512
321
356
#define TEST_SIGINT 1024 /**< Allow sigint on threads */
322
357
#define TEST_SYNCHRONIZATION 2048 /**< get server to do sleep in some places */
358
#endif /* End ifndef MYSQL_CLIENT */
360
/* The rest of the file is included in the server only */
324
363
/* Bits for different SQL modes modes (including ANSI mode) */
325
#define MODE_NO_ZERO_DATE (2)
364
#define MODE_REAL_AS_FLOAT 1
365
#define MODE_PIPES_AS_CONCAT 2
366
#define MODE_ANSI_QUOTES 4
367
#define MODE_IGNORE_SPACE 8
368
#define MODE_NOT_USED 16
369
#define MODE_ONLY_FULL_GROUP_BY 32
370
#define MODE_NO_UNSIGNED_SUBTRACTION 64
371
#define MODE_NO_DIR_IN_CREATE 128
372
#define MODE_POSTGRESQL 256
373
#define MODE_ORACLE 512
374
#define MODE_MSSQL 1024
375
#define MODE_DB2 2048
376
#define MODE_MAXDB 4096
377
#define MODE_NO_KEY_OPTIONS 8192
378
#define MODE_NO_TABLE_OPTIONS 16384
379
#define MODE_NO_FIELD_OPTIONS 32768
380
#define MODE_MYSQL323 65536L
381
#define MODE_MYSQL40 (MODE_MYSQL323*2)
382
#define MODE_ANSI (MODE_MYSQL40*2)
383
#define MODE_NO_AUTO_VALUE_ON_ZERO (MODE_ANSI*2)
384
#define MODE_NO_BACKSLASH_ESCAPES (MODE_NO_AUTO_VALUE_ON_ZERO*2)
385
#define MODE_STRICT_TRANS_TABLES (MODE_NO_BACKSLASH_ESCAPES*2)
386
#define MODE_STRICT_ALL_TABLES (MODE_STRICT_TRANS_TABLES*2)
387
#define MODE_NO_ZERO_IN_DATE (MODE_STRICT_ALL_TABLES*2)
388
#define MODE_NO_ZERO_DATE (MODE_NO_ZERO_IN_DATE*2)
326
389
#define MODE_INVALID_DATES (MODE_NO_ZERO_DATE*2)
390
#define MODE_ERROR_FOR_DIVISION_BY_ZERO (MODE_INVALID_DATES*2)
391
#define MODE_TRADITIONAL (MODE_ERROR_FOR_DIVISION_BY_ZERO*2)
392
#define MODE_NO_AUTO_CREATE_USER (MODE_TRADITIONAL*2)
393
#define MODE_HIGH_NOT_PRECEDENCE (MODE_NO_AUTO_CREATE_USER*2)
394
#define MODE_NO_ENGINE_SUBSTITUTION (MODE_HIGH_NOT_PRECEDENCE*2)
395
#define MODE_PAD_CHAR_TO_FULL_LENGTH (1ULL << 31)
328
397
/* @@optimizer_switch flags */
329
398
#define OPTIMIZER_SWITCH_NO_MATERIALIZATION 1
330
399
#define OPTIMIZER_SWITCH_NO_SEMIJOIN 2
402
Replication uses 8 bytes to store SQL_MODE in the binary log. The day you
403
use strictly more than 64 bits by adding one more define above, you should
404
contact the replication team because the replication code should then be
405
updated (to store more bytes on disk).
407
NOTE: When adding new SQL_MODE types, make sure to also add them to
408
the scripts used for creating the MySQL system tables
409
in scripts/mysql_system_tables.sql and scripts/mysql_system_tables_fix.sql
412
#define RAID_BLOCK_SIZE 1024
332
414
#define MY_CHARSET_BIN_MB_MAXLEN 1
334
416
// uncachable cause