~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/definitions.h

Modernize our call to the parser, no more casting required.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
3
 *
4
 
 *  Copyright (C) 2008 Sun Microsystems
 
4
 *  Copyright (C) 2008 Sun Microsystems, Inc.
5
5
 *
6
6
 *  This program is free software; you can redistribute it and/or modify
7
7
 *  it under the terms of the GNU General Public License as published by
55
55
#define MAX_FIELD_NAME 34                       /* Max colum name length +2 */
56
56
#define MAX_SYS_VAR_LENGTH 32
57
57
#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") */
 
58
const uint32_t MAX_KEY = MAX_INDEXES;                     /* Max used keys */
 
59
const uint32_t MAX_REF_PARTS = 16;                      /* Max parts used as ref */
 
60
const uint32_t MAX_KEY_LENGTH = 4096;                    // max possible key
 
61
const uint32_t MAX_KEY_LENGTH_DECIMAL_WIDTH = 4; // strlen("4096")
 
62
 
62
63
#if SIZEOF_OFF_T > 4
63
64
#define MAX_REFLENGTH 8                         /* Max length for record ref */
64
65
#else
106
107
*/
107
108
#define MIN_TURBOBM_PATTERN_LEN 3
108
109
 
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
110
/* Below are #defines that used to be in mysql_priv.h */
118
111
/***************************************************************************
119
112
  Configuration parameters
197
190
/* The following can also be changed from the command line */
198
191
#define DEFAULT_CONCURRENCY     10
199
192
#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
193
 
217
194
/* Bits for different SQL modes modes (including ANSI mode) */
218
195
#define MODE_NO_ZERO_DATE               (2)
326
303
#define HA_KEY_NULL_LENGTH      1
327
304
#define HA_KEY_BLOB_LENGTH      2
328
305
 
329
 
#define HA_MAX_REC_LENGTH       65535
 
306
const uint32_t HA_MAX_REC_LENGTH = 65535;
330
307
 
331
308
/* Options of START TRANSACTION statement (and later of SET TRANSACTION stmt) */
332
309
enum start_transaction_option_t
410
387
#define MY_COLL_DISALLOW_NONE         4
411
388
#define MY_COLL_CMP_CONV              7
412
389
 
413
 
inline static void clear_timestamp_auto_bits(enum timestamp_auto_set_type &_target_, 
414
 
                                             const enum timestamp_auto_set_type _bits_)
 
390
inline static void clear_timestamp_auto_bits(timestamp_auto_set_type &_target_, 
 
391
                                             timestamp_auto_set_type _bits_)
415
392
{
416
 
  _target_= (enum timestamp_auto_set_type)((int)(_target_) & ~_bits_);
 
393
  _target_= static_cast<timestamp_auto_set_type>(_target_ & ~_bits_);
417
394
}
418
395
 
419
396
/*
511
488
#define uint64_t2double(A) ((double) (uint64_t) (A))
512
489
#endif
513
490
 
 
491
#ifndef int64_t2double
 
492
#define int64_t2double(A) ((double) (int64_t) (A))
 
493
#endif
 
494
 
514
495
#ifndef offsetof
515
496
#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
516
497
#endif