~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/definitions.h

  • Committer: Monty Taylor
  • Date: 2008-09-15 17:24:04 UTC
  • Revision ID: monty@inaugust.com-20080915172404-ygh6hiyu0q7qpa9x
Removed strndup calls.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
 
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
 
 *
4
 
 *  Copyright (C) 2008 Sun Microsystems
5
 
 *
6
 
 *  This program is free software; you can redistribute it and/or modify
7
 
 *  it under the terms of the GNU General Public License as published by
8
 
 *  the Free Software Foundation; version 2 of the License.
9
 
 *
10
 
 *  This program is distributed in the hope that it will be useful,
11
 
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 
 *  GNU General Public License for more details.
14
 
 *
15
 
 *  You should have received a copy of the GNU General Public License
16
 
 *  along with this program; if not, write to the Free Software
17
 
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18
 
 */
19
 
 
20
 
#include CSTDINT_H
 
1
/* Copyright (C) 2000-2006 MySQL AB
 
2
 
 
3
   This program is free software; you can redistribute it and/or modify
 
4
   it under the terms of the GNU General Public License as published by
 
5
   the Free Software Foundation; version 2 of the License.
 
6
 
 
7
   This program is distributed in the hope that it will be useful,
 
8
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
9
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
10
   GNU General Public License for more details.
 
11
 
 
12
   You should have received a copy of the GNU General Public License
 
13
   along with this program; if not, write to the Free Software
 
14
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
15
 
21
16
 
22
17
/**
23
18
 * @file
49
44
#define PLUGINDIR       "lib/plugin"
50
45
#endif
51
46
 
52
 
#define ER(X) error_message((X))
 
47
#define ER(X) _(drizzled_error_messages[(X) - ER_ERROR_FIRST])
 
48
#define ER_SAFE(X) (((X) >= ER_ERROR_FIRST && (X) <= ER_ERROR_LAST) ? ER(X) : _("Invalid error code"))
53
49
 
 
50
#define ERRMAPP 1                               /* Errormap f|r my_error */
54
51
#define LIBLEN FN_REFLEN-FN_LEN                 /* Max l{ngd p} dev */
55
52
/* extra 4+4 bytes for slave tmp tables */
56
53
#define MAX_DBKEY_LENGTH (NAME_LEN*2+1+1+4+4)
311
308
#define TEST_PRINT_CACHED_TABLES 1
312
309
#define TEST_NO_KEY_GROUP        2
313
310
#define TEST_MIT_THREAD         4
 
311
#define TEST_BLOCKING           8
314
312
#define TEST_KEEP_TMP_TABLES    16
315
313
#define TEST_READCHECK          64      /**< Force use of readcheck */
316
314
#define TEST_NO_EXTRA           128
318
316
#define TEST_NO_STACKTRACE      512
319
317
#define TEST_SIGINT             1024    /**< Allow sigint on threads */
320
318
#define TEST_SYNCHRONIZATION    2048    /**< get server to do sleep in some places */
 
319
#endif /* End ifndef DRIZZLE_CLIENT */
 
320
 
 
321
/* The rest of the file is included in the server only */
 
322
#ifndef DRIZZLE_CLIENT
321
323
 
322
324
/* Bits for different SQL modes modes (including ANSI mode) */
323
325
#define MODE_NO_ZERO_DATE               (2)
379
381
#define IS_EQUAL_PACK_LENGTH 2
380
382
 
381
383
 
382
 
/**
383
 
  Query type constants.
384
 
 
385
 
  QT_ORDINARY -- ordinary SQL query.
386
 
  QT_IS -- SQL query to be shown in INFORMATION_SCHEMA (in utf8 and without
387
 
  character set introducers).
388
 
 
389
 
  @TODO
390
 
 
391
 
  Move this out of here once Stew's done with UDF breakout.  The following headers need it:
392
 
 
393
 
    sql_lex.h --> included by sql_class.h
394
 
    item.h
395
 
    table.h
396
 
    item_func.h
397
 
    item_subselect.h
398
 
    item_timefunc.h
399
 
    item_sum.h
400
 
    item_cmpfunc.h
401
 
    item_strfunc.h
402
 
*/
403
 
enum enum_query_type
404
 
