~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:
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
30
30
 
31
31
#include <stdint.h>
32
32
 
 
33
#include "common.h"
 
34
 
33
35
namespace drizzled
34
36
{
35
37
 
57
59
#define MAX_REF_PARTS 16                        /* Max parts used as ref */
58
60
#define MAX_KEY_LENGTH 4096                     /* max possible key */
59
61
#define MAX_KEY_LENGTH_DECIMAL_WIDTH 4          /* strlen("4096") */
 
62
 
60
63
#if SIZEOF_OFF_T > 4
61
64
#define MAX_REFLENGTH 8                         /* Max length for record ref */
62
65
#else
104
107
*/
105
108
#define MIN_TURBOBM_PATTERN_LEN 3
106
109
 
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
 
 
115
110
/* Below are #defines that used to be in mysql_priv.h */
116
111
/***************************************************************************
117
112
  Configuration parameters
195
190
/* The following can also be changed from the command line */
196
191
#define DEFAULT_CONCURRENCY     10
197
192
#define FLUSH_TIME              0               /**< Don't flush tables */
198
 
#define MAX_CONNECT_ERRORS      10              ///< errors before disabling host
199
 
 
200
 
#define INTERRUPT_PRIOR 10
201
 
#define CONNECT_PRIOR   9
202
 
#define WAIT_PRIOR      8
203
 
#define QUERY_PRIOR     6
204
 
 
205
 
/* Bits from testflag */
206
 
enum test_flag_bit
207
 
{
208
 
  TEST_PRINT_CACHED_TABLES= 1,
209
 
  TEST_NO_KEY_GROUP,
210
 
  TEST_MIT_THREAD,
211
 
  TEST_KEEP_TMP_TABLES,
212
 
  TEST_READCHECK, /**< Force use of readcheck */
213
 
  TEST_NO_EXTRA,
214
 
  TEST_CORE_ON_SIGNAL, /**< Give core if signal */
215
 
  TEST_NO_STACKTRACE,
216
 
  TEST_SIGINT, /**< Allow sigint on threads */
217
 
  TEST_SYNCHRONIZATION /**< get server to do sleep in some places */
218
 
};
219
193
 
220
194
/* Bits for different SQL modes modes (including ANSI mode) */
221
195
#define MODE_NO_ZERO_DATE               (2)
224
198
#define MY_CHARSET_BIN_MB_MAXLEN 1
225
199
 
226
200
// uncachable cause
227
 
#define UNCACHEABLE_DEPENDENT   1
228
 
#define UNCACHEABLE_RAND        2
229
 
#define UNCACHEABLE_SIDEEFFECT  4
 
201
static const uint32_t UNCACHEABLE_DEPENDENT= 1;
 
202
static const uint32_t UNCACHEABLE_RAND= 2;
 
203
static const uint32_t UNCACHEABLE_SIDEEFFECT= 3;
230
204
/// forcing to save JOIN for explain
231
 
#define UNCACHEABLE_EXPLAIN     8
 
205
static const uint32_t UNCACHEABLE_EXPLAIN= 4;
232
206
/** Don't evaluate subqueries in prepare even if they're not correlated */
233
 
#define UNCACHEABLE_PREPARE    16
 
207
static const uint32_t UNCACHEABLE_PREPARE= 5;
234
208
/* For uncorrelated SELECT in an UNION with some correlated SELECTs */
235
 
#define UNCACHEABLE_UNITED     32
 
209
static const uint32_t UNCACHEABLE_UNITED= 6;
236
210
 
237
211
/* Used to check GROUP BY list in the MODE_ONLY_FULL_GROUP_BY mode */
238
212
#define UNDEF_POS (-1)
239
213
 
240
214
/* Options to add_table_to_list() */
241
 
#define TL_OPTION_UPDATING      1
242
 
#define TL_OPTION_FORCE_INDEX   2
243
 
#define TL_OPTION_IGNORE_LEAVES 4
244
 
#define TL_OPTION_ALIAS         8
 
215
static const uint32_t TL_OPTION_UPDATING= 0;
 
216
static const uint32_t TL_OPTION_FORCE_INDEX= 1;
 
217
static const uint32_t TL_OPTION_IGNORE_LEAVES= 2;
 
218
static const uint32_t TL_OPTION_ALIAS= 3;
 
219
static const uint32_t NUM_OF_TABLE_OPTIONS= 4;
245
220
 
246
221
/* Some portable defines */
247
222
 
411
386
#define MY_COLL_ALLOW_CONV            3
412
387
#define MY_COLL_DISALLOW_NONE         4
413
388
#define MY_COLL_CMP_CONV              7
414
 
#define clear_timestamp_auto_bits(_target_, _bits_) \
415
 
  (_target_)= (enum timestamp_auto_set_type)((int)(_target_) & ~(int)(_bits_))
 
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
}
416
395
 
417
396
/*
418
397
 * The following are for the interface with the .frm file
421
400
#define FIELDFLAG_PACK_SHIFT    3
422
401
#define FIELDFLAG_MAX_DEC    31
423
402
 
 
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
424
413
#define MTYP_TYPENR(type) (type & 127)  /* Remove bits from type */
425
 
 
426
 
#define f_settype(x)    (((int) x) << FIELDFLAG_PACK_SHIFT)
427
 
 
 
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
}
428
420
 
429
421
#ifdef __cplusplus
430
422
template <class T> void set_if_bigger(T &a, const T &b)
496
488
#define uint64_t2double(A) ((double) (uint64_t) (A))
497
489
#endif
498
490
 
 
491
#ifndef int64_t2double
 
492
#define int64_t2double(A) ((double) (int64_t) (A))
 
493
#endif
 
494
 
499
495
#ifndef offsetof
500
496
#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
501
497
#endif
624
620
# define _DTRACE_VERSION 0
625
621
#endif
626
622
 
 
623
typedef uint64_t table_map;   /* Used for table bits in join */
 
624
typedef uint32_t nesting_map; /* Used for flags of nesting constructs */
 
625
 
627
626
} /* namespace drizzled */
628
627
 
629
628
#endif /* DRIZZLED_DEFINITIONS_H */