diff options
author | Vicențiu Ciorbaru <vicentiu@mariadb.org> | 2017-12-22 12:23:39 +0200 |
---|---|---|
committer | Vicențiu Ciorbaru <vicentiu@mariadb.org> | 2017-12-22 12:23:39 +0200 |
commit | 985d2d393c285ecd4539cb579b680f7b91fdaa1a (patch) | |
tree | 8cabf6c09758c30df04de96ca98c7827d5665493 /storage | |
parent | a76a2522ec4f8c069827e038997387a8b8eb3a3a (diff) | |
parent | 461cf3e5a3c2d346d75b1407b285f8daf9d01f67 (diff) | |
download | mariadb-git-985d2d393c285ecd4539cb579b680f7b91fdaa1a.tar.gz |
Merge remote-tracking branch 'origin/10.1' into 10.2
Diffstat (limited to 'storage')
-rw-r--r-- | storage/innobase/include/trx0rec.h | 6 | ||||
-rw-r--r-- | storage/innobase/include/trx0sys.ic | 2 | ||||
-rw-r--r-- | storage/innobase/row/row0log.cc | 33 | ||||
-rw-r--r-- | storage/innobase/trx/trx0rec.cc | 6 | ||||
-rw-r--r-- | storage/innobase/trx/trx0sys.cc | 2 | ||||
-rw-r--r-- | storage/xtradb/fil/fil0fil.cc | 3 | ||||
-rw-r--r-- | storage/xtradb/include/trx0rec.h | 6 | ||||
-rw-r--r-- | storage/xtradb/include/trx0sys.ic | 3 | ||||
-rw-r--r-- | storage/xtradb/row/row0log.cc | 33 | ||||
-rw-r--r-- | storage/xtradb/trx/trx0rec.cc | 6 | ||||
-rw-r--r-- | storage/xtradb/trx/trx0sys.cc | 5 |
11 files changed, 40 insertions, 65 deletions
diff --git a/storage/innobase/include/trx0rec.h b/storage/innobase/include/trx0rec.h index f2c30a20f7f..b57fdbe1e37 100644 --- a/storage/innobase/include/trx0rec.h +++ b/storage/innobase/include/trx0rec.h @@ -204,10 +204,8 @@ trx_undo_report_row_operation( marking, the record in the clustered index; NULL if insert */ const ulint* offsets, /*!< in: rec_get_offsets(rec) */ - roll_ptr_t* roll_ptr) /*!< out: rollback pointer to the - inserted undo log record, - 0 if BTR_NO_UNDO_LOG - flag was specified */ + roll_ptr_t* roll_ptr) /*!< out: DB_ROLL_PTR to the + undo log record */ MY_ATTRIBUTE((nonnull(1,2,8), warn_unused_result)); /** status bit used for trx_undo_prev_version_build() */ diff --git a/storage/innobase/include/trx0sys.ic b/storage/innobase/include/trx0sys.ic index 1c805ead4b3..af6fb63d9b4 100644 --- a/storage/innobase/include/trx0sys.ic +++ b/storage/innobase/include/trx0sys.ic @@ -383,10 +383,8 @@ trx_id_t trx_sys_get_new_trx_id() /*====================*/ { -#ifndef WITH_WSREP /* wsrep_fake_trx_id violates this assert */ ut_ad(trx_sys_mutex_own()); -#endif /* WITH_WSREP */ /* VERY important: after the database is started, max_trx_id value is divisible by TRX_SYS_TRX_ID_WRITE_MARGIN, and the following if diff --git a/storage/innobase/row/row0log.cc b/storage/innobase/row/row0log.cc index 6c15331f232..4dfc25e7779 100644 --- a/storage/innobase/row/row0log.cc +++ b/storage/innobase/row/row0log.cc @@ -1588,13 +1588,10 @@ row_log_table_apply_insert_low( return(error); } - do { - n_index++; - - if (!(index = dict_table_get_next_index(index))) { - break; - } + ut_ad(dict_index_is_clust(index)); + for (n_index += index->type != DICT_CLUSTERED; + (index = dict_table_get_next_index(index)); n_index++) { if (index->type & DICT_FTS) { continue; } @@ -1605,12 +1602,13 @@ row_log_table_apply_insert_low( index, offsets_heap, heap, entry, trx_id, thr, false); - /* Report correct index name for duplicate key error. */ - if (error == DB_DUPLICATE_KEY) { - thr_get_trx(thr)->error_key_num = n_index; + if (error != DB_SUCCESS) { + if (error == DB_DUPLICATE_KEY) { + thr_get_trx(thr)->error_key_num = n_index; + } + break; } - - } while (error == DB_SUCCESS); + } return(error); } @@ -2190,17 +2188,16 @@ func_exit_committed: dtuple_big_rec_free(big_rec); } - while ((index = dict_table_get_next_index(index)) != NULL) { - if (error != DB_SUCCESS) { - break; - } - - n_index++; - + for (n_index += index->type != DICT_CLUSTERED; + (index = dict_table_get_next_index(index)); n_index++) { if (index->type & DICT_FTS) { continue; } + if (error != DB_SUCCESS) { + break; + } + if (!row_upd_changes_ord_field_binary( index, update, thr, old_row, NULL)) { continue; diff --git a/storage/innobase/trx/trx0rec.cc b/storage/innobase/trx/trx0rec.cc index 6ed554c1810..389d28a5fc8 100644 --- a/storage/innobase/trx/trx0rec.cc +++ b/storage/innobase/trx/trx0rec.cc @@ -1880,10 +1880,8 @@ trx_undo_report_row_operation( marking, the record in the clustered index; NULL if insert */ const ulint* offsets, /*!< in: rec_get_offsets(rec) */ - roll_ptr_t* roll_ptr) /*!< out: rollback pointer to the - inserted undo log record, - 0 if BTR_NO_UNDO_LOG - flag was specified */ + roll_ptr_t* roll_ptr) /*!< out: DB_ROLL_PTR to the + undo log record */ { trx_t* trx; ulint page_no; diff --git a/storage/innobase/trx/trx0sys.cc b/storage/innobase/trx/trx0sys.cc index 1a7b9ef2905..3a798a504fc 100644 --- a/storage/innobase/trx/trx0sys.cc +++ b/storage/innobase/trx/trx0sys.cc @@ -146,12 +146,10 @@ trx_sys_flush_max_trx_id(void) mtr_t mtr; trx_sysf_t* sys_header; -#ifndef WITH_WSREP /* wsrep_fake_trx_id violates this assert Copied from trx_sys_get_new_trx_id */ ut_ad(trx_sys_mutex_own()); -#endif /* WITH_WSREP */ if (!srv_read_only_mode) { mtr_start(&mtr); diff --git a/storage/xtradb/fil/fil0fil.cc b/storage/xtradb/fil/fil0fil.cc index 445c564e9cf..2ca605f15d0 100644 --- a/storage/xtradb/fil/fil0fil.cc +++ b/storage/xtradb/fil/fil0fil.cc @@ -2136,7 +2136,8 @@ fil_write_flushed_lsn( /* If tablespace is not encrypted, stamp flush_lsn to first page of all system tablespace datafiles to avoid unnecessary error messages on possible downgrade. */ - if (!space->crypt_data || space->crypt_data->min_key_version == 0) { + if (!space->crypt_data + || !space->crypt_data->should_encrypt()) { fil_node_t* node; ulint sum_of_sizes = 0; diff --git a/storage/xtradb/include/trx0rec.h b/storage/xtradb/include/trx0rec.h index a6e202d04e4..630818a8648 100644 --- a/storage/xtradb/include/trx0rec.h +++ b/storage/xtradb/include/trx0rec.h @@ -226,10 +226,8 @@ trx_undo_report_row_operation( marking, the record in the clustered index, otherwise NULL */ const ulint* offsets, /*!< in: rec_get_offsets(rec) */ - roll_ptr_t* roll_ptr) /*!< out: rollback pointer to the - inserted undo log record, - 0 if BTR_NO_UNDO_LOG - flag was specified */ + roll_ptr_t* roll_ptr) /*!< out: DB_ROLL_PTR to the + undo log record */ MY_ATTRIBUTE((nonnull(1,2,8), warn_unused_result)); /******************************************************************//** Copies an undo record to heap. This function can be called if we know that diff --git a/storage/xtradb/include/trx0sys.ic b/storage/xtradb/include/trx0sys.ic index 6024c1dc94e..699148cff6d 100644 --- a/storage/xtradb/include/trx0sys.ic +++ b/storage/xtradb/include/trx0sys.ic @@ -474,10 +474,7 @@ trx_id_t trx_sys_get_new_trx_id(void) /*========================*/ { -#ifndef WITH_WSREP - /* wsrep_fake_trx_id violates this assert */ ut_ad(mutex_own(&trx_sys->mutex)); -#endif /* WITH_WSREP */ /* VERY important: after the database is started, max_trx_id value is divisible by TRX_SYS_TRX_ID_WRITE_MARGIN, and the following if diff --git a/storage/xtradb/row/row0log.cc b/storage/xtradb/row/row0log.cc index e15a4f4f5d8..82fde841f39 100644 --- a/storage/xtradb/row/row0log.cc +++ b/storage/xtradb/row/row0log.cc @@ -1573,13 +1573,10 @@ row_log_table_apply_insert_low( return(error); } - do { - n_index++; - - if (!(index = dict_table_get_next_index(index))) { - break; - } + ut_ad(dict_index_is_clust(index)); + for (n_index += index->type != DICT_CLUSTERED; + (index = dict_table_get_next_index(index)); n_index++) { if (index->type & DICT_FTS) { continue; } @@ -1589,12 +1586,13 @@ row_log_table_apply_insert_low( flags, BTR_MODIFY_TREE, index, offsets_heap, heap, entry, trx_id, thr); - /* Report correct index name for duplicate key error. */ - if (error == DB_DUPLICATE_KEY) { - thr_get_trx(thr)->error_key_num = n_index; + if (error != DB_SUCCESS) { + if (error == DB_DUPLICATE_KEY) { + thr_get_trx(thr)->error_key_num = n_index; + } + break; } - - } while (error == DB_SUCCESS); + } return(error); } @@ -2173,17 +2171,16 @@ func_exit_committed: dtuple_big_rec_free(big_rec); } - while ((index = dict_table_get_next_index(index)) != NULL) { - if (error != DB_SUCCESS) { - break; - } - - n_index++; - + for (n_index += index->type != DICT_CLUSTERED; + (index = dict_table_get_next_index(index)); n_index++) { if (index->type & DICT_FTS) { continue; } + if (error != DB_SUCCESS) { + break; + } + if (!row_upd_changes_ord_field_binary( index, update, thr, old_row, NULL)) { continue; diff --git a/storage/xtradb/trx/trx0rec.cc b/storage/xtradb/trx/trx0rec.cc index 4e0ba825ed2..8cd51c8066b 100644 --- a/storage/xtradb/trx/trx0rec.cc +++ b/storage/xtradb/trx/trx0rec.cc @@ -1221,10 +1221,8 @@ trx_undo_report_row_operation( marking, the record in the clustered index, otherwise NULL */ const ulint* offsets, /*!< in: rec_get_offsets(rec) */ - roll_ptr_t* roll_ptr) /*!< out: rollback pointer to the - inserted undo log record, - 0 if BTR_NO_UNDO_LOG - flag was specified */ + roll_ptr_t* roll_ptr) /*!< out: DB_ROLL_PTR to the + undo log record */ { trx_t* trx; trx_undo_t* undo; diff --git a/storage/xtradb/trx/trx0sys.cc b/storage/xtradb/trx/trx0sys.cc index 83bb28b3c07..6108ab7ab94 100644 --- a/storage/xtradb/trx/trx0sys.cc +++ b/storage/xtradb/trx/trx0sys.cc @@ -184,12 +184,7 @@ trx_sys_flush_max_trx_id(void) mtr_t mtr; trx_sysf_t* sys_header; -#ifndef WITH_WSREP - /* wsrep_fake_trx_id violates this assert - * Copied from trx_sys_get_new_trx_id - */ ut_ad(mutex_own(&trx_sys->mutex)); -#endif /* WITH_WSREP */ if (!srv_read_only_mode) { mtr_start(&mtr); |