~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/base.h

  • Committer: Monty Taylor
  • Date: 2008-08-15 20:01:00 UTC
  • Revision ID: monty@inaugust.com-20080815200100-tht5d421maap6kjp
Updated POTFILES with local_infile.c.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
 
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
 
 *
4
 
 *  Copyright (C) 2008 Sun Microsystems
5
 
 *
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.
9
 
 *
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.
14
 
 *
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
18
 
 */
 
1
/* Copyright (C) 2000 MySQL AB
 
2
 
 
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.
 
6
 
 
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.
 
11
 
 
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 */
19
15
 
20
16
/* This file includes constants used with all databases */
21
17
 
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
 
18
/** 
 
19
 * @TODO Name this file something better and split it out if necessary.  
 
20
 * base.h isn't descriptive, especially compared to global.h 
25
21
 *
26
22
 * @TODO Convert HA_XXX defines into enums and/or bitmaps
27
23
 */
29
25
#ifndef DRIZZLE_SERVER_BASE_H
30
26
#define DRIZZLE_SERVER_BASE_H
31
27
 
 
28
#ifndef stdin                           /* Included first in handler */
32
29
#define CHSIZE_USED
 
30
#include <drizzled/global.h>
 
31
#include <mysys/my_dir.h>               /* This includes types */
 
32
#include <mysys/my_sys.h>
 
33
#include <mystrings/m_string.h>
 
34
#include <errno.h>
 
35
 
 
36
#ifndef EOVERFLOW
 
37
#define EOVERFLOW 84
 
38
#endif
 
39
 
 
40
#endif  /* stdin */
 
41
#include <mysys/my_list.h>
33
42
 
34
43
/* The following is bits in the flag parameter to ha_open() */
35
44
 
37
46
#define HA_OPEN_WAIT_IF_LOCKED          1
38
47
#define HA_OPEN_IGNORE_IF_LOCKED        2
39
48
#define HA_OPEN_TMP_TABLE               4       /* Table is a temp table */
 
49
#define HA_OPEN_DELAY_KEY_WRITE         8       /* Don't update index  */
40
50
#define HA_OPEN_ABORT_IF_CRASHED        16
41
51
#define HA_OPEN_FOR_REPAIR              32      /* open even if crashed */
 
52
#define HA_OPEN_FROM_SQL_LAYER          64
 
53
#define HA_OPEN_MMAP                    128     /* open memory mapped */
 
54
#define HA_OPEN_COPY                    256     /* Open copy (for repair) */
42
55
/* Internal temp table, used for temporary results */
43
56
#define HA_OPEN_INTERNAL_TABLE          512
44
57
 
91
104
 
92
105
        /* Index and table build methods */
93
106
 
94
 
enum ha_build_method {
95
 
  HA_BUILD_DEFAULT,
 
107
enum ha_build_method { 
 
108
  HA_BUILD_DEFAULT, 
96
109
  HA_BUILD_ONLINE,
97
 
