|
drizzle
C++ MySQL-protocol-compatible database server
|
#include "univ.i"#include "dict0types.h"#include "data0type.h"#include "mem0mem.h"#include "rem0types.h"#include "btr0types.h"#include "lock0types.h"#include "que0types.h"#include "sync0rw.h"#include "ut0mem.h"#include "ut0lst.h"#include "ut0rnd.h"#include "ut0byte.h"#include "hash0hash.h"#include "trx0types.h"Go to the source code of this file.
Classes | |
| struct | dict_col_struct |
| struct | dict_field_struct |
| struct | dict_index_struct |
| struct | dict_foreign_struct |
| struct | dict_table_struct |
Functions | |
| UNIV_INTERN dict_table_t * | dict_mem_table_create (const char *name, ulint space, ulint n_cols, ulint flags) |
| UNIV_INTERN void | dict_mem_table_free (dict_table_t *table) |
| UNIV_INTERN void | dict_mem_table_add_col (dict_table_t *table, mem_heap_t *heap, const char *name, ulint mtype, ulint prtype, ulint len) |
| UNIV_INTERN void | dict_mem_fill_column_struct (dict_col_t *column, ulint col_pos, ulint mtype, ulint prtype, ulint col_len) |
| UNIV_INLINE void | dict_mem_fill_index_struct (dict_index_t *index, mem_heap_t *heap, const char *table_name, const char *index_name, ulint space, ulint type, ulint n_fields) |
| UNIV_INTERN dict_index_t * | dict_mem_index_create (const char *table_name, const char *index_name, ulint space, ulint type, ulint n_fields) |
| UNIV_INTERN void | dict_mem_index_add_field (dict_index_t *index, const char *name, ulint prefix_len) |
| UNIV_INTERN void | dict_mem_index_free (dict_index_t *index) |
| UNIV_INTERN dict_foreign_t * | dict_mem_foreign_create (void) |
| UNIV_INTERN void | dict_mem_foreign_table_name_lookup_set (dict_foreign_t *foreign, ibool do_alloc) |
| UNIV_INTERN void | dict_mem_referenced_table_name_lookup_set (dict_foreign_t *foreign, ibool do_alloc) |
| #define dict0mem_h |
Definition at line 28 of file dict0mem.h.
| #define DICT_CLUSTERED 1 |
Type flags of an index: OR'ing of the flags is allowed to define a combination of types clustered index
Definition at line 51 of file dict0mem.h.
| #define DICT_FK_MAX_RECURSIVE_LOAD 255 |
Tables could be chained together with Foreign key constraint. When first load the parent table, we would load all of its descedents. This could result in rescursive calls and out of stack error eventually. DICT_FK_MAX_RECURSIVE_LOAD defines the maximum number of recursive loads, when exceeded, the child table will not be loaded. It will be loaded when the foreign constraint check needs to be run.
Definition at line 122 of file dict0mem.h.
| #define DICT_FOREIGN_ON_DELETE_CASCADE 1 |
The flags for ON_UPDATE and ON_DELETE can be ORed; the default is that a foreign key constraint is enforced, therefore RESTRICT just means no flag ON DELETE CASCADE
Definition at line 457 of file dict0mem.h.
| #define DICT_FOREIGN_ON_DELETE_NO_ACTION 16 |
ON DELETE NO ACTION
Definition at line 461 of file dict0mem.h.
| #define DICT_FOREIGN_ON_DELETE_SET_NULL 2 |
ON UPDATE SET NULL
Definition at line 458 of file dict0mem.h.
| #define DICT_FOREIGN_ON_UPDATE_CASCADE 4 |
ON DELETE CASCADE
Definition at line 459 of file dict0mem.h.
| #define DICT_FOREIGN_ON_UPDATE_NO_ACTION 32 |
ON UPDATE NO ACTION
Definition at line 462 of file dict0mem.h.
| #define DICT_FOREIGN_ON_UPDATE_SET_NULL 8 |
ON UPDATE SET NULL
Definition at line 460 of file dict0mem.h.
| #define DICT_IBUF 8 |
insert buffer tree
Definition at line 55 of file dict0mem.h.
| #define DICT_MAX_INDEX_COL_LEN REC_MAX_INDEX_COL_LEN |
DICT_MAX_INDEX_COL_LEN is measured in bytes and is the maximum indexed column length (or indexed prefix length).
It is set to 3*256, so that one can create a column prefix index on 256 characters of a TEXT or VARCHAR column also in the UTF-8 charset. In that charset, a character may take at most 3 bytes. This constant MUST NOT BE CHANGED, or the compatibility of InnoDB data files would be at risk!
Definition at line 308 of file dict0mem.h.
| #define DICT_TABLE_ORDINARY 1 |
Types for a table object ordinary table
Definition at line 59 of file dict0mem.h.
| #define DICT_TF2_BITS (DICT_TF2_SHIFT + 1) |
Total number of bits in table->flags.
Definition at line 111 of file dict0mem.h.
| #define DICT_TF2_SHIFT DICT_TF_BITS |
Additional table flags.
These flags will be stored in SYS_TABLES.MIX_LEN. All unused flags will be written as 0. The column may contain garbage for tables created with old versions of InnoDB that only implemented ROW_FORMAT=REDUNDANT. Shift value for table->flags.
Definition at line 106 of file dict0mem.h.
| #define DICT_TF2_TEMPORARY 1 |
TRUE for tables from CREATE TEMPORARY TABLE.
Definition at line 109 of file dict0mem.h.
| #define DICT_TF_BITS 6 |
number of flag bits
Definition at line 93 of file dict0mem.h.
| #define DICT_TF_COMPACT |
Table flags. All unused bits must be 0.
Definition at line 68 of file dict0mem.h.
| #define DICT_TF_FORMAT_51 0 |
InnoDB/MySQL up to 5.1
Definition at line 82 of file dict0mem.h.
| #define DICT_TF_FORMAT_MASK ((~(~0 << (DICT_TF_BITS - DICT_TF_FORMAT_SHIFT))) << DICT_TF_FORMAT_SHIFT) |
Definition at line 80 of file dict0mem.h.
| #define DICT_TF_FORMAT_MAX DICT_TF_FORMAT_ZIP |
Maximum supported file format
Definition at line 87 of file dict0mem.h.
| #define DICT_TF_FORMAT_MIN DICT_TF_FORMAT_51 |
Minimum supported file format
Definition at line 90 of file dict0mem.h.
| #define DICT_TF_FORMAT_SHIFT 5 /* file format */ |
File format
Definition at line 79 of file dict0mem.h.
| #define DICT_TF_FORMAT_ZIP 1 |
InnoDB plugin for 5.1: compressed tables, new BLOB treatment
Definition at line 83 of file dict0mem.h.
| #define DICT_TF_ZSSIZE_MASK (15 << DICT_TF_ZSSIZE_SHIFT) |
Definition at line 73 of file dict0mem.h.
| #define DICT_TF_ZSSIZE_MAX (UNIV_PAGE_SIZE_SHIFT - PAGE_ZIP_MIN_SIZE_SHIFT + 1) |
Definition at line 74 of file dict0mem.h.
| #define DICT_TF_ZSSIZE_SHIFT 1 |
Compressed page size (0=uncompressed, up to 15 compressed sizes)
Definition at line 72 of file dict0mem.h.
| #define DICT_UNIQUE 2 |
unique index
Definition at line 52 of file dict0mem.h.
| #define DICT_UNIVERSAL 4 |
index which can contain records from any other index
Definition at line 53 of file dict0mem.h.
| #define FK_MAX_CASCADE_DEL 255 |
Similarly, when tables are chained together with foreign key constraints with on cascading delete/update clause, delete from parent table could result in recursive cascading calls. This defines the maximum number of such cascading deletes/updates allowed. When exceeded, the delete from parent table will fail, and user has to drop excessive foreign constraint before proceeds.
Definition at line 130 of file dict0mem.h.
| UNIV_INTERN void dict_mem_fill_column_struct | ( | dict_col_t * | column, |
| ulint | col_pos, | ||
| ulint | mtype, | ||
| ulint | prtype, | ||
| ulint | col_len ) |
This function populates a dict_col_t memory structure with supplied information. in: column length
This function populates a dict_col_t memory structure with supplied information.
| column | out: column struct to be filled |
| col_pos | in: column position |
| mtype | in: main data type |
| prtype | in: precise type |
| col_len | in: column length |
Definition at line 220 of file dict0mem.cc.
| UNIV_INLINE void dict_mem_fill_index_struct | ( | dict_index_t * | index, |
| mem_heap_t * | heap, | ||
| const char * | table_name, | ||
| const char * | index_name, | ||
| ulint | space, | ||
| ulint | type, | ||
| ulint | n_fields ) |
This function poplulates a dict_index_t index memory structure with supplied information. in: number of fields
| index | out: index to be filled |
| heap | in: memory heap |
| table_name | in: table name |
| index_name | in: index name |
| space | in: space where the index tree is placed, ignored if the index is of the clustered type |
| type | in: DICT_UNIQUE, DICT_CLUSTERED, ... ORed |
| UNIV_INTERN dict_foreign_t * dict_mem_foreign_create | ( | void | ) |
Creates and initializes a foreign constraint memory object.
Definition at line 280 of file dict0mem.cc.
| UNIV_INTERN void dict_mem_foreign_table_name_lookup_set | ( | dict_foreign_t * | foreign, |
| ibool | do_alloc ) |
Sets the foreign_table_name_lookup pointer based on the value of srv_lower_case_table_names. in: is an alloc needed
Sets the foreign_table_name_lookup pointer based on the value of srv_lower_case_table_names. If that is 0 or 1, foreign_table_name_lookup will point to foreign_table_name. If 2, then another string is allocated of the heap and set to lower case.
| foreign | in/out: foreign struct |
| do_alloc | in: is an alloc needed |
Definition at line 302 of file dict0mem.cc.
| UNIV_INTERN void dict_mem_index_add_field | ( | dict_index_t * | index, |
| const char * | name, | ||
| ulint | prefix_len ) |
Adds a field definition to an index. NOTE: does not take a copy of the column name if the field is a column. The memory occupied by the column name may be released only after publishing the index. in: 0 or the column prefix length in a MySQL index like INDEX (textcol(25))
Adds a field definition to an index. NOTE: does not take a copy of the column name if the field is a column. The memory occupied by the column name may be released only after publishing the index.
| index | in: index |
| name | in: column name |
| prefix_len | in: 0 or the column prefix length in a MySQL index like INDEX (textcol(25)) |
Definition at line 355 of file dict0mem.cc.
| UNIV_INTERN dict_index_t * dict_mem_index_create | ( | const char * | table_name, |
| const char * | index_name, | ||
| ulint | space, | ||
| ulint | type, | ||
| ulint | n_fields ) |
Creates an index memory object.
Creates an index memory object.
| table_name | in: table name |
| index_name | in: index name |
| space | in: space where the index tree is placed, ignored if the index is of the clustered type |
| type | in: DICT_UNIQUE, DICT_CLUSTERED, ... ORed |
| n_fields | in: number of fields |
Definition at line 250 of file dict0mem.cc.
| UNIV_INTERN void dict_mem_index_free | ( | dict_index_t * | index | ) |
Frees an index memory object. in: index
Frees an index memory object.
| index | in: index |
Definition at line 380 of file dict0mem.cc.
| UNIV_INTERN void dict_mem_referenced_table_name_lookup_set | ( | dict_foreign_t * | foreign, |
| ibool | do_alloc ) |
Sets the reference_table_name_lookup pointer based on the value of srv_lower_case_table_names. in: is an alloc needed
Sets the referenced_table_name_lookup pointer based on the value of srv_lower_case_table_names. If that is 0 or 1, referenced_table_name_lookup will point to referenced_table_name. If 2, then another string is allocated of the heap and set to lower case.
| foreign | in/out: foreign struct |
| do_alloc | in: is an alloc needed |
Definition at line 329 of file dict0mem.cc.
| UNIV_INTERN void dict_mem_table_add_col | ( | dict_table_t * | table, |
| mem_heap_t * | heap, | ||
| const char * | name, | ||
| ulint | mtype, | ||
| ulint | prtype, | ||
| ulint | len ) |
Adds a column definition to a table. in: precision
Adds a column definition to a table.
| table | in: table |
| heap | in: temporary memory heap, or NULL |
| name | in: column name, or NULL |
| mtype | in: main datatype |
| prtype | in: precise type |
| len | in: precision |
Definition at line 177 of file dict0mem.cc.
| UNIV_INTERN dict_table_t * dict_mem_table_create | ( | const char * | name, |
| ulint | space, | ||
| ulint | n_cols, | ||
| ulint | flags ) |
Creates a table memory object.
Creates a table memory object.
| name | in: table name |
| space | in: space where the clustered index of the table is placed; this parameter is ignored if the table is made a member of a cluster |
| n_cols | in: number of columns |
| flags | in: table flags |
Definition at line 58 of file dict0mem.cc.
| UNIV_INTERN void dict_mem_table_free | ( | dict_table_t * | table | ) |
Free a table memory object. in: table
Free a table memory object.
| table | in: table |
Definition at line 110 of file dict0mem.cc.