summaryrefslogtreecommitdiff
path: root/storage/innobase/row/row0merge.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2019-12-13 17:30:37 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2019-12-13 17:30:37 +0200
commit8fa759a5762733d9f8a4050437fadcd255ecd1a2 (patch)
tree093c167478abbbf6f51cd47f8df8651ee17f97f1 /storage/innobase/row/row0merge.cc
parent014e1258309da2475b8ae36d445261f87422adaf (diff)
parent3466b47b0d2f0aca0a2191574c593c7eaea0b0b8 (diff)
downloadmariadb-git-8fa759a5762733d9f8a4050437fadcd255ecd1a2.tar.gz
Merge 10.3 into 10.4
We disable the MDEV-21189 test galera.galera_partition because it times out.
Diffstat (limited to 'storage/innobase/row/row0merge.cc')
-rw-r--r--storage/innobase/row/row0merge.cc51
1 files changed, 24 insertions, 27 deletions
diff --git a/storage/innobase/row/row0merge.cc b/storage/innobase/row/row0merge.cc
index 0e73faea5a1..8b3831f08af 100644
--- a/storage/innobase/row/row0merge.cc
+++ b/storage/innobase/row/row0merge.cc
@@ -120,7 +120,7 @@ public:
btr_cur_t ins_cur;
mtr_t mtr;
rtr_info_t rtr_info;
- ulint* ins_offsets = NULL;
+ offset_t* ins_offsets = NULL;
dberr_t error = DB_SUCCESS;
dtuple_t* dtuple;
ulint count = 0;
@@ -1046,8 +1046,8 @@ row_merge_heap_create(
/*==================*/
const dict_index_t* index, /*!< in: record descriptor */
mrec_buf_t** buf, /*!< out: 3 buffers */
- ulint** offsets1, /*!< out: offsets */
- ulint** offsets2) /*!< out: offsets */
+ offset_t** offsets1, /*!< out: offsets */
+ offset_t** offsets2) /*!< out: offsets */
{
ulint i = 1 + REC_OFFS_HEADER_SIZE
+ dict_index_get_n_fields(index);
@@ -1056,13 +1056,15 @@ row_merge_heap_create(
*buf = static_cast<mrec_buf_t*>(
mem_heap_alloc(heap, 3 * sizeof **buf));
- *offsets1 = static_cast<ulint*>(
+ *offsets1 = static_cast<offset_t*>(
mem_heap_alloc(heap, i * sizeof **offsets1));
- *offsets2 = static_cast<ulint*>(
+ *offsets2 = static_cast<offset_t*>(
mem_heap_alloc(heap, i * sizeof **offsets2));
- (*offsets1)[0] = (*offsets2)[0] = i;
- (*offsets1)[1] = (*offsets2)[1] = dict_index_get_n_fields(index);
+ rec_offs_set_n_alloc(*offsets1, i);
+ rec_offs_set_n_alloc(*offsets2, i);
+ rec_offs_set_n_fields(*offsets1, dict_index_get_n_fields(index));
+ rec_offs_set_n_fields(*offsets2, dict_index_get_n_fields(index));
return(heap);
}
@@ -1178,7 +1180,7 @@ row_merge_read_rec(
const mrec_t** mrec, /*!< out: pointer to merge record,
or NULL on end of list
(non-NULL on I/O error) */
- ulint* offsets,/*!< out: offsets of mrec */
+ offset_t* offsets,/*!< out: offsets of mrec */
row_merge_block_t* crypt_block, /*!< in: crypt buf or NULL */
ulint space) /*!< in: space id */
{
@@ -1189,7 +1191,7 @@ row_merge_read_rec(
ut_ad(b >= &block[0]);
ut_ad(b < &block[srv_sort_buf_size]);
- ut_ad(*offsets == 1 + REC_OFFS_HEADER_SIZE
+ ut_ad(rec_offs_get_n_alloc(offsets) == 1 + REC_OFFS_HEADER_SIZE
+ dict_index_get_n_fields(index));
DBUG_ENTER("row_merge_read_rec");
@@ -1296,12 +1298,7 @@ err_exit:
memcpy(*buf, b, avail_size);
*mrec = *buf + extra_size;
- /* We cannot invoke rec_offs_make_valid() here, because there
- are no REC_N_NEW_EXTRA_BYTES between extra_size and data_size.
- Similarly, rec_offs_validate() would fail, because it invokes
- rec_get_status(). */
- ut_d(offsets[2] = (ulint) *mrec);
- ut_d(offsets[3] = (ulint) index);
+ rec_init_offsets_temp(*mrec, index, offsets);
if (!row_merge_read(fd, ++(*foffs), block,
crypt_block,
@@ -1340,7 +1337,7 @@ row_merge_write_rec_low(
ulint foffs, /*!< in: file offset */
#endif /* !DBUG_OFF */
const mrec_t* mrec, /*!< in: record to write */
- const ulint* offsets)/*!< in: offsets of mrec */
+ const offset_t* offsets)/*!< in: offsets of mrec */
#ifdef DBUG_OFF
# define row_merge_write_rec_low(b, e, size, fd, foffs, mrec, offsets) \
row_merge_write_rec_low(b, e, mrec, offsets)
@@ -1382,7 +1379,7 @@ row_merge_write_rec(
const pfs_os_file_t& fd, /*!< in: file descriptor */
ulint* foffs, /*!< in/out: file offset */
const mrec_t* mrec, /*!< in: record to write */
- const ulint* offsets,/*!< in: offsets of mrec */
+ const offset_t* offsets,/*!< in: offsets of mrec */
row_merge_block_t* crypt_block, /*!< in: crypt buf or NULL */
ulint space) /*!< in: space id */
{
@@ -1929,7 +1926,7 @@ row_merge_read_clustered_index(
const rec_t* rec;
trx_id_t rec_trx_id;
- ulint* offsets;
+ offset_t* offsets;
dtuple_t* row;
row_ext_t* ext;
page_cur_t* cur = btr_pcur_get_page_cur(&pcur);
@@ -2963,8 +2960,8 @@ row_merge_blocks(
const mrec_t* mrec0; /*!< merge rec, points to block[0] or buf[0] */
const mrec_t* mrec1; /*!< merge rec, points to
block[srv_sort_buf_size] or buf[1] */
- ulint* offsets0;/* offsets of mrec0 */
- ulint* offsets1;/* offsets of mrec1 */
+ offset_t* offsets0;/* offsets of mrec0 */
+ offset_t* offsets1;/* offsets of mrec1 */
DBUG_ENTER("row_merge_blocks");
DBUG_LOG("ib_merge_sort",
@@ -3081,8 +3078,8 @@ row_merge_blocks_copy(
const byte* b0; /*!< pointer to block[0] */
byte* b2; /*!< pointer to block[2 * srv_sort_buf_size] */
const mrec_t* mrec0; /*!< merge rec, points to block[0] */
- ulint* offsets0;/* offsets of mrec0 */
- ulint* offsets1;/* dummy offsets */
+ offset_t* offsets0;/* offsets of mrec0 */
+ offset_t* offsets1;/* dummy offsets */
DBUG_ENTER("row_merge_blocks_copy");
DBUG_LOG("ib_merge_sort",
@@ -3421,7 +3418,7 @@ static
void
row_merge_copy_blobs(
const mrec_t* mrec,
- const ulint* offsets,
+ const offset_t* offsets,
ulint zip_size,
dtuple_t* tuple,
mem_heap_t* heap)
@@ -3530,7 +3527,7 @@ row_merge_insert_index_tuples(
mem_heap_t* tuple_heap;
dberr_t error = DB_SUCCESS;
ulint foffs = 0;
- ulint* offsets;
+ offset_t* offsets;
mrec_buf_t* buf;
ulint n_rows = 0;
dtuple_t* dtuple;
@@ -3558,10 +3555,10 @@ row_merge_insert_index_tuples(
ulint i = 1 + REC_OFFS_HEADER_SIZE
+ dict_index_get_n_fields(index);
heap = mem_heap_create(sizeof *buf + i * sizeof *offsets);
- offsets = static_cast<ulint*>(
+ offsets = static_cast<offset_t*>(
mem_heap_alloc(heap, i * sizeof *offsets));
- offsets[0] = i;
- offsets[1] = dict_index_get_n_fields(index);
+ rec_offs_set_n_alloc(offsets, i);
+ rec_offs_set_n_fields(offsets, dict_index_get_n_fields(index));
}
if (row_buf != NULL) {