{
405
 
  QT_ORDINARY,
406
 
  QT_IS
407
 
};
408
 
 
409
 
 
410
 
/**
411
 
 * @TODO Move to a separate header?
412
 
 *
413
 
 * It's needed by item.h and field.h, which are both inter-dependent
414
 
 * and contain forward declarations of many structs/classes in the
415
 
 * other header file.
416
 
 *
417
 
 * What is needed is a separate header file that is included
418
 
 * by *both* item.h and field.h to resolve inter-dependencies
419
 
 *
420
 
 * But, probably want to hold off on this until Stew finished the UDF cleanup
421
 
 */
422
 
enum Derivation
423
 
{
424
 
  DERIVATION_IGNORABLE= 5,
425
 
  DERIVATION_COERCIBLE= 4,
426
 
  DERIVATION_SYSCONST= 3,
427
 
  DERIVATION_IMPLICIT= 2,
428
 
  DERIVATION_NONE= 1,
429
 
  DERIVATION_EXPLICIT= 0
430
 
};
431
 
 
432
 
/**
433
 
 * Opening modes for open_temporary_table and open_table_from_share
434
 
 *
435
 
 * @TODO Put this into an appropriate header. It is only needed in:
436
 
 *
437
 
 *    table.cc
438
 
 *    sql_base.cc
439
 
 */
440
 
enum open_table_mode
441
 
{
442
 
  OTM_OPEN= 0,
443
 
  OTM_CREATE= 1,
444
 
  OTM_ALTER= 2
445
 
};
446
 
 
447
 
enum enum_parsing_place
448
 
{
449
 
  NO_MATTER
450
 
  , IN_HAVING
451
 
  , SELECT_LIST
452
 
  , IN_WHERE
453
 
  , IN_ON
454
 
};
455
 
 
456
 
enum enum_mysql_completiontype {
457
 
  ROLLBACK_RELEASE= -2
458
 
  , ROLLBACK= 1
459
 
  , ROLLBACK_AND_CHAIN= 7
460
 
  , COMMIT_RELEASE= -1
461
 
  , COMMIT= 0
462
 
  , COMMIT_AND_CHAIN= 6
463
 
};
464
 
 
465
 
enum enum_check_fields
466
 
{
467
 
  CHECK_FIELD_IGNORE
468
 
  , CHECK_FIELD_WARN
469
 
  , CHECK_FIELD_ERROR_FOR_NULL
470
 
};
471
 
 
472
 
enum enum_var_type
473
 
{
474
 
  OPT_DEFAULT= 0
475
 
  , OPT_SESSION
476
 
  , OPT_GLOBAL
477
 
};
478
 
 
479
 
 
480
 
typedef uint64_t query_id_t;
481
 
 
482
 
/**
483
 
   The maximum is defined as (ULONG_MAX/1000) with 4 bytes uint32_t
484
 
*/
485
 
const uint32_t SLAVE_MAX_HEARTBEAT_PERIOD= 4294967;
486
 
 
487
 
#define SLAVE_NET_TIMEOUT  3600
488
 
 
489
 
#define MAX_SLAVE_ERROR    2000
490
 
 
491
 
/* masks for start/stop operations on io and sql slave threads */
492
 
#define SLAVE_IO  1
493
 
#define SLAVE_SQL 2
494
 
 
495
 
#ifndef NO_HASH
496
 
#define NO_HASH                         /* Not yet implemented */
497
 
#endif
498
 
 
499
 
// the following is for checking tables
500
 
 
501
 
#define HA_ADMIN_ALREADY_DONE     1
502
 
#define HA_ADMIN_OK               0
503
 
#define HA_ADMIN_NOT_IMPLEMENTED -1
504
 
#define HA_ADMIN_FAILED          -2
505
 
#define HA_ADMIN_CORRUPT         -3
506
 
#define HA_ADMIN_INTERNAL_ERROR  -4
507
 
#define HA_ADMIN_INVALID         -5
508
 
#define HA_ADMIN_REJECT          -6
509
 
#define HA_ADMIN_TRY_ALTER       -7
510
 
#define HA_ADMIN_WRONG_CHECKSUM  -8
511
 
#define HA_ADMIN_NOT_BASE_TABLE  -9
512
 
#define HA_ADMIN_NEEDS_UPGRADE  -10
513
 
