~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/definitions.h

  • Committer: Jay Pipes
  • Date: 2008-08-06 01:14:33 UTC
  • mto: (264.1.6 codestyle)
  • mto: This revision was merged to the branch mainline in revision 266.
  • Revision ID: jay@mysql.com-20080806011433-hd347xjpi0jsf2ca
* Ensured all drizzled/field/x.cc files to include mysql_priv.h
* Remove all includes from drizzled/field/x.h files
* pull connect and show function declarations out into separate
  header files
* More cleanup of mysql_priv.h including removing all conditional
  includes
* Modified all plugins to ensure MYSQL_SERVER is not defined and
  that they include the proper drizzled/common_includes.h and not
  the full mysql_priv.h
* Multiple comments to mark TODO items...

Show diffs side-by-side

added added

removed removed

Lines of Context:
223
223
#define COLUMN_FORMAT_MASK 7
224
224
#define COLUMN_FORMAT_SHIFT 3
225
225
 
 
226
/* Below are #defines that used to be in mysql_priv.h */
 
227
/***************************************************************************
 
228
  Configuration parameters
 
229
****************************************************************************/
 
230
#define ACL_CACHE_SIZE          256
 
231
#define MAX_PASSWORD_LENGTH     32
 
232
#define HOST_CACHE_SIZE         128
 
233
#define MAX_ACCEPT_RETRY        10      // Test accept this many times
 
234
#define MAX_FIELDS_BEFORE_HASH  32
 
235
#define USER_VARS_HASH_SIZE     16
 
236
#define TABLE_OPEN_CACHE_MIN    64
 
237
#define TABLE_OPEN_CACHE_DEFAULT 64
 
238
 
 
239
/* 
 
240
 Value of 9236 discovered through binary search 2006-09-26 on Ubuntu Dapper
 
241
 Drake, libc6 2.3.6-0ubuntu2, Linux kernel 2.6.15-27-686, on x86.  (Added 
 
242
 100 bytes as reasonable buffer against growth and other environments'
 
243
 requirements.)
 
244
 
 
245
 Feel free to raise this by the smallest amount you can to get the
 
246
 "execution_constants" test to pass.
 
247
 */
 
248
#define STACK_MIN_SIZE          12000   ///< Abort if less stack during eval.
 
249
 
 
250
#define STACK_MIN_SIZE_FOR_OPEN 1024*80
 
251
#define STACK_BUFF_ALLOC        352     ///< For stack overrun checks
 
252
 
 
253
/** 
 
254
 * @TODO Move into a drizzled.h since it's only used in drizzled.cc
 
255
 *
 
256
 * @TODO Rename to DRIZZLED_NET_RETRY_COUNT
 
257
 */
 
258
#ifndef MYSQLD_NET_RETRY_COUNT
 
259
#define MYSQLD_NET_RETRY_COUNT  10      ///< Abort read after this many int.
 
260
#endif
 
261
#define TEMP_POOL_SIZE          128
 
262
 
 
263
#define QUERY_ALLOC_BLOCK_SIZE          8192
 
264
#define QUERY_ALLOC_PREALLOC_SIZE       8192
 
265
#define TRANS_ALLOC_BLOCK_SIZE          4096
 
266
#define TRANS_ALLOC_PREALLOC_SIZE       4096
 
267
#define RANGE_ALLOC_BLOCK_SIZE          4096
 
268
#define ACL_ALLOC_BLOCK_SIZE            1024
 
269
#define UDF_ALLOC_BLOCK_SIZE            1024
 
270
#define TABLE_ALLOC_BLOCK_SIZE          1024
 
271
#define BDB_LOG_ALLOC_BLOCK_SIZE        1024
 
272
#define WARN_ALLOC_BLOCK_SIZE           2048
 
273
#define WARN_ALLOC_PREALLOC_SIZE        1024
 
274
#define PROFILE_ALLOC_BLOCK_SIZE  2048
 
275
#define PROFILE_ALLOC_PREALLOC_SIZE 1024
 
276
 
 
277
/*
 
278
  The following parameters is to decide when to use an extra cache to
 
279
  optimise seeks when reading a big table in sorted order
 
280
*/
 
281
#define MIN_FILE_LENGTH_TO_USE_ROW_CACHE (10L*1024*1024)
 
282
#define MIN_ROWS_TO_USE_TABLE_CACHE      100
 
283
#define MIN_ROWS_TO_USE_BULK_INSERT      100
 
284
 
 
285
/**
 
286
  The following is used to decide if MySQL should use table scanning
 
287
  instead of reading with keys.  The number says how many evaluation of the
 
288
  WHERE clause is comparable to reading one extra row from a table.
 
289
*/
 
290
#define TIME_FOR_COMPARE   5    // 5 compares == one read
 
291
 
 
292
/**
 
293
  Number of comparisons of table rowids equivalent to reading one row from a 
 
294
  table.
 
295
*/
 
