diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2019-09-23 08:29:39 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2019-09-23 08:29:39 +0300 |
commit | 60cb5559a90b9889cec9bbeb2fc2a6ba44633dda (patch) | |
tree | 53e619ac900a1a97ca15e482764feb1a5a1ea730 /storage/innobase | |
parent | 44c5144943f534b9dcd8ac771955127c7e1c2146 (diff) | |
download | mariadb-git-60cb5559a90b9889cec9bbeb2fc2a6ba44633dda.tar.gz |
MDEV-17614 post-fix: Remove dead dup_chk_only=true code.
The parameter dup_chk_only was always passed as a constant false.
Remove the parameter and the dead code related to it.
Diffstat (limited to 'storage/innobase')
-rw-r--r-- | storage/innobase/include/row0ins.h | 22 | ||||
-rw-r--r-- | storage/innobase/row/row0ins.cc | 43 | ||||
-rw-r--r-- | storage/innobase/row/row0log.cc | 7 | ||||
-rw-r--r-- | storage/innobase/row/row0upd.cc | 4 |
4 files changed, 20 insertions, 56 deletions
diff --git a/storage/innobase/include/row0ins.h b/storage/innobase/include/row0ins.h index 3a85d7a21c4..164f6fe1ddb 100644 --- a/storage/innobase/include/row0ins.h +++ b/storage/innobase/include/row0ins.h @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2017, 2018, MariaDB Corporation. +Copyright (c) 2017, 2019, 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 @@ -92,10 +92,7 @@ row_ins_clust_index_entry_low( ulint n_uniq, /*!< in: 0 or index->n_uniq */ dtuple_t* entry, /*!< in/out: index entry to insert */ ulint n_ext, /*!< in: number of externally stored columns */ - que_thr_t* thr, /*!< in: query thread or NULL */ - bool dup_chk_only) - /*!< in: if true, just do duplicate check - and return. don't execute actual insert. */ + que_thr_t* thr) /*!< in: query thread or NULL */ MY_ATTRIBUTE((warn_unused_result)); /***************************************************************//** @@ -120,10 +117,7 @@ row_ins_sec_index_entry_low( dtuple_t* entry, /*!< in/out: index entry to insert */ trx_id_t trx_id, /*!< in: PAGE_MAX_TRX_ID during row_log_table_apply(), or 0 */ - que_thr_t* thr, /*!< in: query thread */ - bool dup_chk_only) - /*!< in: if true, just do duplicate check - and return. don't execute actual insert. */ + que_thr_t* thr) /*!< in: query thread */ MY_ATTRIBUTE((warn_unused_result)); /***************************************************************//** @@ -138,10 +132,7 @@ row_ins_clust_index_entry( dict_index_t* index, /*!< in: clustered index */ dtuple_t* entry, /*!< in/out: index entry to insert */ que_thr_t* thr, /*!< in: query thread */ - ulint n_ext, /*!< in: number of externally stored columns */ - bool dup_chk_only) - /*!< in: if true, just do duplicate check - and return. don't execute actual insert. */ + ulint n_ext) /*!< in: number of externally stored columns */ MY_ATTRIBUTE((warn_unused_result)); /***************************************************************//** Inserts an entry into a secondary index. Tries first optimistic, @@ -154,10 +145,7 @@ row_ins_sec_index_entry( /*====================*/ dict_index_t* index, /*!< in: secondary index */ dtuple_t* entry, /*!< in/out: index entry to insert */ - que_thr_t* thr, /*!< in: query thread */ - bool dup_chk_only) - /*!< in: if true, just do duplicate check - and return. don't execute actual insert. */ + que_thr_t* thr) /*!< in: query thread */ MY_ATTRIBUTE((warn_unused_result)); /***********************************************************//** Inserts a row to a table. This is a high-level function used in diff --git a/storage/innobase/row/row0ins.cc b/storage/innobase/row/row0ins.cc index 2cda0e3d03c..17c45503cc1 100644 --- a/storage/innobase/row/row0ins.cc +++ b/storage/innobase/row/row0ins.cc @@ -2553,10 +2553,7 @@ row_ins_clust_index_entry_low( ulint n_uniq, /*!< in: 0 or index->n_uniq */ dtuple_t* entry, /*!< in/out: index entry to insert */ ulint n_ext, /*!< in: number of externally stored columns */ - que_thr_t* thr, /*!< in: query thread */ - bool dup_chk_only) - /*!< in: if true, just do duplicate check - and return. don't execute actual insert. */ + que_thr_t* thr) /*!< in: query thread */ { btr_pcur_t pcur; btr_cur_t* cursor; @@ -2676,11 +2673,6 @@ err_exit: } } - if (dup_chk_only) { - mtr_commit(&mtr); - goto func_exit; - } - /* Note: Allowing duplicates would qualify for modification of an existing record as the new entry is exactly same as old entry. */ if (row_ins_must_modify_rec(cursor)) { @@ -2840,10 +2832,7 @@ row_ins_sec_index_entry_low( dtuple_t* entry, /*!< in/out: index entry to insert */ trx_id_t trx_id, /*!< in: PAGE_MAX_TRX_ID during row_log_table_apply(), or 0 */ - que_thr_t* thr, /*!< in: query thread */ - bool dup_chk_only) - /*!< in: if true, just do duplicate check - and return. don't execute actual insert. */ + que_thr_t* thr) /*!< in: query thread */ { DBUG_ENTER("row_ins_sec_index_entry_low"); @@ -3040,10 +3029,6 @@ row_ins_sec_index_entry_low( &cursor, 0, __FILE__, __LINE__, &mtr); } - if (dup_chk_only) { - goto func_exit; - } - if (row_ins_must_modify_rec(&cursor)) { /* There is already an index entry with a long enough common prefix, we must convert the insert into a modify of an @@ -3132,10 +3117,7 @@ row_ins_clust_index_entry( dict_index_t* index, /*!< in: clustered index */ dtuple_t* entry, /*!< in/out: index entry to insert */ que_thr_t* thr, /*!< in: query thread */ - ulint n_ext, /*!< in: number of externally stored columns */ - bool dup_chk_only) - /*!< in: if true, just do duplicate check - and return. don't execute actual insert. */ + ulint n_ext) /*!< in: number of externally stored columns */ { dberr_t err; ulint n_uniq; @@ -3170,8 +3152,7 @@ row_ins_clust_index_entry( err = row_ins_clust_index_entry_low( flags, BTR_MODIFY_LEAF, index, n_uniq, entry, - n_ext, thr, dup_chk_only); - + n_ext, thr); DEBUG_SYNC_C_IF_THD(thr_get_trx(thr)->mysql_thd, "after_row_ins_clust_index_entry_leaf"); @@ -3186,7 +3167,7 @@ row_ins_clust_index_entry( err = row_ins_clust_index_entry_low( flags, BTR_MODIFY_TREE, index, n_uniq, entry, - n_ext, thr, dup_chk_only); + n_ext, thr); DBUG_RETURN(err); } @@ -3202,10 +3183,7 @@ row_ins_sec_index_entry( /*====================*/ dict_index_t* index, /*!< in: secondary index */ dtuple_t* entry, /*!< in/out: index entry to insert */ - que_thr_t* thr, /*!< in: query thread */ - bool dup_chk_only) - /*!< in: if true, just do duplicate check - and return. don't execute actual insert. */ + que_thr_t* thr) /*!< in: query thread */ { dberr_t err; mem_heap_t* offsets_heap; @@ -3248,7 +3226,7 @@ row_ins_sec_index_entry( err = row_ins_sec_index_entry_low( flags, BTR_MODIFY_LEAF, index, offsets_heap, heap, entry, - trx_id, thr, dup_chk_only); + trx_id, thr); if (err == DB_FAIL) { mem_heap_empty(heap); @@ -3262,8 +3240,7 @@ row_ins_sec_index_entry( err = row_ins_sec_index_entry_low( flags, BTR_MODIFY_TREE, index, - offsets_heap, heap, entry, 0, thr, - dup_chk_only); + offsets_heap, heap, entry, 0, thr); } mem_heap_free(heap); @@ -3292,9 +3269,9 @@ row_ins_index_entry( return(DB_LOCK_WAIT);}); if (dict_index_is_clust(index)) { - return(row_ins_clust_index_entry(index, entry, thr, 0, false)); + return(row_ins_clust_index_entry(index, entry, thr, 0)); } else { - return(row_ins_sec_index_entry(index, entry, thr, false)); + return(row_ins_sec_index_entry(index, entry, thr)); } } diff --git a/storage/innobase/row/row0log.cc b/storage/innobase/row/row0log.cc index 3924a07fb0f..6da08872a9a 100644 --- a/storage/innobase/row/row0log.cc +++ b/storage/innobase/row/row0log.cc @@ -1524,7 +1524,7 @@ row_log_table_apply_insert_low( error = row_ins_clust_index_entry_low( flags, BTR_MODIFY_TREE, index, index->n_uniq, - entry, 0, thr, false); + entry, 0, thr); switch (error) { case DB_SUCCESS: @@ -1547,8 +1547,7 @@ row_log_table_apply_insert_low( entry = row_build_index_entry(row, NULL, index, heap); error = row_ins_sec_index_entry_low( flags, BTR_MODIFY_TREE, - index, offsets_heap, heap, entry, trx_id, thr, - false); + index, offsets_heap, heap, entry, trx_id, thr); if (error != DB_SUCCESS) { if (error == DB_DUPLICATE_KEY) { @@ -2178,7 +2177,7 @@ func_exit_committed: BTR_CREATE_FLAG | BTR_NO_LOCKING_FLAG | BTR_NO_UNDO_LOG_FLAG | BTR_KEEP_SYS_FLAG, BTR_MODIFY_TREE, index, offsets_heap, heap, - entry, trx_id, thr, false); + entry, trx_id, thr); /* Report correct index name for duplicate key error. */ if (error == DB_DUPLICATE_KEY) { diff --git a/storage/innobase/row/row0upd.cc b/storage/innobase/row/row0upd.cc index 0f69289eaab..021e3d69f8a 100644 --- a/storage/innobase/row/row0upd.cc +++ b/storage/innobase/row/row0upd.cc @@ -2524,7 +2524,7 @@ row_upd_sec_index_entry( ut_a(entry); /* Insert new index entry */ - err = row_ins_sec_index_entry(index, entry, thr, false); + err = row_ins_sec_index_entry(index, entry, thr); func_exit: mem_heap_free(heap); @@ -2795,7 +2795,7 @@ check_fk: err = row_ins_clust_index_entry( index, entry, thr, - node->upd_ext ? node->upd_ext->n_ext : 0, false); + node->upd_ext ? node->upd_ext->n_ext : 0); node->state = UPD_NODE_INSERT_CLUSTERED; mem_heap_free(heap); |