1
/* Copyright (C) 2000 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 */
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
16
20
/* This file includes constants used with all databases */
19
* @TODO Name this file something better and split it out if necessary.
20
* 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
22
26
* @TODO Convert HA_XXX defines into enums and/or bitmaps
25
29
#ifndef DRIZZLE_SERVER_BASE_H
26
30
#define DRIZZLE_SERVER_BASE_H
28
#ifndef stdin /* Included first in handler */
29
32
#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>
41
#include <mysys/my_list.h>
43
34
/* The following is bits in the flag parameter to ha_open() */
150
141
HA_EXTRA_CHANGE_KEY_TO_UNIQUE,
151
142
HA_EXTRA_CHANGE_KEY_TO_DUP,
153
When using HA_EXTRA_KEYREAD, overwrite only key member fields and keep
144
When using HA_EXTRA_KEYREAD, overwrite only key member fields and keep
154
145
other fields intact. When this is off (by default) InnoDB will use memcpy
155
146
to overwrite entire row.
176
167
HA_EXTRA_WRITE_CANNOT_REPLACE,
178
169
Inform handler that delete_row()/update_row() cannot batch deletes/updates
179
and should perform them immediately. This may be needed when table has
170
and should perform them immediately. This may be needed when table has
180
171
AFTER DELETE/UPDATE triggers which access to subject table.
181
172
These flags are reset by the handler::extra(HA_EXTRA_RESET) call.
254
245
#define HA_VAR_LENGTH_KEY 8
255
246
#define HA_NULL_PART_KEY 64
256
247
#define HA_USES_COMMENT 4096
257
#define HA_USES_BLOCK_SIZE ((uint) 32768)
248
#define HA_USES_BLOCK_SIZE ((uint32_t) 32768)
258
249
#define HA_SORT_ALLOWS_SAME 512 /* Intern bit when sorting records */
260
251
/* These flags can be added to key-seg-flag */
287
278
#define HA_OPTION_RELIES_ON_SQL_LAYER 512
288
279
#define HA_OPTION_NULL_FIELDS 1024
289
280
#define HA_OPTION_PAGE_CHECKSUM 2048
290
#define HA_OPTION_TEMP_COMPRESS_RECORD ((uint) 16384) /* set by isamchk */
291
#define HA_OPTION_READ_ONLY_DATA ((uint) 32768) /* Set by isamchk */
281
#define HA_OPTION_TEMP_COMPRESS_RECORD ((uint32_t) 16384) /* set by isamchk */
282
#define HA_OPTION_READ_ONLY_DATA ((uint32_t) 32768) /* Set by isamchk */
293
284
/* Bits in flag to create() */
433
424
/* Other constants */
435
426
#define HA_NAMELEN 64 /* Max length of saved filename */
436
#define NO_SUCH_KEY (~(uint)0) /* used as a key no. */
427
#define NO_SUCH_KEY (~(uint32_t)0) /* used as a key no. */
438
429
typedef ulong key_part_map;
439
430
#define HA_WHOLE_KEY (~(key_part_map)0)
508
499
/* X > key, i.e. not including the right endpoint */
509
500
#define NEAR_MAX 8
512
This flag means that index is a unique index, and the interval is
503
This flag means that index is a unique index, and the interval is
513
504
equivalent to "AND(keypart_i = const_i)", where all of const_i are not NULLs.
515
506
#define UNIQUE_RANGE 16
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
509
This flag means that the interval is equivalent to
510
"AND(keypart_i = const_i)", where not all key parts may be used but all of
520
511
const_i are not NULLs.
522
513
#define EQ_RANGE 32
525
516
This flag has the same meaning as UNIQUE_RANGE, except that for at least
526
one keypart the condition is "keypart IS NULL".
517
one keypart the condition is "keypart IS NULL".
528
519
#define NULL_RANGE 64
530
521
typedef struct st_key_range
523
const unsigned char *key;
525
enum ha_rkey_function flag;
534
526
key_part_map keypart_map;
535
enum ha_rkey_function flag;
538
529
typedef struct st_key_multi_range