diff options
Diffstat (limited to 'storage/innobase/include/row0upd.ic')
-rw-r--r-- | storage/innobase/include/row0upd.ic | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/storage/innobase/include/row0upd.ic b/storage/innobase/include/row0upd.ic index 8b794e47a07..18c72309930 100644 --- a/storage/innobase/include/row0upd.ic +++ b/storage/innobase/include/row0upd.ic @@ -1,6 +1,7 @@ /***************************************************************************** Copyright (c) 1996, 2015, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2017, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -97,10 +98,10 @@ upd_field_set_field_no( dict_index_t* index, /*!< in: index */ trx_t* trx) /*!< in: transaction */ { - upd_field->field_no = field_no; + upd_field->field_no = unsigned(field_no); upd_field->orig_len = 0; - if (field_no >= dict_index_get_n_fields(index)) { + if (UNIV_UNLIKELY(field_no >= dict_index_get_n_fields(index))) { ib::error() << " trying to access field " << field_no << " in " << index->name @@ -125,19 +126,10 @@ upd_field_set_v_field_no( ulint field_no, dict_index_t* index) { - upd_field->field_no = field_no; + ut_a(field_no < dict_table_get_n_v_cols(index->table)); + upd_field->field_no = unsigned(field_no); upd_field->orig_len = 0; - if (field_no >= dict_table_get_n_v_cols(index->table)) { - ib::error() - << " trying to access virtual field " << field_no - << " in " << index->name - << " of table " << index->table->name - << " which contains only " << index->table->n_v_cols - << " virutal columns"; - ut_ad(0); - } - dict_col_copy_type(&dict_table_get_nth_v_col( index->table, field_no)->m_col, dfield_get_type(&upd_field->new_val)); |