1
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
2
* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
4
* Copyright (C) 2008 Sun Microsystems
4
* Copyright (C) 2008 Sun Microsystems, Inc.
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
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") */
60
63
#if SIZEOF_OFF_T > 4
61
64
#define MAX_REFLENGTH 8 /* Max length for record ref */
105
108
#define MIN_TURBOBM_PATTERN_LEN 3
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.
113
#define BIN_LOG_HEADER_SIZE 4
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
200
#define INTERRUPT_PRIOR 10
201
#define CONNECT_PRIOR 9
203
#define QUERY_PRIOR 6
205
/* Bits from testflag */
208
TEST_PRINT_CACHED_TABLES= 1,
211
TEST_KEEP_TMP_TABLES,
212
TEST_READCHECK, /**< Force use of readcheck */
214
TEST_CORE_ON_SIGNAL, /**< Give core if signal */
216
TEST_SIGINT, /**< Allow sigint on threads */
217
TEST_SYNCHRONIZATION /**< get server to do sleep in some places */
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
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;
237
211
/* Used to check GROUP BY list in the MODE_ONLY_FULL_GROUP_BY mode */
238
212
#define UNDEF_POS (-1)
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;
246
221
/* Some portable defines */
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_))
390
inline static void clear_timestamp_auto_bits(timestamp_auto_set_type &_target_,
391
timestamp_auto_set_type _bits_)
393
_target_= static_cast<timestamp_auto_set_type>(_target_ & ~_bits_);
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
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)
410
return static_cast<T>(type & 127);
424
413
#define MTYP_TYPENR(type) (type & 127) /* Remove bits from type */
426
#define f_settype(x) (((int) x) << FIELDFLAG_PACK_SHIFT)
416
inline static uint32_t f_settype(const enum enum_field_types x)
418
return (uint32_t(x) << FIELDFLAG_PACK_SHIFT);
429
421
#ifdef __cplusplus
430
422
template <class T> void set_if_bigger(T &a, const T &b)
624
620
# define _DTRACE_VERSION 0
623
typedef uint64_t table_map; /* Used for table bits in join */
624
typedef uint32_t nesting_map; /* Used for flags of nesting constructs */
627
626
} /* namespace drizzled */
629
628
#endif /* DRIZZLED_DEFINITIONS_H */