#define HA_ADMIN_NEEDS_ALTER    -11
514
 
#define HA_ADMIN_NEEDS_CHECK    -12
515
 
 
516
 
 
517
 
#define HA_ADD_INDEX                  (0)
518
 
#define HA_DROP_INDEX                 (1)
519
 
#define HA_ALTER_INDEX                (2)
520
 
#define HA_RENAME_INDEX               (3)
521
 
#define HA_ADD_UNIQUE_INDEX           (4)
522
 
#define HA_DROP_UNIQUE_INDEX          (5)
523
 
#define HA_ALTER_UNIQUE_INDEX         (6)
524
 
#define HA_RENAME_UNIQUE_INDEX        (7)
525
 
#define HA_ADD_PK_INDEX               (8)
526
 
#define HA_DROP_PK_INDEX              (9)
527
 
#define HA_ALTER_PK_INDEX             (10)
528
 
#define HA_ADD_COLUMN                 (11)
529
 
#define HA_DROP_COLUMN                (12)
530
 
#define HA_CHANGE_COLUMN              (13)
531
 
#define HA_ALTER_COLUMN_NAME          (14)
532
 
#define HA_ALTER_COLUMN_TYPE          (15)
533
 
#define HA_ALTER_COLUMN_ORDER         (16)
534
 
#define HA_ALTER_COLUMN_NULLABLE      (17)
535
 
#define HA_COLUMN_DEFAULT_VALUE       (18)
536
 
#define HA_COLUMN_STORAGE             (19)
537
 
#define HA_COLUMN_FORMAT              (20)
538
 
#define HA_ADD_FOREIGN_KEY            (21)
539
 
#define HA_DROP_FOREIGN_KEY           (22)
540
 
#define HA_ALTER_FOREIGN_KEY          (23)
541
 
#define HA_ADD_CONSTRAINT             (24)
542
 
#define HA_CHANGE_CHARACTER_SET       (30)
543
 
#define HA_SET_DEFAULT_CHARACTER_SET  (31)
544
 
#define HA_CHANGE_AUTOINCREMENT_VALUE (32)
545
 
#define HA_ALTER_STORAGE              (33)
546
 
#define HA_ALTER_TABLESPACE           (34)
547
 
#define HA_ALTER_ROW_FORMAT           (35)
548
 
#define HA_RENAME_TABLE               (36)
549
 
#define HA_ALTER_STORAGE_ENGINE       (37)
550
 
#define HA_RECREATE                   (38)
551
 
#define HA_ALTER_STORED_VCOL          (39)
552
 
/* Remember to increase HA_MAX_ALTER_FLAGS when adding more flags! */
553
 
 
554
 
/* Return values for check_if_supported_alter */
555
 
 
556
 
#define HA_ALTER_ERROR               -1
557
 
#define HA_ALTER_SUPPORTED_WAIT_LOCK  0
558
 
#define HA_ALTER_SUPPORTED_NO_LOCK    1
559
 
#define HA_ALTER_NOT_SUPPORTED        2
560
 
 
561
 
/* Bits in table_flags() to show what database can do */
562
 
 
563
 
#define HA_NO_TRANSACTIONS     (1 << 0) /* Doesn't support transactions */
564
 
#define HA_PARTIAL_COLUMN_READ (1 << 1) /* read may not return all columns */
565
 
#define HA_TABLE_SCAN_ON_INDEX (1 << 2) /* No separate data/index file */
566
 
/*
567
 
  The following should be set if the following is not true when scanning
568
 
  a table with rnd_next()
569
 
  - We will see all rows (including deleted ones)
570
 
  - Row positions are 'table->s->db_record_offset' apart
571
 
  If this flag is not set, filesort will do a postion() call for each matched
572
 
  row to be able to find the row later.
573
 
*/
574
 
#define HA_REC_NOT_IN_SEQ      (1 << 3)
575
 
 
576
 
/*
577
 
  Reading keys in random order is as fast as reading keys in sort order
578
 
  (Used in records.cc to decide if we should use a record cache and by
579
 
  filesort to decide if we should sort key + data or key + pointer-to-row
580
 
*/
581
 
#define HA_FAST_KEY_READ       (1 << 5)
582
 