296
#define TIME_FOR_COMPARE_ROWID  (TIME_FOR_COMPARE*2)
 
297
 
 
298
/*
 
299
  For sequential disk seeks the cost formula is:
 
300
    DISK_SEEK_BASE_COST + DISK_SEEK_PROP_COST * #blocks_to_skip  
 
301
  
 
302
  The cost of average seek 
 
303
    DISK_SEEK_BASE_COST + DISK_SEEK_PROP_COST*BLOCKS_IN_AVG_SEEK =1.0.
 
304
*/
 
305
#define DISK_SEEK_BASE_COST ((double)0.9)
 
306
 
 
307
#define BLOCKS_IN_AVG_SEEK  128
 
308
 
 
309
#define DISK_SEEK_PROP_COST ((double)0.1/BLOCKS_IN_AVG_SEEK)
 
310
 
 
311
 
 
312
/**
 
313
  Number of rows in a reference table when refereed through a not unique key.
 
314
  This value is only used when we don't know anything about the key
 
315
  distribution.
 
316
*/
 
317
#define MATCHING_ROWS_IN_OTHER_TABLE 10
 
318
 
 
319
/** Don't pack string keys shorter than this (if PACK_KEYS=1 isn't used). */
 
320
#define KEY_DEFAULT_PACK_LENGTH 8
 
321
 
 
322
/** Characters shown for the command in 'show processlist'. */
 
323
#define PROCESS_LIST_WIDTH 100
 
324
/* Characters shown for the command in 'information_schema.processlist' */
 
325
#define PROCESS_LIST_INFO_WIDTH 65535
 
326
 
 
327
#define PRECISION_FOR_DOUBLE 53
 
328
#define PRECISION_FOR_FLOAT  24
 
329
 
 
330
/*
 
331
  Default time to wait before aborting a new client connection
 
332
  that does not respond to "initial server greeting" timely
 
333
*/
 
334
#define CONNECT_TIMEOUT         10
 
335
 
 
336
/* The following can also be changed from the command line */
 
337
#define DEFAULT_CONCURRENCY     10
 
338
#define FLUSH_TIME              0               /**< Don't flush tables */
 
339
#define MAX_CONNECT_ERRORS      10              ///< errors before disabling host
 
340
 
 
341
#define INTERRUPT_PRIOR 10
 
342
#define CONNECT_PRIOR   9
 
343
#define WAIT_PRIOR      8
 
344
#define QUERY_PRIOR     6
 
345
 
 
346
        /* Bits from testflag */
 
347
#define TEST_PRINT_CACHED_TABLES 1
 
348
#define TEST_NO_KEY_GROUP        2
 
349
#define TEST_MIT_THREAD         4
 
350
#define TEST_BLOCKING           8
 
351
#define TEST_KEEP_TMP_TABLES    16
 
352
#define TEST_READCHECK          64      /**< Force use of readcheck */
 
353
#define TEST_NO_EXTRA           128
 
354
#define TEST_CORE_ON_SIGNAL     256     /**< Give core if signal */
 
355
#define TEST_NO_STACKTRACE      512
 
356
#define TEST_SIGINT             1024    /**< Allow sigint on threads */
 
357
#define TEST_SYNCHRONIZATION    2048    /**< get server to do sleep in some places */
 
358
#endif /* End ifndef MYSQL_CLIENT */
 
359
 
 
360
/* The rest of the file is included in the server only */
 
361
#ifndef MYSQL_CLIENT
 
362
 
 
363
/* Bits for different SQL modes modes (including ANSI mode) */
 
364
#define MODE_REAL_AS_FLOAT              1
 
365
#define MODE_PIPES_AS_CONCAT            2
 
366
#define MODE_ANSI_QUOTES                4
 
367
#define MODE_IGNORE_SPACE               8
 
368
#define MODE_NOT_USED                   16
 
369
#define MODE_ONLY_FULL_GROUP_BY         32
 
370
#define MODE_NO_UNSIGNED_SUBTRACTION    64
 
371
#define MODE_NO_DIR_IN_CREATE           128
 
372
#define MODE_POSTGRESQL                 256
 
373
#define MODE_ORACLE                     512
 
374
#define MODE_MSSQL                      1024
 
375
#define MODE_DB2                        2048
 
376
#define MODE_MAXDB                      4096
 
377
#define MODE_NO_KEY_OPTIONS             8192
 
378
#define MODE_NO_TABLE_OPTIONS           16384
 
379
#define MODE_NO_FIELD_OPTIONS           32768
 
380
#define MODE_MYSQL323                   65536L
 
381
#define MODE_MYSQL40                    (MODE_MYSQL323*2)
 
382
#define MODE_ANSI                       (MODE_MYSQL40*2)
 
383
#define MODE_NO_AUTO_VALUE_ON_ZERO      (MODE_ANSI*2)
 
