Commit 66ae50a5 authored by Marko Mäkelä's avatar Marko Mäkelä

Merge 10.3 into 10.4

parents 9b688471 7e07e38c
...@@ -740,6 +740,17 @@ t2 CREATE TABLE `t2` ( ...@@ -740,6 +740,17 @@ t2 CREATE TABLE `t2` (
CREATE TABLE t2 (f1 INT NOT NULL)ENGINE=InnoDB; CREATE TABLE t2 (f1 INT NOT NULL)ENGINE=InnoDB;
ERROR 42S01: Table 't2' already exists ERROR 42S01: Table 't2' already exists
DROP TABLE t2, t1; DROP TABLE t2, t1;
#
# MDEV-23685 SIGSEGV on ADD FOREIGN KEY after failed attempt
# to create unique key on virtual column
#
CREATE TABLE t1 (pk INT PRIMARY KEY, a INT, b INT AS (a)) ENGINE=InnODB;
INSERT INTO t1 (pk,a) VALUES (1,10),(2,10);
ALTER TABLE t1 ADD UNIQUE INDEX ind9 (b), LOCK=SHARED;
ERROR 23000: Duplicate entry '10' for key 'ind9'
SET FOREIGN_KEY_CHECKS= 0;
ALTER TABLE t1 ADD FOREIGN KEY (a) REFERENCES t1 (pk);
DROP TABLE t1;
# End of 10.2 tests # End of 10.2 tests
CREATE TABLE t1 (a GEOMETRY, INDEX(a(8)), CREATE TABLE t1 (a GEOMETRY, INDEX(a(8)),
FOREIGN KEY (a) REFERENCES x (xx)) ENGINE=InnoDB; FOREIGN KEY (a) REFERENCES x (xx)) ENGINE=InnoDB;
......
...@@ -720,6 +720,19 @@ SHOW CREATE TABLE t2; ...@@ -720,6 +720,19 @@ SHOW CREATE TABLE t2;
CREATE TABLE t2 (f1 INT NOT NULL)ENGINE=InnoDB; CREATE TABLE t2 (f1 INT NOT NULL)ENGINE=InnoDB;
DROP TABLE t2, t1; DROP TABLE t2, t1;
--echo #
--echo # MDEV-23685 SIGSEGV on ADD FOREIGN KEY after failed attempt
--echo # to create unique key on virtual column
--echo #
CREATE TABLE t1 (pk INT PRIMARY KEY, a INT, b INT AS (a)) ENGINE=InnODB;
INSERT INTO t1 (pk,a) VALUES (1,10),(2,10);
--error ER_DUP_ENTRY
ALTER TABLE t1 ADD UNIQUE INDEX ind9 (b), LOCK=SHARED;
SET FOREIGN_KEY_CHECKS= 0;
ALTER TABLE t1 ADD FOREIGN KEY (a) REFERENCES t1 (pk);
DROP TABLE t1;
--echo # End of 10.2 tests --echo # End of 10.2 tests
# MDEV-21792 Server aborts upon attempt to create foreign key on spatial field # MDEV-21792 Server aborts upon attempt to create foreign key on spatial field
......
...@@ -1087,8 +1087,7 @@ btr_create( ...@@ -1087,8 +1087,7 @@ btr_create(
if (UNIV_UNLIKELY(type & DICT_IBUF)) { if (UNIV_UNLIKELY(type & DICT_IBUF)) {
/* Allocate first the ibuf header page */ /* Allocate first the ibuf header page */
buf_block_t* ibuf_hdr_block = fseg_create( buf_block_t* ibuf_hdr_block = fseg_create(
space, 0, space, IBUF_HEADER + IBUF_TREE_SEG_HEADER, mtr);
IBUF_HEADER + IBUF_TREE_SEG_HEADER, mtr);
if (ibuf_hdr_block == NULL) { if (ibuf_hdr_block == NULL) {
return(FIL_NULL); return(FIL_NULL);
...@@ -1118,7 +1117,7 @@ btr_create( ...@@ -1118,7 +1117,7 @@ btr_create(
flst_init(block, PAGE_HEADER + PAGE_BTR_IBUF_FREE_LIST, mtr); flst_init(block, PAGE_HEADER + PAGE_BTR_IBUF_FREE_LIST, mtr);
} else { } else {
block = fseg_create(space, 0, block = fseg_create(space,
PAGE_HEADER + PAGE_BTR_SEG_TOP, mtr); PAGE_HEADER + PAGE_BTR_SEG_TOP, mtr);
if (block == NULL) { if (block == NULL) {
...@@ -1127,8 +1126,9 @@ btr_create( ...@@ -1127,8 +1126,9 @@ btr_create(
buf_block_dbg_add_level(block, SYNC_TREE_NODE_NEW); buf_block_dbg_add_level(block, SYNC_TREE_NODE_NEW);
if (!fseg_create(space, block->page.id.page_no(), if (!fseg_create(space,
PAGE_HEADER + PAGE_BTR_SEG_LEAF, mtr)) { PAGE_HEADER + PAGE_BTR_SEG_LEAF, mtr,
false, block)) {
/* Not enough space for new segment, free root /* Not enough space for new segment, free root
segment before return. */ segment before return. */
btr_free_root(block, mtr, btr_free_root(block, mtr,
......
...@@ -5588,14 +5588,13 @@ buf_page_create( ...@@ -5588,14 +5588,13 @@ buf_page_create(
{ {
buf_frame_t* frame; buf_frame_t* frame;
buf_block_t* block; buf_block_t* block;
buf_block_t* free_block = NULL;
buf_pool_t* buf_pool = buf_pool_get(page_id); buf_pool_t* buf_pool = buf_pool_get(page_id);
rw_lock_t* hash_lock; rw_lock_t* hash_lock;
ut_ad(mtr->is_active()); ut_ad(mtr->is_active());
ut_ad(page_id.space() != 0 || !zip_size); ut_ad(page_id.space() != 0 || !zip_size);
loop:
free_block = buf_LRU_get_free_block(buf_pool); buf_block_t *free_block = buf_LRU_get_free_block(buf_pool);
buf_pool_mutex_enter(buf_pool); buf_pool_mutex_enter(buf_pool);
...@@ -5604,22 +5603,68 @@ buf_page_create( ...@@ -5604,22 +5603,68 @@ buf_page_create(
block = (buf_block_t*) buf_page_hash_get_low(buf_pool, page_id); block = (buf_block_t*) buf_page_hash_get_low(buf_pool, page_id);
if (block if (UNIV_LIKELY_NULL(block)
&& buf_page_in_file(&block->page) && buf_page_in_file(&block->page)
&& !buf_pool_watch_is_sentinel(buf_pool, &block->page)) { && !buf_pool_watch_is_sentinel(buf_pool, &block->page)) {
ut_d(block->page.file_page_was_freed = FALSE); ut_d(block->page.file_page_was_freed = FALSE);
#ifdef BTR_CUR_HASH_ADAPT #ifdef BTR_CUR_HASH_ADAPT
bool drop_hash_entry = const dict_index_t *drop_hash_entry= nullptr;
(block->page.state == BUF_BLOCK_FILE_PAGE #endif
&& block->index); switch (const auto page_state= buf_block_get_state(block)) {
default:
if (drop_hash_entry) { ut_ad(0);
/* Avoid a hang if I/O is going on. Release break;
the buffer pool mutex and page hash lock case BUF_BLOCK_ZIP_PAGE:
and wait for I/O to complete */ case BUF_BLOCK_ZIP_DIRTY:
while (buf_block_get_io_fix(block) != BUF_IO_NONE) { buf_block_init_low(free_block);
block->fix(); mutex_enter(&buf_pool->zip_mutex);
buf_page_mutex_enter(free_block);
if (buf_page_get_io_fix(&block->page) != BUF_IO_NONE) {
mutex_exit(&buf_pool->zip_mutex);
rw_lock_x_unlock(hash_lock);
buf_LRU_block_free_non_file_page(free_block);
buf_pool_mutex_exit(buf_pool);
buf_page_mutex_exit(free_block);
goto loop;
}
rw_lock_x_lock(&free_block->lock);
buf_relocate(&block->page, &free_block->page);
if (page_state == BUF_BLOCK_ZIP_DIRTY) {
ut_ad(block->page.in_flush_list);
ut_ad(block->page.oldest_modification > 0);
buf_flush_relocate_on_flush_list(
&block->page, &free_block->page);
} else {
ut_ad(block->page.oldest_modification == 0);
ut_ad(!block->page.in_flush_list);
#ifdef UNIV_DEBUG
UT_LIST_REMOVE(
buf_pool->zip_clean, &block->page);
#endif
}
free_block->page.state = BUF_BLOCK_FILE_PAGE;
mutex_exit(&buf_pool->zip_mutex);
free_block->lock_hash_val = lock_rec_hash(
page_id.space(), page_id.page_no());
buf_unzip_LRU_add_block(free_block, false);
buf_page_free_descriptor(&block->page);
block = free_block;
buf_block_buf_fix_inc(block, __FILE__, __LINE__);
buf_page_mutex_exit(free_block);
free_block = nullptr;
break;
case BUF_BLOCK_FILE_PAGE:
buf_block_buf_fix_inc(block, __FILE__, __LINE__);
const uint32_t num_fix_count= mtr->get_fix_count(block)
+ 1;
while (buf_block_get_io_fix(block) != BUF_IO_NONE
|| (num_fix_count
!= block->page.buf_fix_count)) {
buf_pool_mutex_exit(buf_pool); buf_pool_mutex_exit(buf_pool);
rw_lock_x_unlock(hash_lock); rw_lock_x_unlock(hash_lock);
...@@ -5627,31 +5672,30 @@ buf_page_create( ...@@ -5627,31 +5672,30 @@ buf_page_create(
buf_pool_mutex_enter(buf_pool); buf_pool_mutex_enter(buf_pool);
rw_lock_x_lock(hash_lock); rw_lock_x_lock(hash_lock);
block->unfix();
} }
rw_lock_x_lock(&block->lock); rw_lock_x_lock(&block->lock);
} #ifdef BTR_CUR_HASH_ADAPT
drop_hash_entry = block->index;
#endif #endif
break;
}
/* Page can be found in buf_pool */ /* Page can be found in buf_pool */
buf_pool_mutex_exit(buf_pool); buf_pool_mutex_exit(buf_pool);
rw_lock_x_unlock(hash_lock); rw_lock_x_unlock(hash_lock);
if (free_block) {
buf_block_free(free_block); buf_block_free(free_block);
}
#ifdef BTR_CUR_HASH_ADAPT #ifdef BTR_CUR_HASH_ADAPT
if (drop_hash_entry) { if (UNIV_LIKELY_NULL(drop_hash_entry)) {
btr_search_drop_page_hash_index(block); btr_search_drop_page_hash_index(block);
rw_lock_x_unlock(&block->lock);
} }
#endif /* BTR_CUR_HASH_ADAPT */ #endif /* BTR_CUR_HASH_ADAPT */
if (!recv_recovery_is_on()) { mtr_memo_push(mtr, block, MTR_MEMO_PAGE_X_FIX);
return buf_page_get_with_no_latch(page_id, zip_size,
mtr);
}
mutex_exit(&recv_sys.mutex);
block = buf_page_get_with_no_latch(page_id, zip_size, mtr);
mutex_enter(&recv_sys.mutex);
return block; return block;
} }
...@@ -5666,6 +5710,8 @@ buf_page_create( ...@@ -5666,6 +5710,8 @@ buf_page_create(
buf_page_init(buf_pool, page_id, zip_size, block); buf_page_init(buf_pool, page_id, zip_size, block);
rw_lock_x_lock(&block->lock);
rw_lock_x_unlock(hash_lock); rw_lock_x_unlock(hash_lock);
/* The block must be put to the LRU list */ /* The block must be put to the LRU list */
...@@ -5683,7 +5729,6 @@ buf_page_create( ...@@ -5683,7 +5729,6 @@ buf_page_create(
by IO-fixing and X-latching the block. */ by IO-fixing and X-latching the block. */
buf_page_set_io_fix(&block->page, BUF_IO_READ); buf_page_set_io_fix(&block->page, BUF_IO_READ);
rw_lock_x_lock(&block->lock);
buf_page_mutex_exit(block); buf_page_mutex_exit(block);
/* buf_pool->mutex may be released and reacquired by /* buf_pool->mutex may be released and reacquired by
...@@ -5705,12 +5750,11 @@ buf_page_create( ...@@ -5705,12 +5750,11 @@ buf_page_create(
buf_unzip_LRU_add_block(block, FALSE); buf_unzip_LRU_add_block(block, FALSE);
buf_page_set_io_fix(&block->page, BUF_IO_NONE); buf_page_set_io_fix(&block->page, BUF_IO_NONE);
rw_lock_x_unlock(&block->lock);
} }
buf_pool_mutex_exit(buf_pool); buf_pool_mutex_exit(buf_pool);
mtr_memo_push(mtr, block, MTR_MEMO_BUF_FIX); mtr_memo_push(mtr, block, MTR_MEMO_PAGE_X_FIX);
buf_page_set_accessed(&block->page); buf_page_set_accessed(&block->page);
......
...@@ -170,6 +170,7 @@ buf_dblwr_create() ...@@ -170,6 +170,7 @@ buf_dblwr_create()
{ {
buf_block_t* block2; buf_block_t* block2;
buf_block_t* new_block; buf_block_t* new_block;
buf_block_t* trx_sys_block;
byte* doublewrite; byte* doublewrite;
byte* fseg_header; byte* fseg_header;
ulint page_no; ulint page_no;
...@@ -205,9 +206,12 @@ buf_dblwr_create() ...@@ -205,9 +206,12 @@ buf_dblwr_create()
} }
} }
block2 = fseg_create(fil_system.sys_space, TRX_SYS_PAGE_NO, trx_sys_block = buf_page_get(page_id_t(TRX_SYS_SPACE, TRX_SYS_PAGE_NO),
TRX_SYS_DOUBLEWRITE 0, RW_X_LATCH, &mtr);
+ TRX_SYS_DOUBLEWRITE_FSEG, &mtr);
block2 = fseg_create(fil_system.sys_space,
TRX_SYS_DOUBLEWRITE + TRX_SYS_DOUBLEWRITE_FSEG,
&mtr, false, trx_sys_block);
if (block2 == NULL) { if (block2 == NULL) {
too_small: too_small:
......
/***************************************************************************** /*****************************************************************************
Copyright (c) 1996, 2017, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 1996, 2017, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2016, 2019, MariaDB Corporation. Copyright (c) 2016, 2020, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under 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 the terms of the GNU General Public License as published by the Free Software
...@@ -142,7 +142,7 @@ dict_hdr_create( ...@@ -142,7 +142,7 @@ dict_hdr_create(
/* Create the dictionary header file block in a new, allocated file /* Create the dictionary header file block in a new, allocated file
segment in the system tablespace */ segment in the system tablespace */
block = fseg_create(fil_system.sys_space, 0, block = fseg_create(fil_system.sys_space,
DICT_HDR + DICT_HDR_FSEG_HEADER, mtr); DICT_HDR + DICT_HDR_FSEG_HEADER, mtr);
ut_a(DICT_HDR_PAGE_NO == block->page.id.page_no()); ut_a(DICT_HDR_PAGE_NO == block->page.id.page_no());
......
...@@ -6047,7 +6047,11 @@ dict_foreign_qualify_index( ...@@ -6047,7 +6047,11 @@ dict_foreign_qualify_index(
return(false); return(false);
} }
if (index->type & (DICT_SPATIAL | DICT_FTS)) { if (index->type & (DICT_SPATIAL | DICT_FTS | DICT_CORRUPT)) {
return false;
}
if (index->online_status >= ONLINE_INDEX_ABORTED) {
return false; return false;
} }
......
This diff is collapsed.
...@@ -359,26 +359,18 @@ fsp_header_init_fields( ...@@ -359,26 +359,18 @@ fsp_header_init_fields(
void fsp_header_init(fil_space_t* space, ulint size, mtr_t* mtr) void fsp_header_init(fil_space_t* space, ulint size, mtr_t* mtr)
MY_ATTRIBUTE((nonnull)); MY_ATTRIBUTE((nonnull));
/**********************************************************************//** /** Create a new segment.
Creates a new segment. @param space tablespace
@return the block where the segment header is placed, x-latched, NULL @param byte_offset byte offset of the created segment header
if could not create segment because of lack of space */ @param mtr mini-transaction
@param has_done_reservation whether fsp_reserve_free_extents() was invoked
@param block block where segment header is placed,
or NULL to allocate an additional page for that
@return the block where the segment header is placed, x-latched
@retval NULL if could not create segment because of lack of space */
buf_block_t* buf_block_t*
fseg_create( fseg_create(fil_space_t *space, ulint byte_offset, mtr_t *mtr,
fil_space_t* space, /*!< in,out: tablespace */ bool has_done_reservation= false, buf_block_t *block= NULL);
ulint page, /*!< in: page where the segment header is placed: if
this is != 0, the page must belong to another segment,
if this is 0, a new page will be allocated and it
will belong to the created segment */
ulint byte_offset, /*!< in: byte offset of the created segment header
on the page */
mtr_t* mtr,
bool has_done_reservation = false); /*!< in: whether the caller
has already done the reservation for the pages with
fsp_reserve_free_extents (at least 2 extents: one for
the inode and the other for the segment) then there is
no need to do the check for this individual
operation */
/**********************************************************************//** /**********************************************************************//**
Calculates the number of pages reserved by a segment, and how many pages are Calculates the number of pages reserved by a segment, and how many pages are
......
...@@ -426,6 +426,10 @@ struct mtr_t { ...@@ -426,6 +426,10 @@ struct mtr_t {
static inline bool is_block_dirtied(const buf_block_t* block) static inline bool is_block_dirtied(const buf_block_t* block)
MY_ATTRIBUTE((warn_unused_result)); MY_ATTRIBUTE((warn_unused_result));
/** Determine the added buffer fix count of a block.
@param block block to be checked
@return number of buffer count added by this mtr */
uint32_t get_fix_count(const buf_block_t *block);
private: private:
/** Prepare to write the mini-transaction log to the redo log buffer. /** Prepare to write the mini-transaction log to the redo log buffer.
@return number of bytes to write in finish_write() */ @return number of bytes to write in finish_write() */
......
...@@ -2242,7 +2242,6 @@ static buf_block_t* recv_recovery_create_page_low(const page_id_t page_id, ...@@ -2242,7 +2242,6 @@ static buf_block_t* recv_recovery_create_page_low(const page_id_t page_id,
{ {
i.created= true; i.created= true;
buf_block_dbg_add_level(block, SYNC_NO_ORDER_CHECK); buf_block_dbg_add_level(block, SYNC_NO_ORDER_CHECK);
mtr.x_latch_at_savepoint(0, block);
recv_recover_page(block, mtr, recv_addr, &i); recv_recover_page(block, mtr, recv_addr, &i);
ut_ad(mtr.has_committed()); ut_ad(mtr.has_committed());
} }
......
...@@ -308,6 +308,24 @@ struct DebugCheck { ...@@ -308,6 +308,24 @@ struct DebugCheck {
}; };
#endif #endif
/** Find buffer fix count of the given block acquired by the
mini-transaction */
struct FindBlock
{
int32_t num_fix;
const buf_block_t *const block;
FindBlock(const buf_block_t *block_buf): num_fix(0), block(block_buf) {}
bool operator()(const mtr_memo_slot_t* slot)
{
if (slot->object == block)
ut_d(if (slot->type != MTR_MEMO_MODIFY))
num_fix++;
return true;
}
};
/** Release a resource acquired by the mini-transaction. */ /** Release a resource acquired by the mini-transaction. */
struct ReleaseBlocks { struct ReleaseBlocks {
/** Release specific object */ /** Release specific object */
...@@ -735,6 +753,14 @@ inline lsn_t mtr_t::finish_write(ulint len) ...@@ -735,6 +753,14 @@ inline lsn_t mtr_t::finish_write(ulint len)
return start_lsn; return start_lsn;
} }
uint32_t mtr_t::get_fix_count(const buf_block_t *block)
{
Iterate<FindBlock> iteration((FindBlock(block)));
if (m_memo.for_each_block(iteration))
return iteration.functor.num_fix;
return 0;
}
#ifdef UNIV_DEBUG #ifdef UNIV_DEBUG
/** Check if memo contains the given item. /** Check if memo contains the given item.
@return true if contains */ @return true if contains */
......
...@@ -3175,15 +3175,41 @@ row_sel_build_prev_vers_for_mysql( ...@@ -3175,15 +3175,41 @@ row_sel_build_prev_vers_for_mysql(
return(err); return(err);
} }
/** Helper class to cache clust_rec and old_ver */ /** Helper class to cache clust_rec and old_vers */
class Row_sel_get_clust_rec_for_mysql class Row_sel_get_clust_rec_for_mysql
{ {
const rec_t *cached_clust_rec; const rec_t *cached_clust_rec;
rec_t *cached_old_vers; rec_t *cached_old_vers;
lsn_t cached_lsn;
page_id_t cached_page_id;
#ifdef UNIV_DEBUG
void check_eq(const dict_index_t *index, const rec_offs *offsets) const
{
rec_offs vers_offs[REC_OFFS_HEADER_SIZE + MAX_REF_PARTS];
rec_offs_init(vers_offs);
mem_heap_t *heap= nullptr;
ut_ad(rec_offs_validate(cached_clust_rec, index, offsets));
ut_ad(index->first_user_field() <= rec_offs_n_fields(offsets));
ut_ad(vers_offs == rec_get_offsets(cached_old_vers, index, vers_offs, true,
index->db_trx_id(), &heap));
ut_ad(!heap);
for (auto n= index->db_trx_id(); n--; )
{
const dict_col_t *col= dict_index_get_nth_col(index, n);
ulint len1, len2;
const byte *b1= rec_get_nth_field(cached_clust_rec, offsets, n, &len1);
const byte *b2= rec_get_nth_field(cached_old_vers, vers_offs, n, &len2);
ut_ad(!cmp_data_data(col->mtype, col->prtype, b1, len1, b2, len2));
}
}
#endif
public: public:
Row_sel_get_clust_rec_for_mysql() : Row_sel_get_clust_rec_for_mysql() :
cached_clust_rec(NULL), cached_old_vers(NULL) {} cached_clust_rec(NULL), cached_old_vers(NULL), cached_lsn(0),
cached_page_id(page_id_t(0,0)) {}
dberr_t operator()(row_prebuilt_t *prebuilt, dict_index_t *sec_index, dberr_t operator()(row_prebuilt_t *prebuilt, dict_index_t *sec_index,
const rec_t *rec, que_thr_t *thr, const rec_t **out_rec, const rec_t *rec, que_thr_t *thr, const rec_t **out_rec,
...@@ -3388,8 +3414,18 @@ Row_sel_get_clust_rec_for_mysql::operator()( ...@@ -3388,8 +3414,18 @@ Row_sel_get_clust_rec_for_mysql::operator()(
&& !lock_clust_rec_cons_read_sees( && !lock_clust_rec_cons_read_sees(
clust_rec, clust_index, *offsets, clust_rec, clust_index, *offsets,
&trx->read_view)) { &trx->read_view)) {
const buf_page_t& bpage = btr_pcur_get_block(
prebuilt->clust_pcur)->page;
lsn_t lsn = bpage.newest_modification;
if (!lsn) {
lsn = mach_read_from_8(
page_align(clust_rec) + FIL_PAGE_LSN);
}
if (clust_rec != cached_clust_rec) { if (lsn != cached_lsn
|| bpage.id != cached_page_id
|| clust_rec != cached_clust_rec) {
/* The following call returns 'offsets' associated with /* The following call returns 'offsets' associated with
'old_vers' */ 'old_vers' */
err = row_sel_build_prev_vers_for_mysql( err = row_sel_build_prev_vers_for_mysql(
...@@ -3401,6 +3437,8 @@ Row_sel_get_clust_rec_for_mysql::operator()( ...@@ -3401,6 +3437,8 @@ Row_sel_get_clust_rec_for_mysql::operator()(
goto err_exit; goto err_exit;
} }
cached_lsn = lsn;
cached_page_id = bpage.id;
cached_clust_rec = clust_rec; cached_clust_rec = clust_rec;
cached_old_vers = old_vers; cached_old_vers = old_vers;
} else { } else {
...@@ -3411,7 +3449,8 @@ Row_sel_get_clust_rec_for_mysql::operator()( ...@@ -3411,7 +3449,8 @@ Row_sel_get_clust_rec_for_mysql::operator()(
version of clust_rec and its old version version of clust_rec and its old version
old_vers. Re-calculate the offsets for old_vers. */ old_vers. Re-calculate the offsets for old_vers. */
if (old_vers != NULL) { if (old_vers) {
ut_d(check_eq(clust_index, *offsets));
*offsets = rec_get_offsets( *offsets = rec_get_offsets(
old_vers, clust_index, *offsets, old_vers, clust_index, *offsets,
true, ULINT_UNDEFINED, offset_heap); true, ULINT_UNDEFINED, offset_heap);
......
...@@ -312,7 +312,7 @@ trx_rseg_header_create( ...@@ -312,7 +312,7 @@ trx_rseg_header_create(
ut_ad(!sys_header == (space == fil_system.temp_space)); ut_ad(!sys_header == (space == fil_system.temp_space));
/* Allocate a new file segment for the rollback segment */ /* Allocate a new file segment for the rollback segment */
block = fseg_create(space, 0, TRX_RSEG + TRX_RSEG_FSEG_HEADER, mtr); block = fseg_create(space, TRX_RSEG + TRX_RSEG_FSEG_HEADER, mtr);
if (block == NULL) { if (block == NULL) {
/* No space left */ /* No space left */
......
...@@ -160,7 +160,7 @@ trx_sysf_create( ...@@ -160,7 +160,7 @@ trx_sysf_create(
compile_time_assert(TRX_SYS_SPACE == 0); compile_time_assert(TRX_SYS_SPACE == 0);
/* Create the trx sys file block in a new allocated file segment */ /* Create the trx sys file block in a new allocated file segment */
block = fseg_create(fil_system.sys_space, 0, block = fseg_create(fil_system.sys_space,
TRX_SYS + TRX_SYS_FSEG_HEADER, TRX_SYS + TRX_SYS_FSEG_HEADER,
mtr); mtr);
buf_block_dbg_add_level(block, SYNC_TRX_SYS_HEADER); buf_block_dbg_add_level(block, SYNC_TRX_SYS_HEADER);
......
...@@ -526,7 +526,7 @@ trx_undo_seg_create(fil_space_t* space, trx_rsegf_t* rseg_hdr, ulint* id, ...@@ -526,7 +526,7 @@ trx_undo_seg_create(fil_space_t* space, trx_rsegf_t* rseg_hdr, ulint* id,
} }
/* Allocate a new file segment for the undo log */ /* Allocate a new file segment for the undo log */
block = fseg_create(space, 0, TRX_UNDO_SEG_HDR + TRX_UNDO_FSEG_HEADER, block = fseg_create(space, TRX_UNDO_SEG_HDR + TRX_UNDO_FSEG_HEADER,
mtr, true); mtr, true);
space->release_free_extents(n_reserved); space->release_free_extents(n_reserved);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment