~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/definitions.h

  • Committer: Brian Aker
  • Date: 2011-02-22 06:12:02 UTC
  • mfrom: (2190.1.6 drizzle-build)
  • Revision ID: brian@tangent.org-20110222061202-k03czxykqy4x9hjs
List update, header fixes, multiple symbols, and David deletes some code.

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