384
#define MODE_NO_BACKSLASH_ESCAPES       (MODE_NO_AUTO_VALUE_ON_ZERO*2)
 
385
#define MODE_STRICT_TRANS_TABLES        (MODE_NO_BACKSLASH_ESCAPES*2)
 
386
#define MODE_STRICT_ALL_TABLES          (MODE_STRICT_TRANS_TABLES*2)
 
387
#define MODE_NO_ZERO_IN_DATE            (MODE_STRICT_ALL_TABLES*2)
 
388
#define MODE_NO_ZERO_DATE               (MODE_NO_ZERO_IN_DATE*2)
 
389
#define MODE_INVALID_DATES              (MODE_NO_ZERO_DATE*2)
 
390
#define MODE_ERROR_FOR_DIVISION_BY_ZERO (MODE_INVALID_DATES*2)
 
391
#define MODE_TRADITIONAL                (MODE_ERROR_FOR_DIVISION_BY_ZERO*2)
 
392
#define MODE_NO_AUTO_CREATE_USER        (MODE_TRADITIONAL*2)
 
393
#define MODE_HIGH_NOT_PRECEDENCE        (MODE_NO_AUTO_CREATE_USER*2)
 
394
#define MODE_NO_ENGINE_SUBSTITUTION     (MODE_HIGH_NOT_PRECEDENCE*2)
 
395
#define MODE_PAD_CHAR_TO_FULL_LENGTH    (1ULL << 31)
 
396
 
 
397
/* @@optimizer_switch flags */
 
398
#define OPTIMIZER_SWITCH_NO_MATERIALIZATION 1
 
399
#define OPTIMIZER_SWITCH_NO_SEMIJOIN 2
 
400
 
 
401
/*
 
402
  Replication uses 8 bytes to store SQL_MODE in the binary log. The day you
 
403
  use strictly more than 64 bits by adding one more define above, you should
 
404
  contact the replication team because the replication code should then be
 
405
  updated (to store more bytes on disk).
 
406
 
 
407
  NOTE: When adding new SQL_MODE types, make sure to also add them to
 
408
  the scripts used for creating the MySQL system tables
 
409
  in scripts/mysql_system_tables.sql and scripts/mysql_system_tables_fix.sql
 
410
 
 
411
*/
 
412
#define RAID_BLOCK_SIZE 1024
 
413
 
 
414
#define MY_CHARSET_BIN_MB_MAXLEN 1
 
415
 
 
416
// uncachable cause
 
417
#define UNCACHEABLE_DEPENDENT   1
 
418
#define UNCACHEABLE_RAND        2
 
419
#define UNCACHEABLE_SIDEEFFECT  4
 
420
/// forcing to save JOIN for explain
 
421
#define UNCACHEABLE_EXPLAIN     8
 
422
/** Don't evaluate subqueries in prepare even if they're not correlated */
 
423
#define UNCACHEABLE_PREPARE    16
 
424
/* For uncorrelated SELECT in an UNION with some correlated SELECTs */
 
425
#define UNCACHEABLE_UNITED     32
 
426
 
 
427
/* Used to check GROUP BY list in the MODE_ONLY_FULL_GROUP_BY mode */
 
428
#define UNDEF_POS (-1)
 
429
 
 
430
/* BINLOG_DUMP options */
 
431
 
 
432
#define BINLOG_DUMP_NON_BLOCK   1
 
433
 
 
434
/* sql_show.cc:show_log_files() */
 
435
#define SHOW_LOG_STATUS_FREE "FREE"
 
436
#define SHOW_LOG_STATUS_INUSE "IN USE"
 
437
 
 
438
/* Options to add_table_to_list() */
 
439
#define TL_OPTION_UPDATING      1
 
440
#define TL_OPTION_FORCE_INDEX   2
 
441
#define TL_OPTION_IGNORE_LEAVES 4
 
442
#define TL_OPTION_ALIAS         8
 
443
 
 
444
/* Some portable defines */
 
445
 
 
446
#define portable_sizeof_char_ptr 8
 
447
 
 
448
#define tmp_file_prefix "#sql"                  /**< Prefix for tmp tables */
 
449
#define tmp_file_prefix_length 4
 
450
 
 
451
/* Flags for calc_week() function.  */
 
452
#define WEEK_MONDAY_FIRST    1
 
453
#define WEEK_YEAR            2
 
454
#define WEEK_FIRST_WEEKDAY   4
 
455
 
 
456
#define STRING_BUFFER_USUAL_SIZE 80
 
457
 
 
458
/*
 
459
  Some defines for exit codes for ::is_equal class functions.
 
460
*/
 
461
#define IS_EQUAL_NO 0
 
462
#define IS_EQUAL_YES 1
 
463
#define IS_EQUAL_PACK_LENGTH 2
 
464
 
 
465
 
226
466
#endif /* DRIZZLE_SERVER_DEFINITIONS_H */