~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/definitions.h

  • Committer: Stewart Smith
  • Date: 2010-03-02 06:41:59 UTC
  • mto: (1309.2.13 build)
  • mto: This revision was merged to the branch mainline in revision 1318.
  • Revision ID: stewart@flamingspork.com-20100302064159-gktw6hcbs3u0fflm
move Item_result out to its own header file and out of common.h

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
 
38
 
/* Global value for how we extend our temporary directory */
39
 
#define GLOBAL_TEMPORARY_EXT ".temporary"
40
 
 
41
36
/* These paths are converted to other systems (WIN95) before use */
42
37
 
43
38
#define LANGUAGE        "english/"
46
41
 
47
42
#define ER(X) ::drizzled::error_message((X))
48
43
 
49
 
/* buffer size for strerror_r() */
50
 
#define STRERROR_MAX 256
51
 
 
52
44
/* extra 4+4 bytes for slave tmp tables */
53
45
#define MAX_DBKEY_LENGTH (NAME_LEN*2+1+1+4+4)
54
46
#define MAX_ALIAS_NAME 256
190
182
 
191
183
/** Characters shown for the command in 'show processlist'. */
192
184
#define PROCESS_LIST_WIDTH 100
 
185
/* Characters shown for the command in 'information_schema.processlist' */
 
186
#define PROCESS_LIST_INFO_WIDTH 65535
193
187
 
194
188
#define PRECISION_FOR_DOUBLE 53
195
189
#define PRECISION_FOR_FLOAT  24
199
193
#define FLUSH_TIME              0               /**< Don't flush tables */
200
194
#define MAX_CONNECT_ERRORS      10              ///< errors before disabling host
201
195
 
 
196
#define INTERRUPT_PRIOR 10
 
197
#define CONNECT_PRIOR   9
 
198
#define WAIT_PRIOR      8
 
199
#define QUERY_PRIOR     6
 
200
 
202
201
/* Bits from testflag */
203
202
enum test_flag_bit
204
203
{
221
220
#define MY_CHARSET_BIN_MB_MAXLEN 1
222
221
 
223
222
// 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;
 
223
#define UNCACHEABLE_DEPENDENT   1
 
224
#define UNCACHEABLE_RAND        2
 
225
#define UNCACHEABLE_SIDEEFFECT  4
227
226
/// forcing to save JOIN for explain
228
 
static const uint32_t UNCACHEABLE_EXPLAIN= 4;
 
227
#define UNCACHEABLE_EXPLAIN     8
229
228
/** Don't evaluate subqueries in prepare even if they're not correlated */
230
 
static const uint32_t UNCACHEABLE_PREPARE= 5;
 
229
#define UNCACHEABLE_PREPARE    16
231
230
/* For uncorrelated SELECT in an UNION with some correlated SELECTs */
232
 
static const uint32_t UNCACHEABLE_UNITED= 6;
 
231
#define UNCACHEABLE_UNITED     32
233
232
 
234
233
/* Used to check GROUP BY list in the MODE_ONLY_FULL_GROUP_BY mode */
235
234
#define UNDEF_POS (-1)
236
235
 
237
236
/* 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;
 
237
#define TL_OPTION_UPDATING      1
 
238
#define TL_OPTION_FORCE_INDEX   2
 
239
#define TL_OPTION_IGNORE_LEAVES 4
 
240
#define TL_OPTION_ALIAS         8
243
241
 
244
242
/* Some portable defines */
245
243
 
346
344
#define HA_CREATE_USED_CHARSET          (1L << 8)
347
345
#define HA_CREATE_USED_DEFAULT_CHARSET  (1L << 9)
348
346
#define HA_CREATE_USED_ROW_FORMAT       (1L << 15)
 
347
#define HA_CREATE_USED_KEY_BLOCK_SIZE   (1L << 19)
 
348
#define HA_CREATE_USED_BLOCK_SIZE       (1L << 22)
349
349
 
350
350
/*
351
351
  The below two are not used (and not handled) in this milestone of this WL
409
409
#define MY_COLL_ALLOW_CONV            3
410
410
#define MY_COLL_DISALLOW_NONE         4
411
411
#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
 
}
 
412
#define clear_timestamp_auto_bits(_target_, _bits_) \
 
413
  (_target_)= (enum timestamp_auto_set_type)((int)(_target_) & ~(int)(_bits_))
418
414
 
419
415
/*
420
416
 * The following are for the interface with the .frm file
423
419
#define FIELDFLAG_PACK_SHIFT    3
424
420
#define FIELDFLAG_MAX_DEC    31
425
421
 
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
422
#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
 
}
 
423
 
 
424
#define f_settype(x)    (((int) x) << FIELDFLAG_PACK_SHIFT)
 
425
 
443
426
 
444
427
#ifdef __cplusplus
445
428
template <class T> void set_if_bigger(T &a, const T &b)
501
484
static const uint32_t ONCE_ALLOC_INIT= 4096;
502
485
/* Typical record cash */
503
486
static const uint32_t RECORD_CACHE_SIZE= 64*1024;
 
487
/* Typical key cash */
 
488
static const uint32_t KEY_CACHE_SIZE= 8*1024*1024;
 
489
 
 
490
/* Default size of a key cache block  */
 
491
static const uint32_t KEY_CACHE_BLOCK_SIZE= 1024;
504
492
 
505
493
 
506
494
/* Some things that this system doesn't have */
639
627
# define _DTRACE_VERSION 0
640
628
#endif
641
629
 
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
630
} /* namespace drizzled */
646
631
 
647
632
#endif /* DRIZZLED_DEFINITIONS_H */