/*
583
 
  Set the following flag if we on delete should force all key to be read
584
 
  and on update read all keys that changes
585
 
*/
586
 
#define HA_REQUIRES_KEY_COLUMNS_FOR_DELETE (1 << 6)
587
 
#define HA_NULL_IN_KEY         (1 << 7) /* One can have keys with NULL */
588
 
#define HA_DUPLICATE_POS       (1 << 8)    /* ha_position() gives dup row */
589
 
#define HA_NO_BLOBS            (1 << 9) /* Doesn't support blobs */
590
 
#define HA_CAN_INDEX_BLOBS     (1 << 10)
591
 
#define HA_AUTO_PART_KEY       (1 << 11) /* auto-increment in multi-part key */
592
 
#define HA_REQUIRE_PRIMARY_KEY (1 << 12) /* .. and can't create a hidden one */
593
 
#define HA_STATS_RECORDS_IS_EXACT (1 << 13) /* stats.records is exact */
594
 
/*
595
 
  If we get the primary key columns for free when we do an index read
596
 
  It also implies that we have to retrive the primary key when using
597
 
  position() and rnd_pos().
598
 
*/
599
 
#define HA_PRIMARY_KEY_IN_READ_INDEX (1 << 15)
600
 
/*
601
 
  If HA_PRIMARY_KEY_REQUIRED_FOR_POSITION is set, it means that to position()
602
 
  uses a primary key. Without primary key, we can't call position().
603
 
*/ 
604
 
#define HA_PRIMARY_KEY_REQUIRED_FOR_POSITION (1 << 16) 
605
 
#define HA_NOT_DELETE_WITH_CACHE (1 << 18)
606
 
/*
607
 
  The following is we need to a primary key to delete (and update) a row.
608
 
  If there is no primary key, all columns needs to be read on update and delete
609
 
*/
610
 
#define HA_PRIMARY_KEY_REQUIRED_FOR_DELETE (1 << 19)
611
 
#define HA_NO_PREFIX_CHAR_KEYS (1 << 20)
612
 
#define HA_NO_AUTO_INCREMENT   (1 << 23)
613
 
#define HA_HAS_CHECKSUM        (1 << 24)
614
 
/* Table data are stored in separate files (for lower_case_table_names) */
615
 
#define HA_FILE_BASED          (1 << 26)
616
 
#define HA_NEED_READ_RANGE_BUFFER (1 << 29) /* for read_multi_range */
617
 
#define HA_ANY_INDEX_MAY_BE_UNIQUE (1 << 30)
618
 
#define HA_NO_COPY_ON_ALTER    (INT64_C(1) << 31)
619
 
#define HA_HAS_RECORDS         (INT64_C(1) << 32) /* records() gives exact count*/
620
 
#define HA_MRR_CANT_SORT       (INT64_C(1) << 34)
621
 
 
622
 
/*
623
 
  Engine is capable of row-format and statement-format logging,
624
 
  respectively
625
 
*/
626
 
#define HA_BINLOG_ROW_CAPABLE  (INT64_C(1) << 35)
627
 
#define HA_BINLOG_STMT_CAPABLE (INT64_C(1) << 36)
628
 
 
629
 
#define HA_ONLINE_ALTER        (INT64_C(1) << 37)
630
 
 
631
 
/*
632
 
  Set of all binlog flags. Currently only contain the capabilities
633
 
  flags.
634
 
 */
635
 
#define HA_BINLOG_FLAGS (HA_BINLOG_ROW_CAPABLE | HA_BINLOG_STMT_CAPABLE)
636
 
 
637
 
/* bits in index_flags(index_number) for what you can do with index */
638
 
#define HA_READ_NEXT            1       /* TODO really use this flag */
639
 
#define HA_READ_PREV            2       /* supports ::index_prev */
640
 
#define HA_READ_ORDER           4       /* index_next/prev follow sort order */
641
 
#define HA_READ_RANGE           8       /* can find all records in a range */
642
 
#define HA_ONLY_WHOLE_INDEX     16      /* Can't use part key searches */
643
 
#define HA_KEYREAD_ONLY         64      /* Support HA_EXTRA_KEYREAD */
644
 
/*
645
 
  Index scan will not return records in rowid order. Not guaranteed to be
646
 
  set for unordered (e.g. HASH) indexes.
647
 
*/
648
 
