diff options
author | Sergei Golubchik <sergii@pisem.net> | 2014-05-06 09:57:39 +0200 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2014-05-06 09:57:39 +0200 |
commit | e2e5d07b2807706fb9187f00c049474a01ab15da (patch) | |
tree | 811b3c4d12a5a75af76fc88d793c3cdb17bf4414 /storage/innobase/include/dict0dict.ic | |
parent | 3792693f311a90cf195ec6d2f9b3762255a249c7 (diff) | |
parent | 83759e02dc12c8fb2576e240f307bc789e9c59cd (diff) | |
download | mariadb-git-e2e5d07b2807706fb9187f00c049474a01ab15da.tar.gz |
MDEV-6184 10.0.11 merge
InnoDB 5.6.16
Diffstat (limited to 'storage/innobase/include/dict0dict.ic')
-rw-r--r-- | storage/innobase/include/dict0dict.ic | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/storage/innobase/include/dict0dict.ic b/storage/innobase/include/dict0dict.ic index 83953c9325a..066ffe47e4a 100644 --- a/storage/innobase/include/dict0dict.ic +++ b/storage/innobase/include/dict0dict.ic @@ -1403,4 +1403,31 @@ dict_table_is_temporary( return(DICT_TF2_FLAG_IS_SET(table, DICT_TF2_TEMPORARY)); } +/**********************************************************************//** +Get index by first field of the index +@return index which is having first field matches +with the field present in field_index position of table */ +UNIV_INLINE +dict_index_t* +dict_table_get_index_on_first_col( +/*==============================*/ + const dict_table_t* table, /*!< in: table */ + ulint col_index) /*!< in: position of column + in table */ +{ + ut_ad(col_index < table->n_cols); + + dict_col_t* column = dict_table_get_nth_col(table, col_index); + + for (dict_index_t* index = dict_table_get_first_index(table); + index != NULL; index = dict_table_get_next_index(index)) { + + if (index->fields[0].col == column) { + return(index); + } + } + ut_error; + return(0); +} + #endif /* !UNIV_HOTBACKUP */ |