~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/definitions.h

  • Committer: Stewart Smith
  • Date: 2010-02-15 01:56:32 UTC
  • mto: (1273.13.96 build)
  • mto: This revision was merged to the branch mainline in revision 1308.
  • Revision ID: stewart@flamingspork.com-20100215015632-pm7lnxfq5j5uh8kj
move DATABASE() to function plugin. modify parser so that it looks for a function named 'database' when DATABASE() is called. Special case still needed in parser due to hilarity of not-really-reserved words.

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
#define LANGUAGE        "english/"
39
39
#define TEMP_PREFIX     "MY"
40
40
#define LOG_PREFIX      "ML"
 
41
#define PROGDIR         "bin/"
41
42
 
42
43
#define ER(X) ::drizzled::error_message((X))
43
44
 
 
45
#define LIBLEN FN_REFLEN-FN_LEN                 /* Max l{ngd p} dev */
44
46
/* extra 4+4 bytes for slave tmp tables */
45
47
#define MAX_DBKEY_LENGTH (NAME_LEN*2+1+1+4+4)
46
48
#define MAX_ALIAS_NAME 256
81
83
#define MAX_SORT_MEMORY (2048*1024-MALLOC_OVERHEAD)
82
84
#define MIN_SORT_MEMORY (32*1024-MALLOC_OVERHEAD)
83
85
 
 
86
/* Memory allocated when parsing a statement / saving a statement */
 
87
#define MEM_ROOT_BLOCK_SIZE       8192
 
88
#define MEM_ROOT_PREALLOC         8192
 
89
 
84
90
#define DEFAULT_ERROR_COUNT     64
85
91
#define EXTRA_RECORDS   10                      /* Extra records in sort */
 
92
#define SCROLL_EXTRA    5                       /* Extra scroll-rows. */
 
93
#define FIELD_NAME_USED ((uint32_t) 32768)              /* Bit set if fieldname used */
 
94
#define FIELD_NR_MASK   16383                   /* To get fieldnumber */
 
95
#define FERR            -1                      /* Error from my_functions */
 
96
#define CREATE_MODE     0                       /* Default mode on new files */
86
97
#define NAMES_SEP_CHAR  '\377'                  /* Char to sep. names */
87
98
 
88
99
#define READ_RECORD_BUFFER      (uint32_t) (IO_SIZE*8) /* Pointer_buffer_size */
89
100
#define DISK_BUFFER_SIZE        (uint32_t) (IO_SIZE*16) /* Size of diskbuffer */
90
101
 
 
102
#define ME_INFO (ME_HOLDTANG+ME_OLDWIN+ME_NOREFRESH)
91
103
#define ME_ERROR (ME_BELL+ME_OLDWIN+ME_NOREFRESH)
92
104
#define MYF_RW MYF(MY_WME+MY_NABP)              /* Vid my_read & my_write */
93
105
 
106
118
 
107
119
#define BIN_LOG_HEADER_SIZE    4
108
120
 
 
121
#define COLUMN_FORMAT_MASK 7
 
122
#define COLUMN_FORMAT_SHIFT 3
 
123
 
109
124
/* Below are #defines that used to be in mysql_priv.h */
110
125
/***************************************************************************
111
126
  Configuration parameters
129
144
#define STACK_MIN_SIZE_FOR_OPEN 1024*80
130
145
#define STACK_BUFF_ALLOC        352     ///< For stack overrun checks
131
146
 
 
147
#define TEMP_POOL_SIZE          128
 
148
 
132
149
#define QUERY_ALLOC_BLOCK_SIZE          8192
133
150
#define QUERY_ALLOC_PREALLOC_SIZE       8192
 
151
#define TRANS_ALLOC_BLOCK_SIZE          4096
 
152
#define TRANS_ALLOC_PREALLOC_SIZE       4096
134
153
#define RANGE_ALLOC_BLOCK_SIZE          4096
135
154
#define TABLE_ALLOC_BLOCK_SIZE          1024
136
155
#define WARN_ALLOC_BLOCK_SIZE           2048
142
161
*/
143
162
#define MIN_FILE_LENGTH_TO_USE_ROW_CACHE (10L*1024*1024)
144
163
#define MIN_ROWS_TO_USE_TABLE_CACHE      100
 
