74
90
#define RAND_TABLE_BIT (((table_map) 1) << (sizeof(table_map)*8-1))
75
91
#define PSEUDO_TABLE_BITS (PARAM_TABLE_BIT | OUTER_REF_TABLE_BIT | \
77
#define MAX_FIELDS 4096 /* Historical limit from MySQL FRM. */
93
#define MAX_FIELDS 4096 /* Limit in the .frm file */
79
95
#define MAX_SELECT_NESTING (sizeof(nesting_map)*8-1)
81
97
#define MAX_SORT_MEMORY (2048*1024-MALLOC_OVERHEAD)
82
98
#define MIN_SORT_MEMORY (32*1024-MALLOC_OVERHEAD)
100
/* Memory allocated when parsing a statement / saving a statement */
101
#define MEM_ROOT_BLOCK_SIZE 8192
102
#define MEM_ROOT_PREALLOC 8192
103
#define TRANS_MEM_ROOT_BLOCK_SIZE 4096
104
#define TRANS_MEM_ROOT_PREALLOC 4096
84
106
#define DEFAULT_ERROR_COUNT 64
85
107
#define EXTRA_RECORDS 10 /* Extra records in sort */
108
#define SCROLL_EXTRA 5 /* Extra scroll-rows. */
109
#define FIELD_NAME_USED ((uint) 32768) /* Bit set if fieldname used */
110
#define FORM_NAME_USED ((uint) 16384) /* Bit set if formname used */
111
#define FIELD_NR_MASK 16383 /* To get fieldnumber */
112
#define FERR -1 /* Error from my_functions */
113
#define CREATE_MODE 0 /* Default mode on new files */
86
114
#define NAMES_SEP_CHAR '\377' /* Char to sep. names */
88
#define READ_RECORD_BUFFER (uint32_t) (IO_SIZE*8) /* Pointer_buffer_size */
89
#define DISK_BUFFER_SIZE (uint32_t) (IO_SIZE*16) /* Size of diskbuffer */
116
#define READ_RECORD_BUFFER (uint) (IO_SIZE*8) /* Pointer_buffer_size */
117
#define DISK_BUFFER_SIZE (uint) (IO_SIZE*16) /* Size of diskbuffer */
119
#define ME_INFO (ME_HOLDTANG+ME_OLDWIN+ME_NOREFRESH)
91
120
#define ME_ERROR (ME_BELL+ME_OLDWIN+ME_NOREFRESH)
92
121
#define MYF_RW MYF(MY_WME+MY_NABP) /* Vid my_read & my_write */
124
#define store_record(A,B) memcpy((A)->B,(A)->record[0],(size_t) (A)->s->reclength)
125
#define restore_record(A,B) memcpy((A)->record[0],(A)->B,(size_t) (A)->s->reclength)
126
#define cmp_record(A,B) memcmp((A)->record[0],(A)->B,(size_t) (A)->s->reclength)
127
#define empty_record(A) \
129
restore_record((A),s->default_values); \
130
memset((A)->null_flags, 255, (A)->s->null_bytes); \
133
/* Defines for use with openfrm, openprt and openfrd */
135
#define READ_ALL 1 /* openfrm: Read all parameters */
136
#define CHANGE_FRM 2 /* openfrm: open .frm as O_RDWR */
137
#define EXTRA_RECORD 8 /* Reservera plats f|r extra record */
138
#define DONT_GIVE_ERROR 256 /* Don't do frm_error on openfrm */
139
#define DELAYED_OPEN 4096 /* Open table later */
141
This flag is used in function get_all_tables() which fills
142
I_S tables with data which are retrieved from frm files and storage engine
143
The flag means that we need to open FRM file only to get necessary data.
145
#define OPEN_FRM_FILE_ONLY 32768
147
This flag is used in function get_all_tables() which fills
148
I_S tables with data which are retrieved from frm files and storage engine
149
The flag means that we need to process tables only to get necessary data.
150
Views are not processed.
152
#define OPEN_TABLE_ONLY OPEN_FRM_FILE_ONLY*2
154
This flag is used in function get_all_tables() which fills
155
I_S tables with data which are retrieved from frm files and storage engine.
156
The flag means that I_S table uses optimization algorithm.
158
#define OPTIMIZE_I_S_TABLE OPEN_TABLE_ONLY*2
160
#define SC_INFO_LENGTH 4 /* Form format constant */
161
#define TE_INFO_LENGTH 3
162
#define MTYP_NOEMPTY_BIT 128
164
#define FRM_VER_TRUE_VARCHAR (FRM_VER+4) /* 10 */
165
#define DRIZZLE_VERSION_TABLESPACE_IN_FRM_CGE 50120
166
#define DRIZZLE_VERSION_TABLESPACE_IN_FRM 50205
167
#define DRIZZLE_VERSION_TABLESPACE_IN_FRM_STR "50205"
95
170
Minimum length pattern before Turbo Boyer-Moore is used
96
171
for SELECT "text" LIKE "%pattern%", excluding the two
99
174
#define MIN_TURBOBM_PATTERN_LEN 3
102
177
Defines for binary logging.
103
178
Do not decrease the value of BIN_LOG_HEADER_SIZE.
104
179
Do not even increase it before checking code.
107
#define BIN_LOG_HEADER_SIZE 4
182
#define BIN_LOG_HEADER_SIZE 4
184
#define DEFAULT_KEY_CACHE_NAME "default"
186
#define STORAGE_TYPE_MASK 7
187
#define COLUMN_FORMAT_MASK 7
188
#define COLUMN_FORMAT_SHIFT 3
109
190
/* Below are #defines that used to be in mysql_priv.h */
110
191
/***************************************************************************
111
192
Configuration parameters
112
193
****************************************************************************/
194
#define ACL_CACHE_SIZE 256
195
#define MAX_PASSWORD_LENGTH 32
196
#define HOST_CACHE_SIZE 128
197
#define MAX_ACCEPT_RETRY 10 // Test accept this many times
113
198
#define MAX_FIELDS_BEFORE_HASH 32
114
199
#define USER_VARS_HASH_SIZE 16
115
200
#define TABLE_OPEN_CACHE_MIN 64
116
#define TABLE_OPEN_CACHE_DEFAULT 1024
201
#define TABLE_OPEN_CACHE_DEFAULT 64
119
204
Value of 9236 discovered through binary search 2006-09-26 on Ubuntu Dapper
120
Drake, libc6 2.3.6-0ubuntu2, Linux kernel 2.6.15-27-686, on x86. (Added
205
Drake, libc6 2.3.6-0ubuntu2, Linux kernel 2.6.15-27-686, on x86. (Added
121
206
100 bytes as reasonable buffer against growth and other environments'
244
362
#define portable_sizeof_char_ptr 8
246
#define TMP_FILE_PREFIX "#sql" /**< Prefix for tmp tables */
247
#define TMP_FILE_PREFIX_LENGTH 4
364
#define tmp_file_prefix "#sql" /**< Prefix for tmp tables */
365
#define tmp_file_prefix_length 4
249
367
/* Flags for calc_week() function. */
250
368
#define WEEK_MONDAY_FIRST 1
251
369
#define WEEK_YEAR 2
252
370
#define WEEK_FIRST_WEEKDAY 4
254
/* used in date and time conversions */
255
/* Daynumber from year 0 to 9999-12-31 */
256
#define MAX_DAY_NUMBER 3652424L
258
372
#define STRING_BUFFER_USUAL_SIZE 80
375
Some defines for exit codes for ::is_equal class functions.
377
#define IS_EQUAL_NO 0
378
#define IS_EQUAL_YES 1
379
#define IS_EQUAL_PACK_LENGTH 2
383
Query type constants.
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).
391
Move this out of here once Stew's done with UDF breakout. The following headers need it:
393
sql_lex.h --> included by sql_class.h
411
* @TODO Move to a separate header?
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
417
* What is needed is a separate header file that is included
418
* by *both* item.h and field.h to resolve inter-dependencies
420
* But, probably want to hold off on this until Stew finished the UDF cleanup
424
DERIVATION_IGNORABLE= 5,
425
DERIVATION_COERCIBLE= 4,
426
DERIVATION_SYSCONST= 3,
427
DERIVATION_IMPLICIT= 2,
429
DERIVATION_EXPLICIT= 0
433
* Opening modes for open_temporary_table and open_table_from_share
435
* @TODO Put this into an appropriate header. It is only needed in:
447
enum enum_parsing_place
456
enum enum_mysql_completiontype {
459
, ROLLBACK_AND_CHAIN= 7
462
, COMMIT_AND_CHAIN= 6
465
enum enum_check_fields
469
, CHECK_FIELD_ERROR_FOR_NULL
480
typedef uint64_t query_id_t;
260
481
typedef void *range_seq_t;
262
enum ha_stat_type { HA_ENGINE_STATUS, HA_ENGINE_LOGS, HA_ENGINE_MUTEX };
485
The maximum is defined as (ULONG_MAX/1000) with 4 bytes uint32_t
487
static const uint32_t SLAVE_MAX_HEARTBEAT_PERIOD= 4294967;
489
#define SLAVE_NET_TIMEOUT 3600
491
#define MAX_SLAVE_ERROR 2000
493
/* masks for start/stop operations on io and sql slave threads */
498
#define NO_HASH /* Not yet implemented */
263
501
// the following is for checking tables
265
503
#define HA_ADMIN_ALREADY_DONE 1
270
508
#define HA_ADMIN_INTERNAL_ERROR -4
271
509
#define HA_ADMIN_INVALID -5
272
510
#define HA_ADMIN_REJECT -6
511
#define HA_ADMIN_TRY_ALTER -7
512
#define HA_ADMIN_WRONG_CHECKSUM -8
513
#define HA_ADMIN_NOT_BASE_TABLE -9
514
#define HA_ADMIN_NEEDS_UPGRADE -10
515
#define HA_ADMIN_NEEDS_ALTER -11
516
#define HA_ADMIN_NEEDS_CHECK -12
519
#define HA_ADD_INDEX (0)
520
#define HA_DROP_INDEX (1)
521
#define HA_ALTER_INDEX (2)
522
#define HA_RENAME_INDEX (3)
523
#define HA_ADD_UNIQUE_INDEX (4)
524
#define HA_DROP_UNIQUE_INDEX (5)
525
#define HA_ALTER_UNIQUE_INDEX (6)
526
#define HA_RENAME_UNIQUE_INDEX (7)
527
#define HA_ADD_PK_INDEX (8)
528
#define HA_DROP_PK_INDEX (9)
529
#define HA_ALTER_PK_INDEX (10)
530
#define HA_ADD_COLUMN (11)
531
#define HA_DROP_COLUMN (12)
532
#define HA_CHANGE_COLUMN (13)
533
#define HA_ALTER_COLUMN_NAME (14)
534
#define HA_ALTER_COLUMN_TYPE (15)
535
#define HA_ALTER_COLUMN_ORDER (16)
536
#define HA_ALTER_COLUMN_NULLABLE (17)
537
#define HA_COLUMN_DEFAULT_VALUE (18)
538
#define HA_COLUMN_STORAGE (19)
539
#define HA_COLUMN_FORMAT (20)
540
#define HA_ADD_FOREIGN_KEY (21)
541
#define HA_DROP_FOREIGN_KEY (22)
542
#define HA_ALTER_FOREIGN_KEY (23)
543
#define HA_ADD_CONSTRAINT (24)
544
#define HA_CHANGE_CHARACTER_SET (30)
545
#define HA_SET_DEFAULT_CHARACTER_SET (31)
546
#define HA_CHANGE_AUTOINCREMENT_VALUE (32)
547
#define HA_ALTER_STORAGE (33)
548
#define HA_ALTER_TABLESPACE (34)
549
#define HA_ALTER_ROW_FORMAT (35)
550
#define HA_RENAME_TABLE (36)
551
#define HA_ALTER_STORAGE_ENGINE (37)
552
#define HA_RECREATE (38)
553
#define HA_ALTER_STORED_VCOL (39)
554
/* Remember to increase HA_MAX_ALTER_FLAGS when adding more flags! */
556
/* Return values for check_if_supported_alter */
558
#define HA_ALTER_ERROR -1
559
#define HA_ALTER_SUPPORTED_WAIT_LOCK 0
560
#define HA_ALTER_SUPPORTED_NO_LOCK 1
561
#define HA_ALTER_NOT_SUPPORTED 2
563
/* Bits in table_flags() to show what database can do */
565
#define HA_NO_TRANSACTIONS (1 << 0) /* Doesn't support transactions */
566
#define HA_PARTIAL_COLUMN_READ (1 << 1) /* read may not return all columns */
567
#define HA_TABLE_SCAN_ON_INDEX (1 << 2) /* No separate data/index file */
569
The following should be set if the following is not true when scanning
570
a table with rnd_next()
571
- We will see all rows (including deleted ones)
572
- Row positions are 'table->s->db_record_offset' apart
573
If this flag is not set, filesort will do a postion() call for each matched
574
row to be able to find the row later.
576
#define HA_REC_NOT_IN_SEQ (1 << 3)
579
Reading keys in random order is as fast as reading keys in sort order
580
(Used in records.cc to decide if we should use a record cache and by
581
filesort to decide if we should sort key + data or key + pointer-to-row
583
#define HA_FAST_KEY_READ (1 << 5)
585
Set the following flag if we on delete should force all key to be read
586
and on update read all keys that changes
588
#define HA_REQUIRES_KEY_COLUMNS_FOR_DELETE (1 << 6)
589
#define HA_NULL_IN_KEY (1 << 7) /* One can have keys with NULL */
590
#define HA_DUPLICATE_POS (1 << 8) /* ha_position() gives dup row */
591
#define HA_NO_BLOBS (1 << 9) /* Doesn't support blobs */
592
#define HA_CAN_INDEX_BLOBS (1 << 10)
593
#define HA_AUTO_PART_KEY (1 << 11) /* auto-increment in multi-part key */
594
#define HA_REQUIRE_PRIMARY_KEY (1 << 12) /* .. and can't create a hidden one */
595
#define HA_STATS_RECORDS_IS_EXACT (1 << 13) /* stats.records is exact */
597
If we get the primary key columns for free when we do an index read
598
It also implies that we have to retrive the primary key when using
599
position() and rnd_pos().
601
#define HA_PRIMARY_KEY_IN_READ_INDEX (1 << 15)
603
If HA_PRIMARY_KEY_REQUIRED_FOR_POSITION is set, it means that to position()
604
uses a primary key. Without primary key, we can't call position().
606
#define HA_PRIMARY_KEY_REQUIRED_FOR_POSITION (1 << 16)
607
#define HA_NOT_DELETE_WITH_CACHE (1 << 18)
609
The following is we need to a primary key to delete (and update) a row.
610
If there is no primary key, all columns needs to be read on update and delete
612
#define HA_PRIMARY_KEY_REQUIRED_FOR_DELETE (1 << 19)
613
#define HA_NO_PREFIX_CHAR_KEYS (1 << 20)
614
#define HA_NO_AUTO_INCREMENT (1 << 23)
615
#define HA_HAS_CHECKSUM (1 << 24)
616
/* Table data are stored in separate files (for lower_case_table_names) */
617
#define HA_FILE_BASED (1 << 26)
618
#define HA_NEED_READ_RANGE_BUFFER (1 << 29) /* for read_multi_range */
619
#define HA_ANY_INDEX_MAY_BE_UNIQUE (1 << 30)
620
#define HA_NO_COPY_ON_ALTER (INT64_C(1) << 31)
621
#define HA_HAS_RECORDS (INT64_C(1) << 32) /* records() gives exact count*/
622
#define HA_MRR_CANT_SORT (INT64_C(1) << 34)
625
Engine is capable of row-format and statement-format logging,
628
#define HA_BINLOG_ROW_CAPABLE (INT64_C(1) << 35)
629
#define HA_BINLOG_STMT_CAPABLE (INT64_C(1) << 36)
631
#define HA_ONLINE_ALTER (INT64_C(1) << 37)
634
Set of all binlog flags. Currently only contain the capabilities
637
#define HA_BINLOG_FLAGS (HA_BINLOG_ROW_CAPABLE | HA_BINLOG_STMT_CAPABLE)
274
639
/* bits in index_flags(index_number) for what you can do with index */
275
640
#define HA_READ_NEXT 1 /* TODO really use this flag */
282
647
Index scan will not return records in rowid order. Not guaranteed to be
283
648
set for unordered (e.g. HASH) indexes.
285
#define HA_KEY_SCAN_NOT_ROR 128
650
#define HA_KEY_SCAN_NOT_ROR 128
651
#define HA_DO_INDEX_COND_PUSHDOWN 256 /* Supports Index Condition Pushdown */
656
HA_PARTITION_FUNCTION_SUPPORTED indicates that the function is
658
HA_FAST_CHANGE_PARTITION means that optimised variants of the changes
659
exists but they are not necessarily done online.
661
HA_ONLINE_DOUBLE_WRITE means that the handler supports writing to both
662
the new partition and to the old partitions when updating through the
663
old partitioning schema while performing a change of the partitioning.
664
This means that we can support updating of the table while performing
665
the copy phase of the change. For no lock at all also a double write
666
from new to old must exist and this is not required when this flag is
668
This is actually removed even before it was introduced the first time.
669
The new idea is that handlers will handle the lock level already in
670
store_lock for ALTER Table partitions.
672
HA_PARTITION_ONE_PHASE is a flag that can be set by handlers that take
673
care of changing the partitions online and in one phase. Thus all phases
674
needed to handle the change are implemented inside the storage engine.
675
The storage engine must also support auto-discovery since the frm file
676
is changed as part of the change and this change must be controlled by
677
the storage engine. A typical engine to support this is NDB (through
680
#define HA_PARTITION_FUNCTION_SUPPORTED (1L << 1)
681
#define HA_FAST_CHANGE_PARTITION (1L << 2)
682
#define HA_PARTITION_ONE_PHASE (1L << 3)
287
684
/* operations for disable/enable indexes */
288
685
#define HA_KEY_SWITCH_NONUNIQ 0
324
721
#define HA_KEY_NULL_LENGTH 1
325
722
#define HA_KEY_BLOB_LENGTH 2
724
#define HA_LEX_CREATE_TMP_TABLE 1
725
#define HA_LEX_CREATE_IF_NOT_EXISTS 2
726
#define HA_LEX_CREATE_TABLE_LIKE 4
727
#define HA_OPTION_NO_CHECKSUM (1L << 17)
728
#define HA_OPTION_NO_DELAY_KEY_WRITE (1L << 18)
327
729
#define HA_MAX_REC_LENGTH 65535
731
/* Table caching type */
732
#define HA_CACHE_TBL_NONTRANSACT 0
733
#define HA_CACHE_TBL_NOCACHE 1
734
#define HA_CACHE_TBL_ASKTRANSACT 2
735
#define HA_CACHE_TBL_TRANSACT 4
329
737
/* Options of START TRANSACTION statement (and later of SET TRANSACTION stmt) */
330
enum start_transaction_option_t
332
START_TRANS_NO_OPTIONS,
333
START_TRANS_OPT_WITH_CONS_SNAPSHOT
738
#define DRIZZLE_START_TRANS_OPT_WITH_CONS_SNAPSHOT 1
336
740
/* Flags for method is_fatal_error */
337
741
#define HA_CHECK_DUP_KEY 1
338
742
#define HA_CHECK_DUP_UNIQUE 2
339
743
#define HA_CHECK_DUP (HA_CHECK_DUP_KEY + HA_CHECK_DUP_UNIQUE)
748
DB_TYPE_FIRST_DYNAMIC=42,
749
DB_TYPE_DEFAULT=127 // Must be last
752
enum row_type { ROW_TYPE_NOT_USED=-1, ROW_TYPE_DEFAULT, ROW_TYPE_FIXED,
753
ROW_TYPE_DYNAMIC, ROW_TYPE_COMPRESSED,
754
ROW_TYPE_REDUNDANT, ROW_TYPE_COMPACT, ROW_TYPE_PAGE };
756
enum column_format_type { COLUMN_FORMAT_TYPE_NOT_USED= -1,
757
COLUMN_FORMAT_TYPE_DEFAULT= 0,
758
COLUMN_FORMAT_TYPE_FIXED= 1,
759
COLUMN_FORMAT_TYPE_DYNAMIC= 2 };
761
enum enum_binlog_func {
766
BFN_BINLOG_PURGE_FILE= 5
769
enum enum_binlog_command {
779
/* struct to hold information about the table that should be created */
342
781
/* Bits in used_fields */
343
782
#define HA_CREATE_USED_AUTO (1L << 0)
784
#define HA_CREATE_USED_UNION (1L << 2)
785
#define HA_CREATE_USED_PASSWORD (1L << 17)
787
#define HA_CREATE_USED_INSERT_METHOD (1L << 3)
788
#define HA_CREATE_USED_MIN_ROWS (1L << 4)
789
#define HA_CREATE_USED_MAX_ROWS (1L << 5)
790
#define HA_CREATE_USED_AVG_ROW_LENGTH (1L << 6)
791
#define HA_CREATE_USED_PACK_KEYS (1L << 7)
344
792
#define HA_CREATE_USED_CHARSET (1L << 8)
345
793
#define HA_CREATE_USED_DEFAULT_CHARSET (1L << 9)
794
#define HA_CREATE_USED_DATADIR (1L << 10)
795
#define HA_CREATE_USED_INDEXDIR (1L << 11)
796
#define HA_CREATE_USED_ENGINE (1L << 12)
797
#define HA_CREATE_USED_CHECKSUM (1L << 13)
798
#define HA_CREATE_USED_DELAY_KEY_WRITE (1L << 14)
346
799
#define HA_CREATE_USED_ROW_FORMAT (1L << 15)
800
#define HA_CREATE_USED_COMMENT (1L << 16)
801
#define HA_CREATE_USED_CONNECTION (1L << 18)
347
802
#define HA_CREATE_USED_KEY_BLOCK_SIZE (1L << 19)
803
#define HA_CREATE_USED_PAGE_CHECKSUM (1L << 21)
348
804
#define HA_CREATE_USED_BLOCK_SIZE (1L << 22)
806
#define MAXGTRIDSIZE 64
807
#define MAXBQUALSIZE 64
809
#define COMPATIBLE_DATA_YES 0
810
#define COMPATIBLE_DATA_NO 1
812
#define UNDEF_NODEGROUP 65535
813
#define NOT_A_PARTITION_ID ((uint32_t)-1)
815
enum ha_choice { HA_CHOICE_UNDEF, HA_CHOICE_NO, HA_CHOICE_YES };
817
/* Possible flags of a handlerton (there can be 32 of them) */
818
#define HTON_NO_FLAGS 0
819
#define HTON_CLOSE_CURSORS_AT_COMMIT (1 << 0)
820
#define HTON_ALTER_NOT_SUPPORTED (1 << 1) //Engine does not support alter
821
#define HTON_CAN_RECREATE (1 << 2) //Delete all is used fro truncate
822
#define HTON_HIDDEN (1 << 3) //Engine does not appear in lists
823
#define HTON_FLUSH_AFTER_RENAME (1 << 4)
824
#define HTON_NOT_USER_SELECTABLE (1 << 5)
825
#define HTON_TEMPORARY_NOT_SUPPORTED (1 << 6) //Having temporary tables not supported
826
#define HTON_SUPPORT_LOG_TABLES (1 << 7) //Engine supports log tables
827
#define HTON_NO_PARTITION (1 << 8) //You can not partition these tables
351
829
The below two are not used (and not handled) in this milestone of this WL
352
830
entry because there seems to be no use for them at this stage of
386
864
#define HA_MRR_USE_DEFAULT_IMPL 64
867
Used only as parameter to multi_range_read_info():
868
Flag set <=> the caller guarantees that the bounds of the scanned ranges
869
will not have NULL values.
871
#define HA_MRR_NO_NULL_ENDPOINTS 128
873
enum enum_ha_read_modes { RFIRST, RNEXT, RPREV, RLAST, RKEY, RNEXT_SAME };
875
enum enum_tx_isolation { ISO_READ_UNCOMMITTED, ISO_READ_COMMITTED,
876
ISO_REPEATABLE_READ, ISO_SERIALIZABLE};
879
enum SHOW_COMP_OPTION { SHOW_OPTION_YES, SHOW_OPTION_NO, SHOW_OPTION_DISABLED};
389
#define MYF(v) (static_cast<drizzled::myf>(v))
882
#define MYF(v) (myf) (v)
885
When a command is added here, be sure it's also added in mysqld.cc
886
in "struct show_var_st status_vars[]= {" ...
888
If the command returns a result set or is not allowed in stored
889
functions or triggers, please also make sure that
890
sp_get_flags_for_command (sp_head.cc) returns proper flags for the
894
enum enum_sql_command {
895
SQLCOM_SELECT, SQLCOM_CREATE_TABLE, SQLCOM_CREATE_INDEX, SQLCOM_ALTER_TABLE,
896
SQLCOM_UPDATE, SQLCOM_INSERT, SQLCOM_INSERT_SELECT,
897
SQLCOM_DELETE, SQLCOM_TRUNCATE, SQLCOM_DROP_TABLE, SQLCOM_DROP_INDEX,
898
SQLCOM_SHOW_DATABASES, SQLCOM_SHOW_TABLES, SQLCOM_SHOW_FIELDS,
899
SQLCOM_SHOW_KEYS, SQLCOM_SHOW_VARIABLES, SQLCOM_SHOW_STATUS,
900
SQLCOM_SHOW_ENGINE_LOGS, SQLCOM_SHOW_ENGINE_STATUS, SQLCOM_SHOW_ENGINE_MUTEX,
901
SQLCOM_SHOW_PROCESSLIST, SQLCOM_SHOW_MASTER_STAT, SQLCOM_SHOW_SLAVE_STAT,
903
SQLCOM_SHOW_CREATE_DB,
904
SQLCOM_SHOW_TABLE_STATUS,
905
SQLCOM_LOAD,SQLCOM_SET_OPTION,SQLCOM_LOCK_TABLES,SQLCOM_UNLOCK_TABLES,
906
SQLCOM_CHANGE_DB, SQLCOM_CREATE_DB, SQLCOM_DROP_DB, SQLCOM_ALTER_DB,
907
SQLCOM_REPAIR, SQLCOM_REPLACE, SQLCOM_REPLACE_SELECT,
908
SQLCOM_OPTIMIZE, SQLCOM_CHECK,
909
SQLCOM_ASSIGN_TO_KEYCACHE,
910
SQLCOM_FLUSH, SQLCOM_KILL, SQLCOM_ANALYZE,
911
SQLCOM_ROLLBACK, SQLCOM_ROLLBACK_TO_SAVEPOINT,
912
SQLCOM_COMMIT, SQLCOM_SAVEPOINT, SQLCOM_RELEASE_SAVEPOINT,
913
SQLCOM_SLAVE_START, SQLCOM_SLAVE_STOP,
914
SQLCOM_BEGIN, SQLCOM_CHANGE_MASTER,
916
SQLCOM_RESET, SQLCOM_PURGE, SQLCOM_PURGE_BEFORE, SQLCOM_SHOW_BINLOGS,
917
SQLCOM_SHOW_OPEN_TABLES,
918
SQLCOM_DELETE_MULTI, SQLCOM_UPDATE_MULTI,
923
SQLCOM_BINLOG_BASE64_EVENT,
926
When a command is added here, be sure it's also added in mysqld.cc
927
in "struct show_var_st status_vars[]= {" ...
929
/* This should be the last !!! */
933
enum enum_duplicates { DUP_ERROR, DUP_REPLACE, DUP_UPDATE };
935
enum release_type { RELEASE_NORMAL, RELEASE_WAIT_FOR_DROP };
938
Make sure that the order of schema_tables and enum_schema_tables are the same.
941
enum enum_schema_tables
945
SCH_COLLATION_CHARACTER_SET_APPLICABILITY,
948
SCH_GLOBAL_VARIABLES,
949
SCH_KEY_COLUMN_USAGE,
953
SCH_REFERENTIAL_CONSTRAINTS,
956
SCH_SESSION_VARIABLES,
960
SCH_TABLE_CONSTRAINTS,
966
#define MY_I_S_MAYBE_NULL 1
967
#define MY_I_S_UNSIGNED 2
970
#define SKIP_OPEN_TABLE 0 // do not open table
971
#define OPEN_FRM_ONLY 1 // open FRM file only
972
#define OPEN_FULL_TABLE 2 // open FRM,MYD, MYI files
392
975
"Declared Type Collation"
409
992
#define MY_COLL_ALLOW_CONV 3
410
993
#define MY_COLL_DISALLOW_NONE 4
411
994
#define MY_COLL_CMP_CONV 7
412
#define clear_timestamp_auto_bits(_target_, _bits_) \
413
(_target_)= (enum timestamp_auto_set_type)((int)(_target_) & ~(int)(_bits_))
416
* The following are for the interface with the .frm file
419
#define FIELDFLAG_PACK_SHIFT 3
420
#define FIELDFLAG_MAX_DEC 31
422
#define MTYP_TYPENR(type) (type & 127) /* Remove bits from type */
424
#define f_settype(x) (((int) x) << FIELDFLAG_PACK_SHIFT)
428
template <class T> void set_if_bigger(T &a, const T &b)
434
template <class T> void set_if_smaller(T &a, const T &b)
441
#define set_if_bigger(a,b) do { \
442
const typeof(a) _a = (a); \
443
const typeof(b) _b = (b); \
444
(void) (&_a == &_b); \
445
if ((a) < (b)) (a)=(b); \
447
#define set_if_smaller(a,b) do { \
448
const typeof(a) _a = (a); \
449
const typeof(b) _b = (b); \
450
(void) (&_a == &_b); \
451
if ((a) > (b)) (a)=(b); \
455
#define set_if_bigger(a,b) do { if ((a) < (b)) (a)=(b); } while(0)
456
#define set_if_smaller(a,b) do { if ((a) > (b)) (a)=(b); } while(0)
461
#define array_elements(a) \
462
((sizeof(a) / sizeof(*(a))) / \
463
static_cast<size_t>(!(sizeof(a) % sizeof(*(a)))))
466
/* Some types that is different between systems */
469
#define FN_LIBCHAR '/'
470
#define FN_ROOTDIR "/"
472
#define MY_NFILE 64 /* This is only used to save filenames */
473
#ifndef OS_FILE_LIMIT
474
#define OS_FILE_LIMIT 65535
478
How much overhead does malloc have. The code often allocates
479
something like 1024-MALLOC_OVERHEAD bytes
481
#define MALLOC_OVERHEAD 8
483
/* get memory in huncs */
484
static const uint32_t ONCE_ALLOC_INIT= 4096;
485
/* Typical record cash */
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;
490
/* Default size of a key cache block */
491
static const uint32_t KEY_CACHE_BLOCK_SIZE= 1024;
494
/* Some things that this system doesn't have */
496
/* Some defines of functions for portability */
498
#ifndef uint64_t2double
499
#define uint64_t2double(A) ((double) (uint64_t) (A))
503
#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
505
#define ulong_to_double(X) ((double) (ulong) (X))
507
/* From limits.h instead */
509
#define DBL_MIN 4.94065645841246544e-324
512
#define DBL_MAX 1.79769313486231470e+308
516
/* Define missing math constants. */
518
#define M_PI 3.14159265358979323846
521
#define M_E 2.7182818284590452354
524
#define M_LN2 0.69314718055994530942
528
Max size that must be added to a so that we know Size to make
531
#define MY_ALIGN(A,L) (((A) + (L) - 1) & ~((L) - 1))
532
#define ALIGN_SIZE(A) MY_ALIGN((A),sizeof(double))
533
/* Size to make adressable obj. */
534
#define ALIGN_PTR(A, t) ((t*) MY_ALIGN((A),sizeof(t)))
535
/* Offset of field f in structure t */
536
#define OFFSET(t, f) ((size_t)(char *)&((t *)0)->f)
538
#define ADD_TO_PTR(ptr,size,type) (type) (reinterpret_cast<const unsigned char*>(ptr)+size)
539
#define PTR_BYTE_DIFF(A,B) (ptrdiff_t) (reinterpret_cast<const unsigned char*>(A) - reinterpret_cast<const unsigned char*>(B))
541
#define ADD_TO_PTR(ptr,size,type) (type) ((unsigned char*) (ptr)+size)
542
#define PTR_BYTE_DIFF(A,B) (ptrdiff_t) ((unsigned char*) (A) - (unsigned char*) (B))
545
#define MY_DIV_UP(A, B) (((A) + (B) - 1) / (B))
546
#define MY_ALIGNED_BYTE_ARRAY(N, S, T) T N[MY_DIV_UP(S, sizeof(T))]
548
/* Typdefs for easyier portability */
551
#if defined(SIZEOF_OFF_T)
552
# if (SIZEOF_OFF_T == 8)
553
# define OFF_T_MAX (INT64_MAX)
555
# define OFF_T_MAX (INT32_MAX)
559
#define MY_FILEPOS_ERROR -1
561
#define DRIZZLE_SERVER
563
/* Length of decimal number represented by INT32. */
564
#define MY_INT32_NUM_DECIMAL_DIGITS 11
566
/* Length of decimal number represented by INT64. */
567
#define MY_INT64_NUM_DECIMAL_DIGITS 21
570
Io buffer size; Must be a power of 2 and
571
a multiple of 512. May be
572
smaller what the disk page size. This influences the speed of the
573
isam btree library. eg to big to slow.
576
/* Max file name len */
578
/* Max length of extension (part of FN_LEN) */
580
/* Max length of full path-name */
581
#define FN_REFLEN 512
582
/* File extension character */
583
#define FN_EXTCHAR '.'
584
/* ~ is used as abbrev for home dir */
585
#define FN_HOMELIB '~'
586
/* ./ is used as abbrev for current dir */
587
#define FN_CURLIB '.'
588
/* Parent directory; Must be a string */
589
#define FN_PARENTDIR ".."
591
/* Quote argument (before cpp) */
593
# define QUOTE_ARG(x) #x
595
/* Quote argument, (after cpp) */
596
#ifndef STRINGIFY_ARG
597
# define STRINGIFY_ARG(x) QUOTE_ARG(x)
601
* The macros below are borrowed from include/linux/compiler.h in the
602
* Linux kernel. Use them to indicate the likelyhood of the truthfulness
603
* of a condition. This serves two purposes - newer versions of gcc will be
604
* able to optimize for branch predication, which could yield siginficant
605
* performance gains in frequently executed sections of the code, and the
606
* other reason to use them is for documentation
608
#if !defined(__GNUC__)
609
#define __builtin_expect(x, expected_value) (x)
612
#define likely(x) __builtin_expect((x),1)
613
#define unlikely(x) __builtin_expect((x),0)
617
Only Linux is known to need an explicit sync of the directory to make sure a
618
file creation/deletion/renaming in(from,to) this directory durable.
620
#ifdef TARGET_OS_LINUX
621
#define NEED_EXPLICIT_SYNC_DIR 1
624
/* We need to turn off _DTRACE_VERSION if we're not going to use dtrace */
625
#if !defined(HAVE_DTRACE)
626
# undef _DTRACE_VERSION
627
# define _DTRACE_VERSION 0
630
} /* namespace drizzled */
632
#endif /* DRIZZLED_DEFINITIONS_H */
998
This enum is used to report information about monotonicity of function
999
represented by Item* tree.
1000
Monotonicity is defined only for Item* trees that represent table
1001
partitioning expressions (i.e. have no subselects/user vars/PS parameters
1002
etc etc). An Item* tree is assumed to have the same monotonicity properties
1003
as its correspoinding function F:
1005
[signed] int64_t F(field1, field2, ...) {
1006
put values of field_i into table record buffer;
1007
return item->val_int();
1011
At the moment function monotonicity is not well defined (and so may be
1012
incorrect) for Item trees with parameters/return types that are different
1013
from INT_RESULT, may be NULL, or are unsigned.
1014
It will be possible to address this issue once the related partitioning bugs
1015
(BUG#16002, BUG#15447, BUG#13436) are fixed.
1018
typedef enum monotonicity_info
1020
NON_MONOTONIC, /* none of the below holds */
1021
MONOTONIC_INCREASING, /* F() is unary and (x < y) => (F(x) <= F(y)) */
1022
MONOTONIC_STRICT_INCREASING /* F() is unary and (x < y) => (F(x) < F(y)) */
1023
} enum_monotonicity_info;
1026
#endif /* DRIZZLE_SERVER_DEFINITIONS_H */