20
20
/* This file includes constants used with all databases */
23
* @TODO Name this file something better and split it out if necessary.
24
* base.h isn't descriptive, especially compared to global.h
23
* @TODO Name this file something better and split it out if necessary.
24
* base.h isn't descriptive, especially compared to global.h
26
26
* @TODO Convert HA_XXX defines into enums and/or bitmaps
29
29
#ifndef DRIZZLE_SERVER_BASE_H
30
30
#define DRIZZLE_SERVER_BASE_H
32
#ifndef stdin /* Included first in handler */
33
32
#define CHSIZE_USED
34
#include <drizzled/global.h>
35
#include <mysys/my_dir.h> /* This includes types */
36
#include <mysys/my_sys.h>
37
#include <mystrings/m_string.h>
45
#include <mysys/my_list.h>
47
34
/* The following is bits in the flag parameter to ha_open() */
50
37
#define HA_OPEN_WAIT_IF_LOCKED 1
51
38
#define HA_OPEN_IGNORE_IF_LOCKED 2
52
39
#define HA_OPEN_TMP_TABLE 4 /* Table is a temp table */
53
#define HA_OPEN_DELAY_KEY_WRITE 8 /* Don't update index */
54
40
#define HA_OPEN_ABORT_IF_CRASHED 16
55
41
#define HA_OPEN_FOR_REPAIR 32 /* open even if crashed */
56
#define HA_OPEN_FROM_SQL_LAYER 64
57
#define HA_OPEN_MMAP 128 /* open memory mapped */
58
#define HA_OPEN_COPY 256 /* Open copy (for repair) */
59
42
/* Internal temp table, used for temporary results */
60
43
#define HA_OPEN_INTERNAL_TABLE 512
154
137
HA_EXTRA_CHANGE_KEY_TO_UNIQUE,
155
138
HA_EXTRA_CHANGE_KEY_TO_DUP,
157
When using HA_EXTRA_KEYREAD, overwrite only key member fields and keep
140
When using HA_EXTRA_KEYREAD, overwrite only key member fields and keep
158
141
other fields intact. When this is off (by default) InnoDB will use memcpy
159
142
to overwrite entire row.
161
144
HA_EXTRA_KEYREAD_PRESERVE_FIELDS,
164
146
Ignore if the a tuple is not found, continue processing the
165
147
transaction and ignore that 'row'. Needed for idempotency
180
162
HA_EXTRA_WRITE_CANNOT_REPLACE,
182
164
Inform handler that delete_row()/update_row() cannot batch deletes/updates
183
and should perform them immediately. This may be needed when table has
165
and should perform them immediately. This may be needed when table has
184
166
AFTER DELETE/UPDATE triggers which access to subject table.
185
167
These flags are reset by the handler::extra(HA_EXTRA_RESET) call.
258
240
#define HA_VAR_LENGTH_KEY 8
259
241
#define HA_NULL_PART_KEY 64
260
242
#define HA_USES_COMMENT 4096
261
#define HA_USES_BLOCK_SIZE ((uint) 32768)
243
#define HA_USES_BLOCK_SIZE ((uint32_t) 32768)
262
244
#define HA_SORT_ALLOWS_SAME 512 /* Intern bit when sorting records */
264
246
/* These flags can be added to key-seg-flag */
282
264
#define HA_OPTION_PACK_RECORD 1
283
265
#define HA_OPTION_PACK_KEYS 2
284
266
#define HA_OPTION_COMPRESS_RECORD 4
285
#define HA_OPTION_LONG_BLOB_PTR 8 /* new ISAM format */
286
267
#define HA_OPTION_TMP_TABLE 16
287
#define HA_OPTION_CHECKSUM 32
288
#define HA_OPTION_DELAY_KEY_WRITE 64
289
268
#define HA_OPTION_NO_PACK_KEYS 128 /* Reserved for MySQL */
290
269
#define HA_OPTION_CREATE_FROM_ENGINE 256
291
#define HA_OPTION_RELIES_ON_SQL_LAYER 512
292
270
#define HA_OPTION_NULL_FIELDS 1024
293
271
#define HA_OPTION_PAGE_CHECKSUM 2048
294
#define HA_OPTION_TEMP_COMPRESS_RECORD ((uint) 16384) /* set by isamchk */
295
#define HA_OPTION_READ_ONLY_DATA ((uint) 32768) /* Set by isamchk */
272
#define HA_OPTION_TEMP_COMPRESS_RECORD ((uint32_t) 16384) /* set by isamchk */
273
#define HA_OPTION_READ_ONLY_DATA ((uint32_t) 32768) /* Set by isamchk */
297
275
/* Bits in flag to create() */
299
277
#define HA_DONT_TOUCH_DATA 1 /* Don't empty datafile (isamchk) */
300
278
#define HA_PACK_RECORD 2 /* Request packed record format */
301
279
#define HA_CREATE_TMP_TABLE 4
302
#define HA_CREATE_CHECKSUM 8
303
280
#define HA_CREATE_KEEP_FILES 16 /* don't overwrite .MYD and MYI */
304
#define HA_CREATE_PAGE_CHECKSUM 32
305
#define HA_CREATE_DELAY_KEY_WRITE 64
306
#define HA_CREATE_RELIES_ON_SQL_LAYER 128
309
283
The following flags (OR-ed) are passed to handler::info() method.
437
411
/* Other constants */
439
413
#define HA_NAMELEN 64 /* Max length of saved filename */
440
#define NO_SUCH_KEY (~(uint)0) /* used as a key no. */
414
#define NO_SUCH_KEY (~(uint32_t)0) /* used as a key no. */
442
416
typedef ulong key_part_map;
443
417
#define HA_WHOLE_KEY (~(key_part_map)0)
512
486
/* X > key, i.e. not including the right endpoint */
513
487
#define NEAR_MAX 8
516
This flag means that index is a unique index, and the interval is
490
This flag means that index is a unique index, and the interval is
517
491
equivalent to "AND(keypart_i = const_i)", where all of const_i are not NULLs.
519
493
#define UNIQUE_RANGE 16
522
This flag means that the interval is equivalent to
523
"AND(keypart_i = const_i)", where not all key parts may be used but all of
496
This flag means that the interval is equivalent to
497
"AND(keypart_i = const_i)", where not all key parts may be used but all of
524
498
const_i are not NULLs.
526
500
#define EQ_RANGE 32
529
503
This flag has the same meaning as UNIQUE_RANGE, except that for at least
530
one keypart the condition is "keypart IS NULL".
504
one keypart the condition is "keypart IS NULL".
532
506
#define NULL_RANGE 64
536
510
const unsigned char *key;
512
enum ha_rkey_function flag;
538
513
key_part_map keypart_map;
539
enum ha_rkey_function flag;
542
516
typedef struct st_key_multi_range
564
538
#define HA_VARCHAR_PACKLENGTH(field_length) ((field_length) < 256 ? 1 :2)
566
/* invalidator function reference for Query Cache */
567
typedef void (* invalidator_by_filename)(const char * filename);
569
540
#endif /* DRIZZLE_SERVER_BASE_H */