~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/definitions.h

  • Committer: Andrew Hutchings
  • Date: 2011-01-24 09:14:25 UTC
  • mto: (2108.1.1 build)
  • mto: This revision was merged to the branch mainline in revision 2109.
  • Revision ID: andrew@linuxjedi.co.uk-20110124091425-ouoim7rfselndg23
And add boost::test to the doc

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
 
43
43
#define LANGUAGE        "english/"
44
44
#define TEMP_PREFIX     "MY"
 
45
#define LOG_PREFIX      "ML"
45
46
 
46
47
#define ER(X) ::drizzled::error_message((X))
47
48
 
49
50
#define STRERROR_MAX 256
50
51
 
51
52
/* extra 4+4 bytes for slave tmp tables */
 
53
#define MAX_DBKEY_LENGTH (NAME_LEN*2+1+1+4+4)
 
54
#define MAX_ALIAS_NAME 256
52
55
#define MAX_FIELD_NAME 34                       /* Max colum name length +2 */
53
56
#define MAX_SYS_VAR_LENGTH 32
54
57
#define MAX_INDEXES 64
55
 
const uint32_t MAX_KEY = MAX_INDEXES;                     /* Max used keys */
56
 
const uint32_t MAX_REF_PARTS = 16;                      /* Max parts used as ref */
57
 
const uint32_t MAX_KEY_LENGTH = 4096;                    // max possible key
58
 
const uint32_t MAX_KEY_LENGTH_DECIMAL_WIDTH = 4; // strlen("4096")
59
 
 
 
58
#define MAX_KEY MAX_INDEXES                     /* Max used keys */
 
59
#define MAX_REF_PARTS 16                        /* Max parts used as ref */
 
60
#define MAX_KEY_LENGTH 4096                     /* max possible key */
 
61
#define MAX_KEY_LENGTH_DECIMAL_WIDTH 4          /* strlen("4096") */
60
62
#if SIZEOF_OFF_T > 4
61
63
#define MAX_REFLENGTH 8                         /* Max length for record ref */
62
64
#else
63
65
#define MAX_REFLENGTH 4                         /* Max length for record ref */
64
66
#endif
 
67
#define MAX_HOSTNAME  61                        /* len+1 in mysql.user */
65
68
 
66
69
#define MAX_MBWIDTH             4               /* Max multibyte sequence */
67
70
#define MAX_FIELD_CHARLENGTH    255
71
74
/* Max column width +1 */
72
75
#define MAX_FIELD_WIDTH         (MAX_FIELD_CHARLENGTH*MAX_MBWIDTH+1)
73
76
 
 
77
#define MAX_DATETIME_COMPRESSED_WIDTH 14  /* YYYYMMDDHHMMSS */
 
78
 
74
79
#define MAX_TABLES      (sizeof(table_map)*8-3) /* Max tables in join */
75
80
#define PARAM_TABLE_BIT (((table_map) 1) << (sizeof(table_map)*8-3))
76
81
#define OUTER_REF_TABLE_BIT     (((table_map) 1) << (sizeof(table_map)*8-2))
101
106
*/
102
107
#define MIN_TURBOBM_PATTERN_LEN 3
103
108
 
 
109
/*
 
110
   Defines for binary logging.
 
111
   Do not decrease the value of BIN_LOG_HEADER_SIZE.
 
112
   Do not even increase it before checking code.
 
113
*/
 
114
 
 
115
#define BIN_LOG_HEADER_SIZE    4
 
116
 
104
117
/* Below are #defines that used to be in mysql_priv.h */
105
118
/***************************************************************************
106
119
  Configuration parameters
107
120
****************************************************************************/
108
121
#define MAX_FIELDS_BEFORE_HASH  32
 
122
#define USER_VARS_HASH_SIZE     16
109
123
#define TABLE_OPEN_CACHE_MIN    64
110
124
#define TABLE_OPEN_CACHE_DEFAULT 1024
111
125
 
177
191
/** Characters shown for the command in 'show processlist'. */
178
192
#define PROCESS_LIST_WIDTH 100
179
193
 
 
194
#define PRECISION_FOR_DOUBLE 53
 
195
#define PRECISION_FOR_FLOAT  24
 
196
 
 
197
/* The following can also be changed from the command line */
 
198
#define DEFAULT_CONCURRENCY     10
 
199
#define FLUSH_TIME              0               /**< Don't flush tables */
 
200
 
 
201
/* Bits from testflag */
 
202
enum test_flag_bit
 
203
{
 
204
  TEST_PRINT_CACHED_TABLES= 1,
 
205
  TEST_NO_KEY_GROUP,
 
206
  TEST_MIT_THREAD,
 
207
  TEST_KEEP_TMP_TABLES,
 
208
  TEST_READCHECK, /**< Force use of readcheck */
 
209
  TEST_NO_EXTRA,
 
210
  TEST_CORE_ON_SIGNAL, /**< Give core if signal */
 
211
  TEST_NO_STACKTRACE,
 
212
  TEST_SIGINT, /**< Allow sigint on threads */
 
213
  TEST_SYNCHRONIZATION /**< get server to do sleep in some places */
 
214
};
 
215
 