  HA_BUILD_OFFLINE
 
110
  HA_BUILD_OFFLINE 
98
111
};
99
112
 
100
113
        /* The following is parameter to ha_extra() */
137
150
  HA_EXTRA_CHANGE_KEY_TO_UNIQUE,
138
151
  HA_EXTRA_CHANGE_KEY_TO_DUP,
139
152
  /*
140
 
    When using HA_EXTRA_KEYREAD, overwrite only key member fields and keep
 
153
    When using HA_EXTRA_KEYREAD, overwrite only key member fields and keep 
141
154
    other fields intact. When this is off (by default) InnoDB will use memcpy
142
155
    to overwrite entire row.
143
156
  */
144
157
  HA_EXTRA_KEYREAD_PRESERVE_FIELDS,
 
158
  HA_EXTRA_MMAP,
145
159
  /*
146
160
    Ignore if the a tuple is not found, continue processing the
147
161
    transaction and ignore that 'row'.  Needed for idempotency
162
176
  HA_EXTRA_WRITE_CANNOT_REPLACE,
163
177
  /*
164
178
    Inform handler that delete_row()/update_row() cannot batch deletes/updates
165
 
    and should perform them immediately. This may be needed when table has
 
179
    and should perform them immediately. This may be needed when table has 
166
180
    AFTER DELETE/UPDATE triggers which access to subject table.
167
181
    These flags are reset by the handler::extra(HA_EXTRA_RESET) call.
168
182
  */
240
254
#define HA_VAR_LENGTH_KEY        8
241
255
#define HA_NULL_PART_KEY         64
242
256
#define HA_USES_COMMENT          4096
243
 
#define HA_USES_BLOCK_SIZE       ((uint32_t) 32768)
 
257
#define HA_USES_BLOCK_SIZE       ((uint) 32768)
244
258
#define HA_SORT_ALLOWS_SAME      512    /* Intern bit when sorting records */
245
259
 
246
260
        /* These flags can be added to key-seg-flag */
264
278
#define HA_OPTION_PACK_RECORD           1
265
279
#define HA_OPTION_PACK_KEYS             2
266
280
#define HA_OPTION_COMPRESS_RECORD       4
 
281
#define HA_OPTION_LONG_BLOB_PTR         8 /* new ISAM format */
267
282
#define HA_OPTION_TMP_TABLE             16
 
283
#define HA_OPTION_CHECKSUM              32
 
284
#define HA_OPTION_DELAY_KEY_WRITE       64
268
285
#define HA_OPTION_NO_PACK_KEYS          128  /* Reserved for MySQL */
269
286
#define HA_OPTION_CREATE_FROM_ENGINE    256
 
287
#define HA_OPTION_RELIES_ON_SQL_LAYER   512
270
288
#define HA_OPTION_NULL_FIELDS           1024
271
289
#define HA_OPTION_PAGE_CHECKSUM         2048
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 */
 
290
#define HA_OPTION_TEMP_COMPRESS_RECORD  ((uint) 16384)  /* set by isamchk */
 
291
#define HA_OPTION_READ_ONLY_DATA        ((uint) 32768)  /* Set by isamchk */
274
292
 
275
293
        /* Bits in flag to create() */
276
294
 
277
295
#define HA_DONT_TOUCH_DATA      1       /* Don't empty datafile (isamchk) */
278
296
#define HA_PACK_RECORD          2       /* Request packed record format */
279
297
#define HA_CREATE_TMP_TABLE     4
 
298
#define HA_CREATE_CHECKSUM      8
280
299
#define HA_CREATE_KEEP_FILES    16      /* don't overwrite .MYD and MYI */
 
300
#define HA_CREATE_PAGE_CHECKSUM 32
 
301
#define HA_CREATE_DELAY_KEY_WRITE 64
 
302
#define HA_CREATE_RELIES_ON_SQL_LAYER 128
281
303
 
282
304
/*
283
305
  The following flags (OR-ed) are passed to handler::info() method.
411
433
        /* Other constants */
412
434
 
413
435
#define HA_NAMELEN 64                   /* Max length of saved filename */
414
 
#define NO_SUCH_KEY (~(uint32_t)0)          /* used as a key no. */
 
436
#define NO_SUCH_KEY (~(uint)0)          /* used as a key no. */
415
437
 
416
438
typedef ulong key_part_map;
417
439
#define HA_WHOLE_KEY  (~(key_part_map)0)
486
508
/* X > key, i.e. not including the right endpoint */
487
509
#define NEAR_MAX        8
488
510
 
489
 
/*
490
 
  This flag means that index is a unique index, and the interval is
 
511
/* 
 
512
  This flag means that index is a unique index, and the interval is 
491
513
  equivalent to "AND(keypart_i = const_i)", where all of const_i are not NULLs.
492
514
*/
493
515
#define UNIQUE_RANGE    16
494
516
 
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
 
517
/* 
 
518
  This flag means that the interval is equivalent to 
 
519
  "AND(keypart_i = const_i)", where not all key parts may be used but all of 
498
520
  const_i are not NULLs.
499
521
*/
500
522
#define EQ_RANGE        32
501
523
 
502
524
/*
503
525
  This flag has the same meaning as UNIQUE_RANGE, except that for at least
504
 
  one keypart the condition is "keypart IS NULL".
 
526
  one keypart the condition is "keypart IS NULL". 
505
527
*/
506
528
#define NULL_RANGE      64
507
529
 
508
530
typedef struct st_key_range
509
531
{
510
 
  const unsigned char *key;
511
 
  uint32_t length;
 
532
  const uchar *key;
 
533
  uint length;
 
534
  key_part_map keypart_map;
512
535
  enum ha_rkey_function flag;
513
 
  key_part_map keypart_map;
514
536
} key_range;
515
537
 
516
538
typedef struct st_key_multi_range
518
540
  key_range start_key;
519
541
  key_range end_key;
520
542
  char  *ptr;                 /* Free to use by caller (ptr to row etc) */
521
 
  uint32_t  range_flag;           /* key range flags see above */
 
543
  uint  range_flag;           /* key range flags see above */
522
544
} KEY_MULTI_RANGE;
523
545
 
524
546
 
537
559
 
538
560
#define HA_VARCHAR_PACKLENGTH(field_length) ((field_length) < 256 ? 1 :2)
539
561
 
 
562
/* invalidator function reference for Query Cache */
 
563
typedef void (* invalidator_by_filename)(const char * filename);
 
564
 
540
565
#endif /* DRIZZLE_SERVER_BASE_H */