1
1
/*****************************************************************************
3
Copyright (C) 1996, 2009, 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
11
11
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
13
13
You should have received a copy of the GNU General Public License along with
14
this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
15
St, Fifth Floor, Boston, MA 02110-1301 USA
14
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
15
Place, Suite 330, Boston, MA 02111-1307 USA
17
17
*****************************************************************************/
76
76
dict_table_get_on_id(
77
77
/*=================*/
78
table_id_t table_id, /*!< in: table id */
79
trx_t* trx); /*!< in: transaction handle */
78
dulint table_id, /*!< in: table id */
79
trx_t* trx); /*!< in: transaction handle */
80
80
/********************************************************************//**
81
81
Decrements the count of open MySQL handles to a table. */
102
102
dict_load_space_id_list(void);
103
103
/*=========================*/
104
104
/*********************************************************************//**
105
Gets the minimum number of bytes per character.
106
@return minimum multi-byte char size, in bytes */
109
dict_col_get_mbminlen(
110
/*==================*/
111
const dict_col_t* col); /*!< in: column */
112
/*********************************************************************//**
113
Gets the maximum number of bytes per character.
114
@return maximum multi-byte char size, in bytes */
117
dict_col_get_mbmaxlen(
118
/*==================*/
119
const dict_col_t* col); /*!< in: column */
120
/*********************************************************************//**
121
Sets the minimum and maximum number of bytes per character. */
124
dict_col_set_mbminmaxlen(
125
/*=====================*/
126
dict_col_t* col, /*!< in/out: column */
127
ulint mbminlen, /*!< in: minimum multi-byte
128
character size, in bytes */
129
ulint mbmaxlen); /*!< in: minimum multi-byte
130
character size, in bytes */
131
/*********************************************************************//**
132
105
Gets the column data type. */
296
269
dict_table_change_id_in_cache(
297
270
/*==========================*/
298
271
dict_table_t* table, /*!< in/out: table object already in cache */
299
table_id_t new_id);/*!< in: new id to set */
272
dulint new_id);/*!< in: new id to set */
300
273
/**********************************************************************//**
301
274
Adds a foreign key constraint object to the dictionary cache. May free
302
275
the object if there already is an object with the same identifier in.
337
310
dict_table_replace_index_in_foreign_list(
338
311
/*=====================================*/
339
312
dict_table_t* table, /*!< in/out: table */
340
dict_index_t* index, /*!< in: index to be replaced */
341
const trx_t* trx); /*!< in: transaction handle */
313
dict_index_t* index); /*!< in: index to be replaced */
342
314
/*********************************************************************//**
343
315
Checks if a index is defined for a foreign key constraint. Index is a part
344
316
of a foreign key constraint if the index is referenced by foreign key
372
344
name before it: test.table2; the
373
345
default database id the database of
374
346
parameter name */
375
size_t sql_length, /*!< in: length of sql_string */
376
347
const char* name, /*!< in: table full name in the
378
349
database_name/table_name */
417
388
dict_index_get_on_id_low(
418
389
/*=====================*/
419
390
dict_table_t* table, /*!< in: table */
420
index_id_t index_id); /*!< in: index id */
391
dulint index_id); /*!< in: index id */
421
392
/**********************************************************************//**
422
393
Checks if a table is in the dictionary cache.
423
394
@return table, NULL if not found */
444
415
dict_table_get_on_id_low(
445
416
/*=====================*/
446
table_id_t table_id); /*!< in: table id */
417
dulint table_id); /*!< in: table id */
447
418
/**********************************************************************//**
448
419
Find an index that is equivalent to the one passed in and is not marked
700
671
dict_table_zip_size(
701
672
/*================*/
702
673
const dict_table_t* table); /*!< in: table */
703
/*********************************************************************//**
704
Obtain exclusive locks on all index trees of the table. This is to prevent
705
accessing index trees while InnoDB is updating internal metadata for
706
operations such as truncate tables. */
709
dict_table_x_lock_indexes(
710
/*======================*/
711
dict_table_t* table); /*!< in: table */
712
/*********************************************************************//**
713
Release the exclusive locks on all index tree. */
716
dict_table_x_unlock_indexes(
717
/*========================*/
718
dict_table_t* table); /*!< in: table */
719
674
/********************************************************************//**
720
675
Checks if a column is in the ordering columns of the clustered index of a
721
676
table. Column prefixes are treated like whole columns.
747
702
dict_index_find_on_id_low(
748
703
/*======================*/
749
index_id_t id); /*!< in: index id */
704
dulint id); /*!< in: index id */
750
705
/**********************************************************************//**
751
706
Adds an index to the dictionary cache.
752
@return DB_SUCCESS, DB_TOO_BIG_RECORD, or DB_CORRUPTION */
707
@return DB_SUCCESS or error code */
755
710
dict_index_add_to_cache(
930
885
dict_index_get_if_in_cache_low(
931
886
/*===========================*/
932
index_id_t index_id); /*!< in: index id */
887
dulint index_id); /*!< in: index id */
933
888
#if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG
934
889
/**********************************************************************//**
935
890
Returns an index object if it is found in the dictionary cache.
939
894
dict_index_get_if_in_cache(
940
895
/*=======================*/
941
index_id_t index_id); /*!< in: index id */
896
dulint index_id); /*!< in: index id */
942
897
#endif /* UNIV_DEBUG || UNIV_BUF_DEBUG */
943
898
#ifdef UNIV_DEBUG
944
899
/**********************************************************************//**
958
913
dict_table_check_for_dup_indexes(
959
914
/*=============================*/
960
const dict_table_t* table, /*!< in: Check for dup indexes
915
const dict_table_t* table); /*!< in: Check for dup indexes
962
ibool tmp_ok);/*!< in: TRUE=allow temporary
964
918
#endif /* UNIV_DEBUG */
965
919
/**********************************************************************//**
966
920
Builds a node pointer out of a physical record and a page number.
1065
1019
are used in query optimization. */
1022
dict_update_statistics_low(
1023
/*=======================*/
1024
dict_table_t* table, /*!< in/out: table */
1025
ibool has_dict_mutex);/*!< in: TRUE if the caller has the
1027
/*********************************************************************//**
1028
Calculates new estimates for table and index statistics. The statistics
1029
are used in query optimization. */
1068
1032
dict_update_statistics(
1069
1033
/*===================*/
1070
dict_table_t* table, /*!< in/out: table */
1071
ibool only_calc_if_missing_stats);/*!< in: only
1072
update/recalc the stats if they have
1073
not been initialized yet, otherwise
1034
dict_table_t* table); /*!< in/out: table */
1075
1035
/********************************************************************//**
1076
1036
Reserves the dictionary system mutex for MySQL. */
1085
1045
dict_mutex_exit_for_mysql(void);
1086
1046
/*===========================*/
1087
/**********************************************************************//**
1088
Lock the appropriate latch to protect a given table's statistics.
1089
table->id is used to pick the corresponding latch from a global array of
1093
dict_table_stats_lock(
1094
/*==================*/
1095
const dict_table_t* table, /*!< in: table */
1096
ulint latch_mode); /*!< in: RW_S_LATCH or
1098
/**********************************************************************//**
1099
Unlock the latch that has been locked by dict_table_stats_lock() */
1102
dict_table_stats_unlock(
1103
/*====================*/
1104
const dict_table_t* table, /*!< in: table */
1105
ulint latch_mode); /*!< in: RW_S_LATCH or
1107
1047
/********************************************************************//**
1108
1048
Checks if the database name in two table names is the same.
1109
1049
@return TRUE if same db name */
1161
1101
and DROP TABLE, as well as reading
1162
1102
the dictionary data for a table from
1163
1103
system tables */
1164
row_id_t row_id; /*!< the next row id to assign;
1104
dulint row_id; /*!< the next row id to assign;
1165
1105
NOTE that at a checkpoint this
1166
1106
must be written to the dict system
1167
1107
header and flushed to a file; in