164
#define MIN_ROWS_TO_USE_BULK_INSERT      100
145
165
 
146
166
/**
147
167
  The following is used to decide if MySQL should use table scanning
233
253
/* Used to check GROUP BY list in the MODE_ONLY_FULL_GROUP_BY mode */
234
254
#define UNDEF_POS (-1)
235
255
 
 
256
/* sql_show.cc:show_log_files() */
 
257
#define SHOW_LOG_STATUS_FREE "FREE"
 
258
#define SHOW_LOG_STATUS_INUSE "IN USE"
 
259
 
236
260
/* Options to add_table_to_list() */
237
261
#define TL_OPTION_UPDATING      1
238
262
#define TL_OPTION_FORCE_INDEX   2
257
281
 
258
282
#define STRING_BUFFER_USUAL_SIZE 80
259
283
 
 
284
/*
 
285
  Some defines for exit codes for ::is_equal class functions.
 
286
*/
 
287
#define IS_EQUAL_NO 0
 
288
#define IS_EQUAL_YES 1
 
289
#define IS_EQUAL_PACK_LENGTH 2
 
290
 
 
291
 
260
292
typedef void *range_seq_t;
261
293
 
262
294
enum ha_stat_type { HA_ENGINE_STATUS, HA_ENGINE_LOGS, HA_ENGINE_MUTEX };
271
303
#define HA_ADMIN_INVALID         -5
272
304
#define HA_ADMIN_REJECT          -6
273
305
 
 
306
#define HA_NOT_DELETE_WITH_CACHE (1 << 18)
 
307
 
274
308
/* bits in index_flags(index_number) for what you can do with index */
275
309
#define HA_READ_NEXT            1       /* TODO really use this flag */
276
310
#define HA_READ_PREV            2       /* supports ::index_prev */
283
317
  set for unordered (e.g. HASH) indexes.
284
318
*/
285
319
#define HA_KEY_SCAN_NOT_ROR     128
 
320
#define HA_DO_INDEX_COND_PUSHDOWN  256 /* Supports Index Condition Pushdown */
286
321
 
287
322
/* operations for disable/enable indexes */
288
323
#define HA_KEY_SWITCH_NONUNIQ      0
347
382
#define HA_CREATE_USED_KEY_BLOCK_SIZE   (1L << 19)
348
383
#define HA_CREATE_USED_BLOCK_SIZE       (1L << 22)
349
384
 
 
385
#define MAXGTRIDSIZE 64
 
386
#define MAXBQUALSIZE 64
 
387
 
350
388
/*
351
389
  The below two are not used (and not handled) in this milestone of this WL
352
390
  entry because there seems to be no use for them at this stage of
388
426
typedef int myf;
389
427
#define MYF(v)          (static_cast<drizzled::myf>(v))
390
428
 
 
429
#define MY_I_S_MAYBE_NULL 1
 
430
#define MY_I_S_UNSIGNED   2
 
431
 
 
432
 
391
433
/*
392
434
   "Declared Type Collation"
393
435
   A combination of collation and its derivation.
421
463
 
422
464
#define MTYP_TYPENR(type) (type & 127)  /* Remove bits from type */
423
465
 
 
466
#define f_packtype(x)   (((x) >> FIELDFLAG_PACK_SHIFT) & 15)
424
467
#define f_settype(x)    (((int) x) << FIELDFLAG_PACK_SHIFT)
425
468
 
426
469
 
495
538
 
496
539
/* Some defines of functions for portability */
497
540
 
 
541
#undef remove    /* Crashes MySQL on SCO 5.0.0 */
498
542
#ifndef uint64_t2double
499
543
#define uint64_t2double(A) ((double) (uint64_t) (A))
500
544
#endif
558
602
 
559
603
#define MY_FILEPOS_ERROR  -1
560
604
 
 
605
/* Defines for time function */
 
606
#define SCALE_SEC  100
 
607
#define SCALE_USEC  10000
 
608
 
561
609
#define DRIZZLE_SERVER
562
610
 
563
611
/* Length of decimal number represented by INT32. */