~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/definitions.h

  • Committer: Brian Aker
  • Date: 2010-09-09 21:45:53 UTC
  • mto: (1756.1.2 build) (1768.2.1 trunk)
  • mto: This revision was merged to the branch mainline in revision 1757.
  • Revision ID: brian@tangent.org-20100909214553-e687rmf5zk9478on
Force unique to just use memory and let the OS handle paging.

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
 
31
31
#include <stdint.h>
32
32
 
33
 
#include "common.h"
34
 
 
35
33
namespace drizzled
36
34
{
37
35
 
199
197
#define FLUSH_TIME              0               /**< Don't flush tables */
200
198
#define MAX_CONNECT_ERRORS      10              ///< errors before disabling host
201
199
 
 
200
#define INTERRUPT_PRIOR 10
 
201
#define CONNECT_PRIOR   9
 
202
#define WAIT_PRIOR      8
 
203
#define QUERY_PRIOR     6
 
204
 
202
205
/* Bits from testflag */
203
206
enum test_flag_bit
204
207
{
221
224
#define MY_CHARSET_BIN_MB_MAXLEN 1
222
225
 
223
226
// uncachable cause
224
 
static const uint32_t UNCACHEABLE_DEPENDENT= 1;
225
 
static const uint32_t UNCACHEABLE_RAND= 2;
226
 
static const uint32_t UNCACHEABLE_SIDEEFFECT= 3;
 
227
#define UNCACHEABLE_DEPENDENT   1
 
228
#define UNCACHEABLE_RAND        2
 
229
#define UNCACHEABLE_SIDEEFFECT  4
227
230
/// forcing to save JOIN for explain
228
 
static const uint32_t UNCACHEABLE_EXPLAIN= 4;
 
231
#define UNCACHEABLE_EXPLAIN     8
229
232
/** Don't evaluate subqueries in prepare even if they're not correlated */
230
 
static const uint32_t UNCACHEABLE_PREPARE= 5;
 
233
#define UNCACHEABLE_PREPARE    16
231
234
/* For uncorrelated SELECT in an UNION with some correlated SELECTs */
232
 
static const uint32_t UNCACHEABLE_UNITED= 6;
 
235
#define UNCACHEABLE_UNITED     32
233
236
 
234
237
/* Used to check GROUP BY list in the MODE_ONLY_FULL_GROUP_BY mode */
235
238
#define UNDEF_POS (-1)
236
239
 
237
240
/* Options to add_table_to_list() */
238
 
static const uint32_t TL_OPTION_UPDATING= 0;
239
 
static const uint32_t TL_OPTION_FORCE_INDEX= 1;
240
 
static const uint32_t TL_OPTION_IGNORE_LEAVES= 2;
241
 
static const uint32_t TL_OPTION_ALIAS= 3;
242
 
static const uint32_t NUM_OF_TABLE_OPTIONS= 4;
 
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
243
245
 
244
246
/* Some portable defines */
245
247
 
409
411
#define MY_COLL_ALLOW_CONV            3
410
412
#define MY_COLL_DISALLOW_NONE         4
411
413
#define MY_COLL_CMP_CONV              7
412
 
 
413
 
inline static void clear_timestamp_auto_bits(enum timestamp_auto_set_type &_target_, 
414
 
                                             const enum timestamp_auto_set_type _bits_)
415
 
{
416
 
  _target_= (enum timestamp_auto_set_type)((int)(_target_) & ~_bits_);
417
 
}
 
414
#define clear_timestamp_auto_bits(_target_, _bits_) \
 
415
  (_target_)= (enum timestamp_auto_set_type)((int)(_target_) & ~(int)(_bits_))
418
416
 
419
417
/*
420
418
 * The following are for the interface with the .frm file
423
421
#define FIELDFLAG_PACK_SHIFT    3
424
422
#define FIELDFLAG_MAX_DEC    31
425
423
 
426
 
#ifdef __cplusplus
427
 
// FIXME: T will just be drizzled::Field::utype, but that would
428
 
// require including field.h. Moving the function elsewhere might be a
429
 
// better idea. Leaving it for restructuring.
430
 
template <typename T> 
431
 
T MTYP_TYPENR(const T& type)
432
 
{
433
 
  return static_cast<T>(type & 127);
434
 
}
435
 
#else
436
424
#define MTYP_TYPENR(type) (type & 127)  /* Remove bits from type */
437
 
#endif
438
 
 
439
 
inline static uint32_t f_settype(const enum enum_field_types x)
440
 
{
441
 
  return (uint32_t(x) << FIELDFLAG_PACK_SHIFT);
442
 
}
 
425
 
 
426
#define f_settype(x)    (((int) x) << FIELDFLAG_PACK_SHIFT)
 
427
 
443
428
 
444
429
#ifdef __cplusplus
445
430
template <class T> void set_if_bigger(T &a, const T &b)
639
624
# define _DTRACE_VERSION 0
640
625
#endif
641
626
 
642
 
typedef uint64_t table_map;   /* Used for table bits in join */
643
 
typedef uint32_t nesting_map; /* Used for flags of nesting constructs */
644
 
 
645
627
} /* namespace drizzled */
646
628
 
647
629
#endif /* DRIZZLED_DEFINITIONS_H */