#define HA_KEY_SCAN_NOT_ROR     128 
649
 
#define HA_DO_INDEX_COND_PUSHDOWN  256 /* Supports Index Condition Pushdown */
650
 
 
651
 
 
652
 
 
653
 
/*
654
 
  HA_PARTITION_FUNCTION_SUPPORTED indicates that the function is
655
 
  supported at all.
656
 
  HA_FAST_CHANGE_PARTITION means that optimised variants of the changes
657
 
  exists but they are not necessarily done online.
658
 
 
659
 
  HA_ONLINE_DOUBLE_WRITE means that the handler supports writing to both
660
 
  the new partition and to the old partitions when updating through the
661
 
  old partitioning schema while performing a change of the partitioning.
662
 
  This means that we can support updating of the table while performing
663
 
  the copy phase of the change. For no lock at all also a double write
664
 
  from new to old must exist and this is not required when this flag is
665
 
  set.
666
 
  This is actually removed even before it was introduced the first time.
667
 
  The new idea is that handlers will handle the lock level already in
668
 
  store_lock for ALTER Table partitions.
669
 
 
670
 
  HA_PARTITION_ONE_PHASE is a flag that can be set by handlers that take
671
 
  care of changing the partitions online and in one phase. Thus all phases
672
 
  needed to handle the change are implemented inside the storage engine.
673
 
  The storage engine must also support auto-discovery since the frm file
674
 
  is changed as part of the change and this change must be controlled by
675
 
  the storage engine. A typical engine to support this is NDB (through
676
 
  WL #2498).
677
 
*/
678
 
#define HA_PARTITION_FUNCTION_SUPPORTED         (1L << 1)
679
 
#define HA_FAST_CHANGE_PARTITION                (1L << 2)
680
 
#define HA_PARTITION_ONE_PHASE                  (1L << 3)
681
 
 
682
 
/* operations for disable/enable indexes */
683
 
#define HA_KEY_SWITCH_NONUNIQ      0
684
 
#define HA_KEY_SWITCH_ALL          1
685
 
#define HA_KEY_SWITCH_NONUNIQ_SAVE 2
686
 
#define HA_KEY_SWITCH_ALL_SAVE     3
687
 
 
688
 
/*
689
 
  Note: the following includes binlog and closing 0.
690
 
  so: innodb + bdb + ndb + binlog + myisam + myisammrg + archive +
691
 
      example + csv + heap + blackhole + federated + 0
692
 
  (yes, the sum is deliberately inaccurate)
693
 
  TODO remove the limit, use dynarrays
694
 
*/
695
 
#define MAX_HA 15
696
 
 
697
 
/*
698
 
  Parameters for open() (in register form->filestat)
699
 
  HA_GET_INFO does an implicit HA_ABORT_IF_LOCKED
700
 
*/
701
 
 
702
 
#define HA_OPEN_KEYFILE         1
703
 
#define HA_OPEN_RNDFILE         2
704
 
#define HA_GET_INDEX            4
705
 
#define HA_GET_INFO             8       /* do a ha_info() after open */
706
 
#define HA_READ_ONLY            16      /* File opened as readonly */
707
 
/* Try readonly if can't open with read and write */
708
 
#define HA_TRY_READ_ONLY        32
709
 
#define HA_WAIT_IF_LOCKED       64      /* Wait if locked on open */
710
 
#define HA_ABORT_IF_LOCKED      128     /* skip if locked on open.*/
711
 
#define HA_BLOCK_LOCK           256     /* unlock when reading some records */
712
 
#define HA_OPEN_TEMPORARY       512
713
 
 
714
 
/* For transactional LOCK Table. handler::lock_table() */
715
 
#define HA_LOCK_IN_SHARE_MODE      F_RDLCK
716
 
#define HA_LOCK_IN_EXCLUSIVE_MODE  F_WRLCK
717
 
 
718
 
/* Some key definitions */
719
 
#define HA_KEY_NULL_LENGTH      1
720
 
#define HA_KEY_BLOB_LENGTH      2
721
 
 
722
 
#define HA_LEX_CREATE_TMP_TABLE 1
723
 
#define HA_LEX_CREATE_IF_NOT_EXISTS 2
724
 
