1
1
/*****************************************************************************
3
Copyright (C) 1996, 2010, Innobase Oy. All Rights Reserved.
3
Copyright (c) 1996, 2009, Innobase Oy. All Rights Reserved.
5
5
This program is free software; you can redistribute it and/or modify it under
6
6
the terms of the GNU General Public License as published by the Free Software
88
88
new BLOB treatment */
89
89
/** Maximum supported file format */
90
90
#define DICT_TF_FORMAT_MAX DICT_TF_FORMAT_ZIP
92
/** Minimum supported file format */
93
#define DICT_TF_FORMAT_MIN DICT_TF_FORMAT_51
96
92
#define DICT_TF_BITS 6 /*!< number of flag bits */
97
93
#if (1 << (DICT_TF_BITS - DICT_TF_FORMAT_SHIFT)) <= DICT_TF_FORMAT_MAX
116
112
in table->flags. */
119
/** Tables could be chained together with Foreign key constraint. When
120
first load the parent table, we would load all of its descedents.
121
This could result in rescursive calls and out of stack error eventually.
122
DICT_FK_MAX_RECURSIVE_LOAD defines the maximum number of recursive loads,
123
when exceeded, the child table will not be loaded. It will be loaded when
124
the foreign constraint check needs to be run. */
125
#define DICT_FK_MAX_RECURSIVE_LOAD 255
127
/** Similarly, when tables are chained together with foreign key constraints
128
with on cascading delete/update clause, delete from parent table could
129
result in recursive cascading calls. This defines the maximum number of
130
such cascading deletes/updates allowed. When exceeded, the delete from
131
parent table will fail, and user has to drop excessive foreign constraint
133
#define FK_MAX_CASCADE_DEL 255
135
116
/**********************************************************************//**
136
117
Creates a table memory object.
166
147
ulint prtype, /*!< in: precise type */
167
148
ulint len); /*!< in: precision */
168
149
/**********************************************************************//**
169
This function populates a dict_col_t memory structure with
170
supplied information. */
173
dict_mem_fill_column_struct(
174
/*========================*/
175
dict_col_t* column, /*!< out: column struct to be
177
ulint col_pos, /*!< in: column position */
178
ulint mtype, /*!< in: main data type */
179
ulint prtype, /*!< in: precise type */
180
ulint col_len); /*!< in: column length */
181
/**********************************************************************//**
182
This function poplulates a dict_index_t index memory structure with
183
supplied information. */
186
dict_mem_fill_index_struct(
187
/*=======================*/
188
dict_index_t* index, /*!< out: index to be filled */
189
mem_heap_t* heap, /*!< in: memory heap */
190
const char* table_name, /*!< in: table name */
191
const char* index_name, /*!< in: index name */
192
ulint space, /*!< in: space where the index tree is
193
placed, ignored if the index is of
194
the clustered type */
195
ulint type, /*!< in: DICT_UNIQUE,
196
DICT_CLUSTERED, ... ORed */
197
ulint n_fields); /*!< in: number of fields */
198
/**********************************************************************//**
199
150
Creates an index memory object.
200
151
@return own: index object */
264
215
the string, MySQL uses 1 or 2
265
216
bytes to store the string length) */
267
unsigned mbminmaxlen:5; /*!< minimum and maximum length of a
269
DATA_MBMINMAXLEN(mbminlen,mbmaxlen);
270
mbminlen=DATA_MBMINLEN(mbminmaxlen);
271
mbmaxlen=DATA_MBMINLEN(mbminmaxlen) */
218
unsigned mbminlen:2; /*!< minimum length of a
219
character, in bytes */
220
unsigned mbmaxlen:3; /*!< maximum length of a
221
character, in bytes */
272
222
/*----------------------*/
273
223
/* End of definitions copied from dtype_t */
309
259
/** Data structure for an index. Most fields will be
310
260
initialized to 0, NULL or FALSE in dict_mem_index_create(). */
311
261
struct dict_index_struct{
312
index_id_t id; /*!< id of the index */
262
dulint id; /*!< id of the index */
313
263
mem_heap_t* heap; /*!< memory heap */
314
264
const char* name; /*!< index name */
315
265
const char* table_name;/*!< table name */
366
316
rw_lock_t lock; /*!< read-write lock protecting the
367
317
upper levels of the index tree */
368
trx_id_t trx_id; /*!< id of the transaction that created this
318
ib_uint64_t trx_id; /*!< id of the transaction that created this
369
319
index, or 0 if the index existed
370
320
when InnoDB was started up */
371
321
#endif /* !UNIV_HOTBACKUP */
430
380
/** Data structure for a database table. Most fields will be
431
381
initialized to 0, NULL or FALSE in dict_mem_table_create(). */
432
382
struct dict_table_struct{
433
table_id_t id; /*!< id of the table */
383
dulint id; /*!< id of the table */
434
384
mem_heap_t* heap; /*!< memory heap */
435
char* name; /*!< table name */
385
const char* name; /*!< table name */
436
386
const char* dir_path_of_temp_table;/*!< NULL or the directory path
437
387
where a TEMPORARY table that was explicitly
438
388
created by a user should be placed if
484
434
NOT allowed until this count gets to zero;
485
435
MySQL does NOT itself check the number of
486
436
open handles at drop */
487
unsigned fk_max_recusive_level:8;
488
/*!< maximum recursive level we support when
489
loading tables chained together with FK
490
constraints. If exceeds this level, we will
491
stop loading child table into memory along with
493
437
ulint n_foreign_key_checks_running;
494
438
/*!< count of how many foreign key check
495
439
operations are currently being performed