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
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
417
389
dict_index_get_on_id_low(
418
390
/*=====================*/
419
391
dict_table_t* table, /*!< in: table */
420
index_id_t index_id); /*!< in: index id */
392
dulint index_id); /*!< in: index id */
421
393
/**********************************************************************//**
422
394
Checks if a table is in the dictionary cache.
423
395
@return table, NULL if not found */
444
416
dict_table_get_on_id_low(
445
417
/*=====================*/
446
table_id_t table_id); /*!< in: table id */
418
dulint table_id); /*!< in: table id */
447
419
/**********************************************************************//**
448
420
Find an index that is equivalent to the one passed in and is not marked
700
672
dict_table_zip_size(
701
673
/*================*/
702
674
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
675
/********************************************************************//**
720
676
Checks if a column is in the ordering columns of the clustered index of a
721
677
table. Column prefixes are treated like whole columns.
747
703
dict_index_find_on_id_low(
748
704
/*======================*/
749
index_id_t id); /*!< in: index id */
705
dulint id); /*!< in: index id */
750
706
/**********************************************************************//**
751
707
Adds an index to the dictionary cache.
752
708
@return DB_SUCCESS, DB_TOO_BIG_RECORD, or DB_CORRUPTION */
930
886
dict_index_get_if_in_cache_low(
931
887
/*===========================*/
932
index_id_t index_id); /*!< in: index id */
888
dulint index_id); /*!< in: index id */
933
889
#if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG
934
890
/**********************************************************************//**
935
891
Returns an index object if it is found in the dictionary cache.
939
895
dict_index_get_if_in_cache(
940
896
/*=======================*/
941
index_id_t index_id); /*!< in: index id */
897
dulint index_id); /*!< in: index id */
942
898
#endif /* UNIV_DEBUG || UNIV_BUF_DEBUG */
943
899
#ifdef UNIV_DEBUG
944
900
/**********************************************************************//**
1065
1021
are used in query optimization. */
1024
dict_update_statistics_low(
1025
/*=======================*/
1026
dict_table_t* table, /*!< in/out: table */
1027
ibool has_dict_mutex);/*!< in: TRUE if the caller has the
1029
/*********************************************************************//**
1030
Calculates new estimates for table and index statistics. The statistics
1031
are used in query optimization. */
1068
1034
dict_update_statistics(
1069
1035
/*===================*/
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
1036
dict_table_t* table); /*!< in/out: table */
1075
1037
/********************************************************************//**
1076
1038
Reserves the dictionary system mutex for MySQL. */
1085
1047
dict_mutex_exit_for_mysql(void);
1086
1048
/*===========================*/
1087
1049
/**********************************************************************//**
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
1050
Lock the appropriate mutex to protect index->stat_n_diff_key_vals[].
1051
index->id is used to pick the right mutex and it should not change
1052
before dict_index_stat_mutex_exit() is called on this index. */
1093
dict_table_stats_lock(
1094
/*==================*/
1095
const dict_table_t* table, /*!< in: table */
1096
ulint latch_mode); /*!< in: RW_S_LATCH or
1055
dict_index_stat_mutex_enter(
1056
/*========================*/
1057
const dict_index_t* index); /*!< in: index */
1098
1058
/**********************************************************************//**
1099
Unlock the latch that has been locked by dict_table_stats_lock() */
1059
Unlock the appropriate mutex that protects index->stat_n_diff_key_vals[]. */
1102
dict_table_stats_unlock(
1103
/*====================*/
1104
const dict_table_t* table, /*!< in: table */
1105
ulint latch_mode); /*!< in: RW_S_LATCH or
1062
dict_index_stat_mutex_exit(
1063
/*=======================*/
1064
const dict_index_t* index); /*!< in: index */
1107
1065
/********************************************************************//**
1108
1066
Checks if the database name in two table names is the same.
1109
1067
@return TRUE if same db name */
1161
1119
and DROP TABLE, as well as reading
1162
1120
the dictionary data for a table from
1163
1121
system tables */
1164
row_id_t row_id; /*!< the next row id to assign;
1122
dulint row_id; /*!< the next row id to assign;
1165
1123
NOTE that at a checkpoint this
1166
1124
must be written to the dict system
1167
1125
header and flushed to a file; in