#define HA_LEX_CREATE_TABLE_LIKE 4
725
 
#define HA_OPTION_NO_CHECKSUM   (1L << 17)
726
 
#define HA_OPTION_NO_DELAY_KEY_WRITE (1L << 18)
727
 
#define HA_MAX_REC_LENGTH       65535
728
 
 
729
 
/* Table caching type */
730
 
#define HA_CACHE_TBL_NONTRANSACT 0
731
 
#define HA_CACHE_TBL_NOCACHE     1
732
 
#define HA_CACHE_TBL_ASKTRANSACT 2
733
 
#define HA_CACHE_TBL_TRANSACT    4
734
 
 
735
 
/* Options of START TRANSACTION statement (and later of SET TRANSACTION stmt) */
736
 
#define DRIZZLE_START_TRANS_OPT_WITH_CONS_SNAPSHOT 1
737
 
 
738
 
/* Flags for method is_fatal_error */
739
 
#define HA_CHECK_DUP_KEY 1
740
 
#define HA_CHECK_DUP_UNIQUE 2
741
 
#define HA_CHECK_DUP (HA_CHECK_DUP_KEY + HA_CHECK_DUP_UNIQUE)
742
 
 
743
 
enum legacy_db_type
744
 
{
745
 
  DB_TYPE_UNKNOWN=0,
746
 
  DB_TYPE_FIRST_DYNAMIC=42,
747
 
  DB_TYPE_DEFAULT=127 // Must be last
748
 
};
749
 
 
750
 
enum row_type { ROW_TYPE_NOT_USED=-1, ROW_TYPE_DEFAULT, ROW_TYPE_FIXED,
751
 
                ROW_TYPE_DYNAMIC, ROW_TYPE_COMPRESSED,
752
 
                ROW_TYPE_REDUNDANT, ROW_TYPE_COMPACT, ROW_TYPE_PAGE };
753
 
 
754
 
enum column_format_type { COLUMN_FORMAT_TYPE_NOT_USED= -1,
755
 
                          COLUMN_FORMAT_TYPE_DEFAULT=   0,
756
 
                          COLUMN_FORMAT_TYPE_FIXED=     1,
757
 
                          COLUMN_FORMAT_TYPE_DYNAMIC=   2 };
758
 
 
759
 
enum enum_binlog_func {
760
 
  BFN_RESET_LOGS=        1,
761
 
  BFN_RESET_SLAVE=       2,
762
 
  BFN_BINLOG_WAIT=       3,
763
 
  BFN_BINLOG_END=        4,
764
 
  BFN_BINLOG_PURGE_FILE= 5
765
 
};
766
 
 
767
 
enum enum_binlog_command {
768
 
  LOGCOM_CREATE_TABLE,
769
 
  LOGCOM_ALTER_TABLE,
770
 
  LOGCOM_RENAME_TABLE,
771
 
  LOGCOM_DROP_TABLE,
772
 
  LOGCOM_CREATE_DB,
773
 
  LOGCOM_ALTER_DB,
774
 
  LOGCOM_DROP_DB
775
 
};
776
 
 
777
 
/* struct to hold information about the table that should be created */
778
 
 
779
 
/* Bits in used_fields */
780
 
#define HA_CREATE_USED_AUTO             (1L << 0)
781
 
#ifdef DEAD_OPTIONS
782
 
#define HA_CREATE_USED_UNION            (1L << 2)
783
 
#define HA_CREATE_USED_PASSWORD         (1L << 17)
784
 
#endif
785
 
#define HA_CREATE_USED_INSERT_METHOD    (1L << 3)
786
 
#define HA_CREATE_USED_MIN_ROWS         (1L << 4)
787
 
#define HA_CREATE_USED_MAX_ROWS         (1L << 5)
788
 
#define HA_CREATE_USED_AVG_ROW_LENGTH   (1L << 6)
789
 
#define HA_CREATE_USED_PACK_KEYS        (1L << 7)
790
 
#define HA_CREATE_USED_CHARSET          (1L << 8)
791
 
#define HA_CREATE_USED_DEFAULT_CHARSET  (1L << 9)
792
 
#define HA_CREATE_USED_DATADIR          (1L << 10)
793
 
#define HA_CREATE_USED_INDEXDIR         (1L << 11)
794
 
