~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/definitions.h

  • Committer: Lee Bieber
  • Date: 2010-11-07 19:34:48 UTC
  • mfrom: (1910.1.2 build)
  • Revision ID: kalebral@gmail.com-20101107193448-64kdu912qej354sh
Merge Stewart - including adapting and expanding the "differences from mysql" page from the wiki.
Merge Stewart - fix bug 668143: drizzleslap with --commit runs second iteration data load in a transaction

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, Inc.
 
4
 *  Copyright (C) 2008 Sun Microsystems
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
30
30
 
31
31
#include <stdint.h>
32
32
 
33
 
#include "common.h"
34
 
 
35
33
namespace drizzled
36
34
{
37
35
 
59
57
#define MAX_REF_PARTS 16                        /* Max parts used as ref */
60
58
#define MAX_KEY_LENGTH 4096                     /* max possible key */
61
59
#define MAX_KEY_LENGTH_DECIMAL_WIDTH 4          /* strlen("4096") */
62
 
 
63
60
#if SIZEOF_OFF_T > 4
64
61
#define MAX_REFLENGTH 8                         /* Max length for record ref */
65
62
#else
107
104
*/
108
105
#define MIN_TURBOBM_PATTERN_LEN 3
109
106
 
 
107
/*
 
108
   Defines for binary logging.
 
109
   Do not decrease the value of BIN_LOG_HEADER_SIZE.
 
110
   Do not even increase it before checking code.
 
111
*/
 
112
 
 
113
#define BIN_LOG_HEADER_SIZE    4
 
114
 
110
115
/* Below are #defines that used to be in mysql_priv.h */
111
116
/***************************************************************************
112
117
  Configuration parameters
190
195
/* The following can also be changed from the command line */
191
196
#define DEFAULT_CONCURRENCY     10
192
197
#define FLUSH_TIME              0               /**< Don't flush tables */
 
198
#define MAX_CONNECT_ERRORS      10              ///< errors before disabling host
 
199
 
 
200
/* Bits from testflag */
 
201
enum test_flag_bit
 
202
{
 
203
  TEST_PRINT_CACHED_TABLES= 1,
 
204
  TEST_NO_KEY_GROUP,
 
205
  TEST_MIT_THREAD,
 
206
  TEST_KEEP_TMP_TABLES,
 
207
  TEST_READCHECK, /**< Force use of readcheck */
 
208
  TEST_NO_EXTRA,
 
209
  TEST_CORE_ON_SIGNAL, /**< Give core if signal */
 
210
  TEST_NO_STACKTRACE,
 
211
  TEST_SIGINT, /**< Allow sigint on threads */
 
212
  TEST_SYNCHRONIZATION /**< get server to do sleep in some places */
 
213
};
193
214
 
194
215
/* Bits for different SQL modes modes (including ANSI mode) */
195
216
#define MODE_NO_ZERO_DATE               (2)
386
407
#define MY_COLL_ALLOW_CONV            3
387
408
#define MY_COLL_DISALLOW_NONE         4
388
409
#define MY_COLL_CMP_CONV              7
389
 
 
390
 
inline static void clear_timestamp_auto_bits(timestamp_auto_set_type &_target_, 
391
 
                                             timestamp_auto_set_type _bits_)
392
 
{
393
 
  _target_= static_cast<timestamp_auto_set_type>(_target_ & ~_bits_);
394
 
}
 
410
#define clear_timestamp_auto_bits(_target_, _bits_) \
 
411
  (_target_)= (enum timestamp_auto_set_type)((int)(_target_) & ~(int)(_bits_))
395
412
 
396
413
/*
397
414
 * The following are for the interface with the .frm file
400
417
#define FIELDFLAG_PACK_SHIFT    3
401
418
#define FIELDFLAG_MAX_DEC    31
402
419
 
403
 
#ifdef __cplusplus
404
 
// FIXME: T will just be drizzled::Field::utype, but that would
405
 
// require including field.h. Moving the function elsewhere might be a
406
 
// better idea. Leaving it for restructuring.
407
 
template <typename T> 
408
 
T MTYP_TYPENR(const T& type)
409
 
{
410
 
  return static_cast<T>(type & 127);
411
 
}
412
 
#else
413
420
#define MTYP_TYPENR(type) (type & 127)  /* Remove bits from type */
414
 
#endif
415
 
 
416
 
inline static uint32_t f_settype(const enum enum_field_types x)
417
 
{
418
 
  return (uint32_t(x) << FIELDFLAG_PACK_SHIFT);
419
 
}
 
421
 
 
422
#define f_settype(x)    (((int) x) << FIELDFLAG_PACK_SHIFT)
 
423
 
420
424
 
421
425
#ifdef __cplusplus
422
426
template <class T> void set_if_bigger(T &a, const T &b)
488
492
#define uint64_t2double(A) ((double) (uint64_t) (A))
489
493
#endif
490
494
 
491
 
#ifndef int64_t2double
492
 
#define int64_t2double(A) ((double) (int64_t) (A))
493
 
#endif
494
 
 
495
495
#ifndef offsetof
496
496
#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
497
497
#endif