diff options
Diffstat (limited to 'storage/xtradb/row')
-rw-r--r-- | storage/xtradb/row/row0ext.cc | 3 | ||||
-rw-r--r-- | storage/xtradb/row/row0ftsort.cc | 22 | ||||
-rw-r--r-- | storage/xtradb/row/row0import.cc | 9 | ||||
-rw-r--r-- | storage/xtradb/row/row0ins.cc | 33 | ||||
-rw-r--r-- | storage/xtradb/row/row0log.cc | 16 | ||||
-rw-r--r-- | storage/xtradb/row/row0merge.cc | 25 | ||||
-rw-r--r-- | storage/xtradb/row/row0mysql.cc | 25 | ||||
-rw-r--r-- | storage/xtradb/row/row0quiesce.cc | 8 | ||||
-rw-r--r-- | storage/xtradb/row/row0row.cc | 9 | ||||
-rw-r--r-- | storage/xtradb/row/row0sel.cc | 31 | ||||
-rw-r--r-- | storage/xtradb/row/row0umod.cc | 14 | ||||
-rw-r--r-- | storage/xtradb/row/row0upd.cc | 15 |
12 files changed, 117 insertions, 93 deletions
diff --git a/storage/xtradb/row/row0ext.cc b/storage/xtradb/row/row0ext.cc index ad852577ad2..32b78391d6a 100644 --- a/storage/xtradb/row/row0ext.cc +++ b/storage/xtradb/row/row0ext.cc @@ -78,8 +78,7 @@ row_ext_cache_fill( crashed during the execution of btr_free_externally_stored_field(). */ ext->len[i] = btr_copy_externally_stored_field_prefix( - buf, ext->max_len, zip_size, field, f_len, - NULL); + buf, ext->max_len, zip_size, field, f_len); } } } diff --git a/storage/xtradb/row/row0ftsort.cc b/storage/xtradb/row/row0ftsort.cc index 0f9c15f6a69..bd57685b71c 100644 --- a/storage/xtradb/row/row0ftsort.cc +++ b/storage/xtradb/row/row0ftsort.cc @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 2010, 2016, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2015, 2017, MariaDB Corporation. +Copyright (c) 2015, 2018, 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 @@ -106,8 +106,9 @@ row_merge_create_fts_sort_index( field->col->prtype = idx_field->col->prtype | DATA_NOT_NULL; field->col->mtype = charset == &my_charset_latin1 ? DATA_VARCHAR : DATA_VARMYSQL; - field->col->mbminmaxlen = idx_field->col->mbminmaxlen; - field->col->len = HA_FT_MAXCHARLEN * DATA_MBMAXLEN(field->col->mbminmaxlen); + field->col->mbminlen = idx_field->col->mbminlen; + field->col->mbmaxlen = idx_field->col->mbmaxlen; + field->col->len = HA_FT_MAXCHARLEN * field->col->mbmaxlen; field->fixed_len = 0; @@ -150,7 +151,8 @@ row_merge_create_fts_sort_index( field->col->prtype = DATA_NOT_NULL | DATA_BINARY_TYPE; - field->col->mbminmaxlen = 0; + field->col->mbminlen = 0; + field->col->mbmaxlen = 0; /* The third field is on the word's position in the original doc */ field = dict_index_get_nth_field(new_index, 2); @@ -162,7 +164,8 @@ row_merge_create_fts_sort_index( field->col->len = 4 ; field->fixed_len = 4; field->col->prtype = DATA_NOT_NULL; - field->col->mbminmaxlen = 0; + field->col->mbminlen = 0; + field->col->mbmaxlen = 0; return(new_index); } @@ -540,7 +543,8 @@ row_merge_fts_doc_tokenize( field->type.mtype = DATA_INT; field->type.prtype = DATA_NOT_NULL | DATA_BINARY_TYPE; field->type.len = len; - field->type.mbminmaxlen = 0; + field->type.mbminlen = 0; + field->type.mbmaxlen = 0; cur_len += len; dfield_dup(field, buf->heap); @@ -559,7 +563,8 @@ row_merge_fts_doc_tokenize( field->type.mtype = DATA_INT; field->type.prtype = DATA_NOT_NULL; field->type.len = len; - field->type.mbminmaxlen = 0; + field->type.mbminlen = 0; + field->type.mbmaxlen = 0; cur_len += len; dfield_dup(field, buf->heap); @@ -709,8 +714,7 @@ loop: doc.text.f_str = btr_copy_externally_stored_field( &doc.text.f_len, data, - zip_size, data_len, blob_heap, - NULL); + zip_size, data_len, blob_heap); } else { doc.text.f_str = data; doc.text.f_len = data_len; diff --git a/storage/xtradb/row/row0import.cc b/storage/xtradb/row/row0import.cc index 3efc2a30037..f0035302852 100644 --- a/storage/xtradb/row/row0import.cc +++ b/storage/xtradb/row/row0import.cc @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 2012, 2016, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2015, 2017, MariaDB Corporation. +Copyright (c) 2015, 2018, 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 @@ -1259,7 +1259,8 @@ row_import::match_table_columns( err = DB_ERROR; } - if (cfg_col->mbminmaxlen != col->mbminmaxlen) { + if (cfg_col->mbminlen != col->mbminlen + || cfg_col->mbmaxlen != col->mbmaxlen) { ib_errf(thd, IB_LOG_LEVEL_ERROR, ER_TABLE_SCHEMA_MISMATCH, @@ -2877,7 +2878,9 @@ row_import_read_columns( col->len = mach_read_from_4(ptr); ptr += sizeof(ib_uint32_t); - col->mbminmaxlen = mach_read_from_4(ptr); + ulint mbminmaxlen = mach_read_from_4(ptr); + col->mbmaxlen = mbminmaxlen / 5; + col->mbminlen = mbminmaxlen % 5; ptr += sizeof(ib_uint32_t); col->ind = mach_read_from_4(ptr); diff --git a/storage/xtradb/row/row0ins.cc b/storage/xtradb/row/row0ins.cc index f653a4df77d..472be8ad848 100644 --- a/storage/xtradb/row/row0ins.cc +++ b/storage/xtradb/row/row0ins.cc @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2017, MariaDB Corporation. +Copyright (c) 2017, 2018, 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 @@ -571,7 +571,8 @@ row_ins_cascade_calc_update_vec( if (!dfield_is_null(&ufield->new_val) && dtype_get_at_most_n_mbchars( - col->prtype, col->mbminmaxlen, + col->prtype, + col->mbminlen, col->mbmaxlen, col->len, ufield_len, static_cast<char*>( @@ -1330,7 +1331,7 @@ row_ins_foreign_check_on_constraint( row_mysql_freeze_data_dictionary(thr_get_trx(thr)); - mtr_start_trx(mtr, trx); + mtr_start(mtr); /* Restore pcur position */ @@ -1358,7 +1359,7 @@ nonstandard_exit_func: btr_pcur_store_position(pcur, mtr); mtr_commit(mtr); - mtr_start_trx(mtr, trx); + mtr_start(mtr); btr_pcur_restore_position(BTR_SEARCH_LEAF, pcur, mtr); @@ -1571,7 +1572,7 @@ run_again: } } - mtr_start_trx(&mtr, trx); + mtr_start(&mtr); /* Store old value on n_fields_cmp */ @@ -2390,7 +2391,7 @@ row_ins_clust_index_entry_low( search_mode = mode; } - mtr_start_trx(&mtr, thr_get_trx(thr)); + mtr_start(&mtr); if (mode == BTR_MODIFY_LEAF && dict_index_is_online_ddl(index)) { @@ -2628,10 +2629,9 @@ Starts a mini-transaction and checks if the index will be dropped. @return true if the index is to be dropped */ static MY_ATTRIBUTE((nonnull, warn_unused_result)) bool -row_ins_sec_mtr_start_trx_and_check_if_aborted( +row_ins_sec_mtr_start_and_check_if_aborted( /*=======================================*/ mtr_t* mtr, /*!< out: mini-transaction */ - trx_t* trx, /*!< in: transaction handle */ dict_index_t* index, /*!< in/out: secondary index */ bool check, /*!< in: whether to check */ ulint search_mode) @@ -2639,7 +2639,7 @@ row_ins_sec_mtr_start_trx_and_check_if_aborted( { ut_ad(!dict_index_is_clust(index)); - mtr_start_trx(mtr, trx); + mtr_start(mtr); if (!check) { return(false); @@ -2697,14 +2697,13 @@ row_ins_sec_index_entry_low( ulint n_unique; mtr_t mtr; ulint* offsets = NULL; - trx_t* trx = thr_get_trx(thr); ut_ad(!dict_index_is_clust(index)); ut_ad(mode == BTR_MODIFY_LEAF || mode == BTR_MODIFY_TREE); cursor.thr = thr; ut_ad(thr_get_trx(thr)->id); - mtr_start_trx(&mtr, trx); + mtr_start(&mtr); /* If running with fake_changes mode on then avoid using insert buffer and also switch from modify to search so that code takes only s-latch @@ -2766,7 +2765,7 @@ row_ins_sec_index_entry_low( if (err != DB_SUCCESS) { if (err == DB_DECRYPTION_FAILED) { - ib_push_warning(trx->mysql_thd, + ib_push_warning(thr_get_trx(thr)->mysql_thd, DB_DECRYPTION_FAILED, "Table %s is encrypted but encryption service or" " used key_id is not available. " @@ -2802,8 +2801,8 @@ row_ins_sec_index_entry_low( DEBUG_SYNC_C("row_ins_sec_index_unique"); - if (row_ins_sec_mtr_start_trx_and_check_if_aborted( - &mtr, trx, index, check, search_mode)) { + if (row_ins_sec_mtr_start_and_check_if_aborted( + &mtr, index, check, search_mode)) { goto func_exit; } @@ -2837,8 +2836,8 @@ row_ins_sec_index_entry_low( return(err); } - if (row_ins_sec_mtr_start_trx_and_check_if_aborted( - &mtr, trx, index, check, search_mode)) { + if (row_ins_sec_mtr_start_and_check_if_aborted( + &mtr, index, check, search_mode)) { goto func_exit; } @@ -3147,7 +3146,7 @@ row_ins_index_entry_set_vals( = dict_field_get_col(ind_field); len = dtype_get_at_most_n_mbchars( - col->prtype, col->mbminmaxlen, + col->prtype, col->mbminlen, col->mbmaxlen, ind_field->prefix_len, len, static_cast<const char*>( diff --git a/storage/xtradb/row/row0log.cc b/storage/xtradb/row/row0log.cc index 82fde841f39..040fb37ee30 100644 --- a/storage/xtradb/row/row0log.cc +++ b/storage/xtradb/row/row0log.cc @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 2011, 2016, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2017, MariaDB Corporation. +Copyright (c) 2017, 2018, 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 @@ -1064,7 +1064,7 @@ row_log_table_get_pk_col( mem_heap_alloc(heap, field_len)); len = btr_copy_externally_stored_field_prefix( - blob_field, field_len, zip_size, field, len, NULL); + blob_field, field_len, zip_size, field, len); if (len >= max_len + 1) { return(DB_TOO_BIG_INDEX_COL); } @@ -1183,7 +1183,7 @@ row_log_table_get_pk( dict_field_t* ifield; dfield_t* dfield; ulint prtype; - ulint mbminmaxlen; + ulint mbminlen, mbmaxlen; ifield = dict_index_get_nth_field(new_index, new_i); dfield = dtuple_get_nth_field(tuple, new_i); @@ -1212,7 +1212,8 @@ err_exit: goto func_exit; } - mbminmaxlen = col->mbminmaxlen; + mbminlen = col->mbminlen; + mbmaxlen = col->mbmaxlen; prtype = col->prtype; } else { /* No matching column was found in the old @@ -1222,7 +1223,8 @@ err_exit: dfield_copy(dfield, dtuple_get_nth_field( log->add_cols, col_no)); - mbminmaxlen = dfield->type.mbminmaxlen; + mbminlen = dfield->type.mbminlen; + mbmaxlen = dfield->type.mbmaxlen; prtype = dfield->type.prtype; } @@ -1231,7 +1233,7 @@ err_exit: if (ifield->prefix_len) { ulint len = dtype_get_at_most_n_mbchars( - prtype, mbminmaxlen, + prtype, mbminlen, mbmaxlen, ifield->prefix_len, dfield_get_len(dfield), static_cast<const char*>( @@ -1455,7 +1457,7 @@ row_log_table_apply_convert_mrec( data = btr_rec_copy_externally_stored_field( mrec, offsets, dict_table_zip_size(index->table), - i, &len, heap, NULL); + i, &len, heap); ut_a(data); dfield_set_data(dfield, data, len); blob_done: diff --git a/storage/xtradb/row/row0merge.cc b/storage/xtradb/row/row0merge.cc index cbcc3cc62f3..d9585818577 100644 --- a/storage/xtradb/row/row0merge.cc +++ b/storage/xtradb/row/row0merge.cc @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 2005, 2017, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2014, 2017, MariaDB Corporation. +Copyright (c) 2014, 2018, 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 @@ -268,8 +268,8 @@ row_merge_buf_redundant_convert( mem_heap_t* heap, trx_t* trx) { - ut_ad(DATA_MBMINLEN(field->type.mbminmaxlen) == 1); - ut_ad(DATA_MBMAXLEN(field->type.mbminmaxlen) > 1); + ut_ad(field->type.mbminlen == 1); + ut_ad(field->type.mbmaxlen > 1); byte* buf = (byte*) mem_heap_alloc(heap, len); ulint field_len = row_field->len; @@ -285,7 +285,7 @@ row_merge_buf_redundant_convert( field_ref_zero, BTR_EXTERN_FIELD_REF_SIZE)); byte* data = btr_copy_externally_stored_field( - &ext_len, field_data, zip_size, field_len, heap, trx); + &ext_len, field_data, zip_size, field_len, heap); ut_ad(ext_len < len); @@ -396,7 +396,8 @@ row_merge_buf_add( field->type.mtype = ifield->col->mtype; field->type.prtype = ifield->col->prtype; - field->type.mbminmaxlen = DATA_MBMINMAXLEN(0, 0); + field->type.mbminlen = 0; + field->type.mbmaxlen = 0; field->type.len = ifield->col->len; } else { row_field = dtuple_get_nth_field(row, col_no); @@ -531,7 +532,7 @@ row_merge_buf_add( if (ifield->prefix_len) { len = dtype_get_at_most_n_mbchars( col->prtype, - col->mbminmaxlen, + col->mbminlen, col->mbmaxlen, ifield->prefix_len, len, static_cast<char*>(dfield_get_data(field))); @@ -546,8 +547,7 @@ row_merge_buf_add( fixed_len = ifield->fixed_len; if (fixed_len && !dict_table_is_comp(index->table) - && DATA_MBMINLEN(col->mbminmaxlen) - != DATA_MBMAXLEN(col->mbminmaxlen)) { + && col->mbminlen != col->mbmaxlen) { /* CHAR in ROW_FORMAT=REDUNDANT is always fixed-length, but in the temporary file it is variable-length for variable-length character @@ -557,14 +557,11 @@ row_merge_buf_add( if (fixed_len) { #ifdef UNIV_DEBUG - ulint mbminlen = DATA_MBMINLEN(col->mbminmaxlen); - ulint mbmaxlen = DATA_MBMAXLEN(col->mbminmaxlen); - /* len should be between size calcualted base on mbmaxlen and mbminlen */ ut_ad(len <= fixed_len); - ut_ad(!mbmaxlen || len >= mbminlen - * (fixed_len / mbmaxlen)); + ut_ad(!col->mbmaxlen || len >= col->mbminlen + * (fixed_len / col->mbmaxlen)); ut_ad(!dfield_is_ext(field)); #endif /* UNIV_DEBUG */ @@ -2626,7 +2623,7 @@ row_merge_copy_blobs( BLOB pointers are read (row_merge_read_clustered_index()) and dereferenced (below). */ data = btr_rec_copy_externally_stored_field( - mrec, offsets, zip_size, i, &len, heap, NULL); + mrec, offsets, zip_size, i, &len, heap); /* Because we have locked the table, any records written by incomplete transactions must have been rolled back already. There must not be any incomplete diff --git a/storage/xtradb/row/row0mysql.cc b/storage/xtradb/row/row0mysql.cc index 43f4d4bcdd3..0c1af1c0f14 100644 --- a/storage/xtradb/row/row0mysql.cc +++ b/storage/xtradb/row/row0mysql.cc @@ -1,7 +1,7 @@ /***************************************************************************** -Copyright (c) 2000, 2016, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2015, 2017, MariaDB Corporation. +Copyright (c) 2000, 2017, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2015, 2018, 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 @@ -59,6 +59,7 @@ Created 9/17/2000 Heikki Tuuri #include "btr0defragment.h" #include "fil0fil.h" #include "fil0crypt.h" +#include "srv0srv.h" #include "ibuf0ibuf.h" #include "fts0fts.h" #include "fts0types.h" @@ -1998,7 +1999,7 @@ row_unlock_for_mysql( trx_id_t rec_trx_id; mtr_t mtr; - mtr_start_trx(&mtr, trx); + mtr_start(&mtr); /* Restore the cursor position and find the record */ @@ -2888,7 +2889,7 @@ func_exit: /*********************************************************************//** Reassigns the table identifier of a table. @return error code or DB_SUCCESS */ -UNIV_INTERN +static dberr_t row_mysql_table_id_reassign( /*========================*/ @@ -3585,7 +3586,7 @@ row_truncate_table_for_mysql( index = dict_table_get_next_index(index); } while (index); - mtr_start_trx(&mtr, trx); + mtr_start(&mtr); fsp_header_init(space_id, FIL_IBD_FILE_INITIAL_SIZE, &mtr); mtr_commit(&mtr); @@ -3614,7 +3615,7 @@ row_truncate_table_for_mysql( sys_index = dict_table_get_first_index(dict_sys->sys_indexes); dict_index_copy_types(tuple, sys_index, 1); - mtr_start_trx(&mtr, trx); + mtr_start(&mtr); btr_pcur_open_on_user_rec(sys_index, tuple, PAGE_CUR_GE, BTR_MODIFY_LEAF, &pcur, &mtr); for (;;) { @@ -3661,7 +3662,7 @@ row_truncate_table_for_mysql( a page in this mini-transaction, and the rest of this loop could latch another index page. */ mtr_commit(&mtr); - mtr_start_trx(&mtr, trx); + mtr_start(&mtr); btr_pcur_restore_position(BTR_MODIFY_LEAF, &pcur, &mtr); } @@ -4003,6 +4004,16 @@ row_drop_table_for_mysql( ut_ad(!table->fts->add_wq); ut_ad(lock_trx_has_sys_table_locks(trx) == 0); + for (;;) { + bool retry = false; + if (dict_fts_index_syncing(table)) { + retry = true; + } + if (!retry) { + break; + } + DICT_BG_YIELD(trx); + } row_mysql_unlock_data_dictionary(trx); fts_optimize_remove_table(table); row_mysql_lock_data_dictionary(trx); diff --git a/storage/xtradb/row/row0quiesce.cc b/storage/xtradb/row/row0quiesce.cc index 6c4e6adb96c..53b4040f74e 100644 --- a/storage/xtradb/row/row0quiesce.cc +++ b/storage/xtradb/row/row0quiesce.cc @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 2012, 2016, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2017, MariaDB Corporation. +Copyright (c) 2017, 2018, 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 @@ -237,7 +237,11 @@ row_quiesce_write_table( mach_write_to_4(ptr, col->len); ptr += sizeof(ib_uint32_t); - mach_write_to_4(ptr, col->mbminmaxlen); + /* FIXME: This will not work if mbminlen>4. + This field is also redundant, because the lengths + are a property of the character set encoding, which + in turn is encodedin prtype above. */ + mach_write_to_4(ptr, col->mbmaxlen * 5 + col->mbminlen); ptr += sizeof(ib_uint32_t); mach_write_to_4(ptr, col->ind); diff --git a/storage/xtradb/row/row0row.cc b/storage/xtradb/row/row0row.cc index 96d25e15777..9bf9e7182ca 100644 --- a/storage/xtradb/row/row0row.cc +++ b/storage/xtradb/row/row0row.cc @@ -1,6 +1,7 @@ /***************************************************************************** Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2018, 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 @@ -173,7 +174,7 @@ row_build_index_entry_low( /* If a column prefix index, take only the prefix. */ if (ind_field->prefix_len) { len = dtype_get_at_most_n_mbchars( - col->prtype, col->mbminmaxlen, + col->prtype, col->mbminlen, col->mbmaxlen, ind_field->prefix_len, len, static_cast<char*>(dfield_get_data(dfield))); dfield_set_len(dfield, len); @@ -588,7 +589,8 @@ row_build_row_ref( dfield_set_len(dfield, dtype_get_at_most_n_mbchars( dtype->prtype, - dtype->mbminmaxlen, + dtype->mbminlen, + dtype->mbmaxlen, clust_col_prefix_len, len, (char*) field)); } @@ -702,7 +704,8 @@ notfound: dfield_set_len(dfield, dtype_get_at_most_n_mbchars( dtype->prtype, - dtype->mbminmaxlen, + dtype->mbminlen, + dtype->mbmaxlen, clust_col_prefix_len, len, (char*) field)); } diff --git a/storage/xtradb/row/row0sel.cc b/storage/xtradb/row/row0sel.cc index 6131129d0a6..03ae6822fb7 100644 --- a/storage/xtradb/row/row0sel.cc +++ b/storage/xtradb/row/row0sel.cc @@ -2,7 +2,7 @@ Copyright (c) 1997, 2017, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2008, Google Inc. -Copyright (c) 2015, 2017, MariaDB Corporation. +Copyright (c) 2015, 2018, MariaDB Corporation. Portions of this file contain modifications contributed and copyrighted by Google, Inc. Those modifications are gratefully acknowledged and are described @@ -98,8 +98,10 @@ row_sel_sec_rec_is_for_blob( /*========================*/ ulint mtype, /*!< in: main type */ ulint prtype, /*!< in: precise type */ - ulint mbminmaxlen, /*!< in: minimum and maximum length of - a multi-byte character */ + ulint mbminlen, /*!< in: minimum length of + a character, in bytes */ + ulint mbmaxlen, /*!< in: maximum length of + a character, in bytes */ const byte* clust_field, /*!< in: the locally stored part of the clustered index column, including the BLOB pointer; the clustered @@ -138,8 +140,7 @@ row_sel_sec_rec_is_for_blob( len = btr_copy_externally_stored_field_prefix(buf, prefix_len, zip_size, - clust_field, clust_len, - NULL); + clust_field, clust_len); if (UNIV_UNLIKELY(len == 0)) { /* The BLOB was being deleted as the server crashed. @@ -150,7 +151,7 @@ row_sel_sec_rec_is_for_blob( return(FALSE); } - len = dtype_get_at_most_n_mbchars(prtype, mbminmaxlen, + len = dtype_get_at_most_n_mbchars(prtype, mbminlen, mbmaxlen, prefix_len, len, (const char*) buf); return(!cmp_data_data(mtype, prtype, buf, len, sec_field, sec_len)); @@ -234,14 +235,14 @@ row_sel_sec_rec_is_for_clust_rec( } len = dtype_get_at_most_n_mbchars( - col->prtype, col->mbminmaxlen, + col->prtype, col->mbminlen, col->mbmaxlen, ifield->prefix_len, len, (char*) clust_field); if (rec_offs_nth_extern(clust_offs, clust_pos) && len < sec_len) { if (!row_sel_sec_rec_is_for_blob( col->mtype, col->prtype, - col->mbminmaxlen, + col->mbminlen, col->mbmaxlen, clust_field, clust_len, sec_field, sec_len, ifield->prefix_len, @@ -458,7 +459,7 @@ row_sel_fetch_columns( data = btr_rec_copy_externally_stored_field( rec, offsets, dict_table_zip_size(index->table), - field_no, &len, heap, NULL); + field_no, &len, heap); /* data == NULL means that the externally stored field was not @@ -1406,7 +1407,7 @@ table_loop: /* Open a cursor to index, or restore an open cursor position */ - mtr_start_trx(&mtr, thr_get_trx(thr)); + mtr_start(&mtr); if (consistent_read && plan->unique_search && !plan->pcur_is_open && !plan->must_get_clust @@ -1447,7 +1448,7 @@ table_loop: plan_reset_cursor(plan); mtr_commit(&mtr); - mtr_start_trx(&mtr, thr_get_trx(thr)); + mtr_start(&mtr); } if (search_latch_locked) { @@ -2828,7 +2829,7 @@ row_sel_store_mysql_field_func( data = btr_rec_copy_externally_stored_field( rec, offsets, dict_table_zip_size(prebuilt->table), - field_no, &len, heap, NULL); + field_no, &len, heap); if (UNIV_UNLIKELY(!data)) { /* The externally stored field was not written @@ -3933,7 +3934,7 @@ row_search_for_mysql( } } - mtr_start_trx(&mtr, trx); + mtr_start(&mtr); /*-------------------------------------------------------------*/ /* PHASE 2: Try fast adaptive hash index search if possible */ @@ -5159,7 +5160,7 @@ next_rec: mtr_commit(&mtr); mtr_has_extra_clust_latch = FALSE; - mtr_start_trx(&mtr, trx); + mtr_start(&mtr); if (sel_restore_position_for_mysql(&same_user_rec, BTR_SEARCH_LEAF, pcur, moves_up, &mtr)) { @@ -5226,7 +5227,7 @@ lock_table_wait: /* It was a lock wait, and it ended */ thr->lock_state = QUE_THR_LOCK_NOLOCK; - mtr_start_trx(&mtr, trx); + mtr_start(&mtr); /* Table lock waited, go try to obtain table lock again */ diff --git a/storage/xtradb/row/row0umod.cc b/storage/xtradb/row/row0umod.cc index 2e5cc14bfe1..bb2fc536616 100644 --- a/storage/xtradb/row/row0umod.cc +++ b/storage/xtradb/row/row0umod.cc @@ -269,7 +269,7 @@ row_undo_mod_clust( pcur = &node->pcur; index = btr_cur_get_index(btr_pcur_get_btr_cur(pcur)); - mtr_start_trx(&mtr, thr_get_trx(thr)); + mtr_start(&mtr); online = dict_index_is_online_ddl(index); if (online) { @@ -298,7 +298,7 @@ row_undo_mod_clust( /* We may have to modify tree structure: do a pessimistic descent down the index tree */ - mtr_start_trx(&mtr, thr_get_trx(thr)); + mtr_start(&mtr); err = row_undo_mod_clust_low( node, &offsets, &offsets_heap, @@ -350,7 +350,7 @@ row_undo_mod_clust( if (err == DB_SUCCESS && node->rec_type == TRX_UNDO_UPD_DEL_REC) { - mtr_start_trx(&mtr, thr_get_trx(thr)); + mtr_start(&mtr); /* It is not necessary to call row_log_table, because the record is delete-marked and would thus @@ -363,7 +363,7 @@ row_undo_mod_clust( /* We may have to modify tree structure: do a pessimistic descent down the index tree */ - mtr_start_trx(&mtr, thr_get_trx(thr)); + mtr_start(&mtr); err = row_undo_mod_remove_clust_low(node, thr, &mtr, BTR_MODIFY_TREE); @@ -410,7 +410,7 @@ row_undo_mod_del_mark_or_remove_sec_low( enum row_search_result search_result; log_free_check(); - mtr_start_trx(&mtr, thr_get_trx(thr)); + mtr_start(&mtr); if (mode == BTR_MODIFY_TREE && index->space == IBUF_SPACE_ID && !dict_index_is_unique(index)) { @@ -471,7 +471,7 @@ row_undo_mod_del_mark_or_remove_sec_low( which cannot be purged yet, requires its existence. If some requires, we should delete mark the record. */ - mtr_start_trx(&mtr_vers, thr_get_trx(thr)); + mtr_start(&mtr_vers); success = btr_pcur_restore_position(BTR_SEARCH_LEAF, &(node->pcur), &mtr_vers); @@ -587,7 +587,7 @@ row_undo_mod_del_unmark_sec_and_undo_update( ut_ad(trx->id); log_free_check(); - mtr_start_trx(&mtr, thr_get_trx(thr)); + mtr_start(&mtr); if (mode == BTR_MODIFY_TREE && index->space == IBUF_SPACE_ID && !dict_index_is_unique(index)) { diff --git a/storage/xtradb/row/row0upd.cc b/storage/xtradb/row/row0upd.cc index 113d2f10fc2..9ac72f8d068 100644 --- a/storage/xtradb/row/row0upd.cc +++ b/storage/xtradb/row/row0upd.cc @@ -1,6 +1,7 @@ /***************************************************************************** Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2018, 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 @@ -261,7 +262,7 @@ row_upd_check_references_constraints( DEBUG_SYNC_C("foreign_constraint_check_for_update"); - mtr_start_trx(mtr, trx); + mtr_start(mtr); if (trx->dict_operation_lock_mode == 0) { got_s_lock = TRUE; @@ -1155,7 +1156,7 @@ row_upd_ext_fetch( byte* buf = static_cast<byte*>(mem_heap_alloc(heap, *len)); *len = btr_copy_externally_stored_field_prefix( - buf, *len, zip_size, data, local_len, NULL); + buf, *len, zip_size, data, local_len); /* We should never update records containing a half-deleted BLOB. */ ut_a(*len); @@ -1207,7 +1208,7 @@ row_upd_index_replace_new_col_val( } len = dtype_get_at_most_n_mbchars(col->prtype, - col->mbminmaxlen, + col->mbminlen, col->mbmaxlen, field->prefix_len, len, (const char*) data); @@ -1855,7 +1856,7 @@ row_upd_sec_index_entry( } #endif /* UNIV_DEBUG */ - mtr_start_trx(&mtr, trx); + mtr_start(&mtr); if (*index->name == TEMP_INDEX_PREFIX) { /* The index->online_status may change if the @@ -2398,7 +2399,7 @@ row_upd_clust_rec( /* We may have to modify the tree structure: do a pessimistic descent down the index tree */ - mtr_start_trx(mtr, thr_get_trx(thr)); + mtr_start(mtr); /* NOTE: this transaction has an s-lock or x-lock on the record and therefore other transactions cannot modify the record when we have no @@ -2613,7 +2614,7 @@ row_upd_clust_step( /* We have to restore the cursor to its position */ - mtr_start_trx(&mtr, thr_get_trx(thr)); + mtr_start(&mtr); /* If the restoration does not succeed, then the same transaction has deleted the record on which the cursor was, @@ -2686,7 +2687,7 @@ row_upd_clust_step( mtr_commit(&mtr); - mtr_start_trx(&mtr, thr_get_trx(thr)); + mtr_start(&mtr); success = btr_pcur_restore_position(BTR_MODIFY_LEAF, pcur, &mtr); |