#define HA_CREATE_USED_ENGINE           (1L << 12)
795
 
#define HA_CREATE_USED_CHECKSUM         (1L << 13)
796
 
#define HA_CREATE_USED_DELAY_KEY_WRITE  (1L << 14)
797
 
#define HA_CREATE_USED_ROW_FORMAT       (1L << 15)
798
 
#define HA_CREATE_USED_COMMENT          (1L << 16)
799
 
#define HA_CREATE_USED_CONNECTION       (1L << 18)
800
 
#define HA_CREATE_USED_KEY_BLOCK_SIZE   (1L << 19)
801
 
#define HA_CREATE_USED_PAGE_CHECKSUM    (1L << 21)
802
 
#define HA_CREATE_USED_BLOCK_SIZE       (1L << 22)
803
 
 
804
 
#define MAXGTRIDSIZE 64
805
 
#define MAXBQUALSIZE 64
806
 
 
807
 
#define COMPATIBLE_DATA_YES 0
808
 
#define COMPATIBLE_DATA_NO  1
809
 
 
810
 
#define UNDEF_NODEGROUP 65535
811
 
#define NOT_A_PARTITION_ID ((uint32_t)-1)
812
 
 
813
 
enum ha_choice { HA_CHOICE_UNDEF, HA_CHOICE_NO, HA_CHOICE_YES };
814
 
 
815
 
/* Possible flags of a handlerton (there can be 32 of them) */
816
 
#define HTON_NO_FLAGS                 0
817
 
#define HTON_CLOSE_CURSORS_AT_COMMIT (1 << 0)
818
 
#define HTON_ALTER_NOT_SUPPORTED     (1 << 1) //Engine does not support alter
819
 
#define HTON_CAN_RECREATE            (1 << 2) //Delete all is used fro truncate
820
 
#define HTON_HIDDEN                  (1 << 3) //Engine does not appear in lists
821
 
#define HTON_FLUSH_AFTER_RENAME      (1 << 4)
822
 
#define HTON_NOT_USER_SELECTABLE     (1 << 5)
823
 
#define HTON_TEMPORARY_NOT_SUPPORTED (1 << 6) //Having temporary tables not supported
824
 
#define HTON_SUPPORT_LOG_TABLES      (1 << 7) //Engine supports log tables
825
 
#define HTON_NO_PARTITION            (1 << 8) //You can not partition these tables
826
 
/*
827
 
  The below two are not used (and not handled) in this milestone of this WL
828
 
  entry because there seems to be no use for them at this stage of
829
 
  implementation.
830
 
*/
831
 
#define HA_MRR_SINGLE_POINT 1
832
 
#define HA_MRR_FIXED_KEY  2
833
 
 
834
 
/* 
835
 
  Indicates that RANGE_SEQ_IF::next(&range) doesn't need to fill in the
836
 
  'range' parameter.
837
 
*/
838
 
#define HA_MRR_NO_ASSOCIATION 4
839
 
 
840
 
/* 
841
 
  The MRR user will provide ranges in key order, and MRR implementation
842
 
  must return rows in key order.
843
 
*/
844
 
#define HA_MRR_SORTED 8
845
 
 
846
 
/* MRR implementation doesn't have to retrieve full records */
847
 
#define HA_MRR_INDEX_ONLY 16
848
 
 
849
 
/* 
850
 
  The passed memory buffer is of maximum possible size, the caller can't
851
 
  assume larger buffer.
852
 
*/
853
 
#define HA_MRR_LIMITS 32
854
 
 
855
 
 
856
 
/*
857
 
  Flag set <=> default MRR implementation is used
858
 
  (The choice is made by **_info[_const]() function which may set this
859
 
   flag. SQL layer remembers the flag value and then passes it to
860
 
   multi_read_range_init().
861
 
*/
862
 
#define HA_MRR_USE_DEFAULT_IMPL 64
863
 
 
864
 
/*
865
 
  Used only as parameter to multi_range_read_info():
866
 
  Flag set <=> the caller guarantees that the bounds of the scanned ranges
867
 
  will not have NULL values.
868
 
*/
869
 
#define HA_MRR_NO_NULL_ENDPOINTS 128
870
 
 
871
384
#endif /* DRIZZLE_SERVER_DEFINITIONS_H */