180
216
/* Bits for different SQL modes modes (including ANSI mode) */
181
217
#define MODE_NO_ZERO_DATE               (2)
182
218
#define MODE_INVALID_DATES              (MODE_NO_ZERO_DATE*2)
256
292
#define HA_KEY_SWITCH_ALL_SAVE     3
257
293
 
258
294
/*
 
295
  Note: the following includes binlog and closing 0.
 
296
  so: innodb + bdb + ndb + binlog + myisam + myisammrg + archive +
 
297
      example + csv + heap + blackhole + federated + 0
 
298
  (yes, the sum is deliberately inaccurate)
 
299
  TODO remove the limit, use dynarrays
 
300
*/
 
301
#define MAX_HA 15
 
302
 
 
303
/*
259
304
  Parameters for open() (in register form->filestat)
260
305
  HA_GET_INFO does an implicit HA_ABORT_IF_LOCKED
261
306
*/
272
317
#define HA_BLOCK_LOCK           256     /* unlock when reading some records */
273
318
#define HA_OPEN_TEMPORARY       512
274
319
 
 
320
/* For transactional LOCK Table. handler::lock_table() */
 
321
#define HA_LOCK_IN_SHARE_MODE      F_RDLCK
 
322
#define HA_LOCK_IN_EXCLUSIVE_MODE  F_WRLCK
 
323
 
275
324
/* Some key definitions */
276
325
#define HA_KEY_NULL_LENGTH      1
277
326
#define HA_KEY_BLOB_LENGTH      2
278
327
 
279
 
const uint32_t HA_MAX_REC_LENGTH = 65535;
 
328
#define HA_MAX_REC_LENGTH       65535
280
329
 
281
330
/* Options of START TRANSACTION statement (and later of SET TRANSACTION stmt) */
282
331
enum start_transaction_option_t
295
344
#define HA_CREATE_USED_AUTO             (1L << 0)
296
345
#define HA_CREATE_USED_CHARSET          (1L << 8)
297
346
#define HA_CREATE_USED_DEFAULT_CHARSET  (1L << 9)
 
347
#define HA_CREATE_USED_ROW_FORMAT       (1L << 15)
298
348
 
299
349
/*
300
350
  The below two are not used (and not handled) in this milestone of this WL
359
409
#define MY_COLL_DISALLOW_NONE         4
360
410
#define MY_COLL_CMP_CONV              7
361
411
 
362
 
inline static void clear_timestamp_auto_bits(timestamp_auto_set_type &_target_, 
363
 
                                             timestamp_auto_set_type _bits_)
 
412
inline static void clear_timestamp_auto_bits(enum timestamp_auto_set_type &_target_, 
 
413
                                             const enum timestamp_auto_set_type _bits_)
364
414
{
365
 
  _target_= static_cast<timestamp_auto_set_type>(_target_ & ~_bits_);
 
415
  _target_= (enum timestamp_auto_set_type)((int)(_target_) & ~_bits_);
366
416
}
367
417
 
368
418
/*
402
452
  if (a > b)
403
453
    a=b;
404
454
}
405
 
 
406
 
template<class T> inline void safe_delete(T*& ptr)
407
 
{
408
 
  delete ptr;
409
 
  ptr = 0;
410
 
}
411
455
#else
412
456
#ifdef __GNUC__
413
457
#define set_if_bigger(a,b) do {                 \
473
517
#ifndef offsetof
474
518
#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
475
519
#endif
 
520
#define ulong_to_double(X) ((double) (ulong) (X))
476
521
 
477
522
/* From limits.h instead */
478
523
#ifndef DBL_MIN
500
545
*/
501
546
#define MY_ALIGN(A,L)  (((A) + (L) - 1) & ~((L) - 1))
502
547
#define ALIGN_SIZE(A)  MY_ALIGN((A),sizeof(double))
 
548
/* Size to make adressable obj. */
 
549
#define ALIGN_PTR(A, t) ((t*) MY_ALIGN((A),sizeof(t)))
 
550
/* Offset of field f in structure t */
 
551
#define OFFSET(t, f)  ((size_t)(char *)&((t *)0)->f)
503
552
#ifdef __cplusplus
504
553
#define ADD_TO_PTR(ptr,size,type) (type) (reinterpret_cast<const unsigned char*>(ptr)+size)
 
554
#define PTR_BYTE_DIFF(A,B) (ptrdiff_t) (reinterpret_cast<const unsigned char*>(A) - reinterpret_cast<const unsigned char*>(B))
505
555
#else
506
556
 #define ADD_TO_PTR(ptr,size,type) (type) ((unsigned char*) (ptr)+size)
 
557
 #define PTR_BYTE_DIFF(A,B) (ptrdiff_t) ((unsigned char*) (A) - (unsigned char*) (B))
507
558
#endif
508
559
 
509
560
#define MY_DIV_UP(A, B) (((A) + (B) - 1) / (B))
539
590
#define IO_SIZE 4096
540
591
/* Max file name len */
541
592
#define FN_LEN 256
 
593
/* Max length of extension (part of FN_LEN) */
 
594
#define FN_EXTLEN 20
542
595
/* Max length of full path-name */
543
596
#define FN_REFLEN 512
544
597
/* File extension character */