~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/base.h

Merged in latest plugin-slot-reorg.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 
20
20
/* This file includes constants used with all databases */
21
21
 
22
 
/** 
23
 
 * @TODO Name this file something better and split it out if necessary.  
24
 
 * base.h isn't descriptive, especially compared to global.h 
 
22
/**
 
23
 * @TODO Name this file something better and split it out if necessary.
 
24
 * base.h isn't descriptive, especially compared to global.h
25
25
 *
26
26
 * @TODO Convert HA_XXX defines into enums and/or bitmaps
27
27
 */
29
29
#ifndef DRIZZLE_SERVER_BASE_H
30
30
#define DRIZZLE_SERVER_BASE_H
31
31
 
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>
38
 
#include <errno.h>
39
 
 
40
 
#ifndef EOVERFLOW
41
 
#define EOVERFLOW 84
42
 
#endif
43
 
 
44
 
#endif  /* stdin */
45
 
#include <mysys/my_list.h>
46
33
 
47
34
/* The following is bits in the flag parameter to ha_open() */
48
35
 
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
61
44
 
108
91
 
109
92
        /* Index and table build methods */
110
93
 
111
 
enum ha_build_method { 
112
 
  HA_BUILD_DEFAULT, 
 
94
enum ha_build_method {
 
95
  HA_BUILD_DEFAULT,
113
96
  HA_BUILD_ONLINE,
114
 
  HA_BUILD_OFFLINE 
 
97
  HA_BUILD_OFFLINE
115
98
};
116
99
 
117
100
        /* The following is parameter to ha_extra() */
154
137
  HA_EXTRA_CHANGE_KEY_TO_UNIQUE,
155
138
  HA_EXTRA_CHANGE_KEY_TO_DUP,
156
139
  /*
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.
160
143
  */
161
144
  HA_EXTRA_KEYREAD_PRESERVE_FIELDS,
162
 
  HA_EXTRA_MMAP,
163
145
  /*
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,
181
163
  /*
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.
186
168
  */
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 */
263
245
 
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 */
296
274
 
297
275
        /* Bits in flag to create() */
298
276
 
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
307
281
 
308
282
/*
309
283
  The following flags (OR-ed) are passed to handler::info() method.
437
411
        /* Other constants */
438
412
 
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. */
441
415
 
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
514
488
 
515
 
/* 
516
 
  This flag means that index is a unique index, and the interval is 
 
489
/*
 
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.
518
492
*/
519
493
#define UNIQUE_RANGE    16
520
494
 
521
 
/* 
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 
 
495
/*
 
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.
525
499
*/
526
500
#define EQ_RANGE        32
527
501
 
528
502
/*
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".
531
505
*/
532
506
#define NULL_RANGE      64
533
507
 
535
509
{
536
510
  const unsigned char *key;
537
511
  uint32_t length;
 
512
  enum ha_rkey_function flag;
538
513
  key_part_map keypart_map;
539
 
  enum ha_rkey_function flag;
540
514
} key_range;
541
515
 
542
516
typedef struct st_key_multi_range
563
537
 
564
538
#define HA_VARCHAR_PACKLENGTH(field_length) ((field_length) < 256 ? 1 :2)
565
539
 
566
 
/* invalidator function reference for Query Cache */
567
 
typedef void (* invalidator_by_filename)(const char * filename);
568
 
 
569
540
#endif /* DRIZZLE_SERVER_BASE_H */