~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/definitions.h

  • Committer: Monty Taylor
  • Date: 2011-02-13 17:26:39 UTC
  • mfrom: (2157.2.2 give-in-to-pkg-config)
  • mto: This revision was merged to the branch mainline in revision 2166.
  • Revision ID: mordred@inaugust.com-20110213172639-nhy7i72sfhoq13ms
Merged in pkg-config fixes.

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")
 
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") */
59
62
 
60
63
#if SIZEOF_OFF_T > 4
61
64
#define MAX_REFLENGTH 8                         /* Max length for record ref */
62
65
#else
63
66
#define MAX_REFLENGTH 4                         /* Max length for record ref */
64
67
#endif
 
68
#define MAX_HOSTNAME  61                        /* len+1 in mysql.user */
65
69
 
66
70
#define MAX_MBWIDTH             4               /* Max multibyte sequence */
67
71
#define MAX_FIELD_CHARLENGTH    255
71
75
/* Max column width +1 */
72
76
#define MAX_FIELD_WIDTH         (MAX_FIELD_CHARLENGTH*MAX_MBWIDTH+1)
73
77
 
 
78
#define MAX_DATETIME_COMPRESSED_WIDTH 14  /* YYYYMMDDHHMMSS */
 
79
 
74
80
#define MAX_TABLES      (sizeof(table_map)*8-3) /* Max tables in join */
75
81
#define PARAM_TABLE_BIT (((table_map) 1) << (sizeof(table_map)*8-3))
76
82
#define OUTER_REF_TABLE_BIT     (((table_map) 1) << (sizeof(table_map)*8-2))
106
112
  Configuration parameters
107
113
****************************************************************************/
108
114
#define MAX_FIELDS_BEFORE_HASH  32
 
115
#define USER_VARS_HASH_SIZE     16
109
116
#define TABLE_OPEN_CACHE_MIN    64
110
117
#define TABLE_OPEN_CACHE_DEFAULT 1024
111
118
 
177
184
/** Characters shown for the command in 'show processlist'. */
178
185
#define PROCESS_LIST_WIDTH 100
179
186
 
 
187
#define PRECISION_FOR_DOUBLE 53
 
188
#define PRECISION_FOR_FLOAT  24
 
189
 
 
190
/* The following can also be changed from the command line */
 
191
#define DEFAULT_CONCURRENCY     10
 
192
#define FLUSH_TIME              0               /**< Don't flush tables */
 
193
 
180
194
/* Bits for different SQL modes modes (including ANSI mode) */
181
195
#define MODE_NO_ZERO_DATE               (2)
182
196
#define MODE_INVALID_DATES              (MODE_NO_ZERO_DATE*2)
256
270
#define HA_KEY_SWITCH_ALL_SAVE     3
257
271
 
258
272
/*
 
273
  Note: the following includes binlog and closing 0.
 
274
  so: innodb + bdb + ndb + binlog + myisam + myisammrg + archive +
 
275
      example + csv + heap + blackhole + federated + 0
 
276
  (yes, the sum is deliberately inaccurate)
 
277
  TODO remove the limit, use dynarrays
 
278
*/
 
279
#define MAX_HA 15
 
280
 
 
281
/*
259
282
  Parameters for open() (in register form->filestat)
260
283
  HA_GET_INFO does an implicit HA_ABORT_IF_LOCKED
261
284
*/
272
295
#define HA_BLOCK_LOCK           256     /* unlock when reading some records */
273
296
#define HA_OPEN_TEMPORARY       512
274
297
 
 
298
/* For transactional LOCK Table. handler::lock_table() */
 
299
#define HA_LOCK_IN_SHARE_MODE      F_RDLCK
 
300
#define HA_LOCK_IN_EXCLUSIVE_MODE  F_WRLCK
 
301
 
275
302
/* Some key definitions */
276
303
#define HA_KEY_NULL_LENGTH      1
277
304
#define HA_KEY_BLOB_LENGTH      2
278
305
 
279
 
const uint32_t HA_MAX_REC_LENGTH = 65535;
 
306
#define HA_MAX_REC_LENGTH       65535
280
307
 
281
308
/* Options of START TRANSACTION statement (and later of SET TRANSACTION stmt) */
282
309
enum start_transaction_option_t
295
322
#define HA_CREATE_USED_AUTO             (1L << 0)
296
323
#define HA_CREATE_USED_CHARSET          (1L << 8)
297
324
#define HA_CREATE_USED_DEFAULT_CHARSET  (1L << 9)
 
325
#define HA_CREATE_USED_ROW_FORMAT       (1L << 15)
298
326
 
299
327
/*
300
328
  The below two are not used (and not handled) in this milestone of this WL
402
430
  if (a > b)
403
431
    a=b;
404
432
}
405
 
 
406
 
template<class T> inline void safe_delete(T*& ptr)
407
 
{
408
 
  delete ptr;
409
 
  ptr = 0;
410
 
}
411
433
#else
412
434
#ifdef __GNUC__
413
435
#define set_if_bigger(a,b) do {                 \
473
495
#ifndef offsetof
474
496
#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
475
497
#endif
 
498
#define ulong_to_double(X) ((double) (ulong) (X))
476
499
 
477
500
/* From limits.h instead */
478
501
#ifndef DBL_MIN
500
523
*/
501
524
#define MY_ALIGN(A,L)  (((A) + (L) - 1) & ~((L) - 1))
502
525
#define ALIGN_SIZE(A)  MY_ALIGN((A),sizeof(double))
 
526
/* Size to make adressable obj. */
 
527
#define ALIGN_PTR(A, t) ((t*) MY_ALIGN((A),sizeof(t)))
 
528
/* Offset of field f in structure t */
 
529
#define OFFSET(t, f)  ((size_t)(char *)&((t *)0)->f)
503
530
#ifdef __cplusplus
504
531
#define ADD_TO_PTR(ptr,size,type) (type) (reinterpret_cast<const unsigned char*>(ptr)+size)
 
532
#define PTR_BYTE_DIFF(A,B) (ptrdiff_t) (reinterpret_cast<const unsigned char*>(A) - reinterpret_cast<const unsigned char*>(B))
505
533
#else
506
534
 #define ADD_TO_PTR(ptr,size,type) (type) ((unsigned char*) (ptr)+size)
 
535
 #define PTR_BYTE_DIFF(A,B) (ptrdiff_t) ((unsigned char*) (A) - (unsigned char*) (B))
507
536
#endif
508
537
 
509
538
#define MY_DIV_UP(A, B) (((A) + (B) - 1) / (B))
539
568
#define IO_SIZE 4096
540
569
/* Max file name len */
541
570
#define FN_LEN 256
 
571
/* Max length of extension (part of FN_LEN) */
 
572
#define FN_EXTLEN 20
542
573
/* Max length of full path-name */
543
574
#define FN_REFLEN 512
544
575
/* File extension character */