Merge 10.6 into 10.11

This commit is contained in:
Marko Mäkelä 2024-09-24 08:49:20 +03:00
commit 971cf59579
4 changed files with 46 additions and 4 deletions

View file

@ -5780,9 +5780,12 @@ DROP TABLE t1;
CREATE TABLE t1 (f1 char(2), PRIMARY KEY (f1)) ENGINE=MyISAM;
INSERT INTO t1 VALUES ('u1'),('u2');
#Check and enable after fix MDEV-34895
--disable_ps2_protocol
SELECT a.* FROM t1 a WHERE ( SELECT EXISTS ( SELECT 1 FROM t1 b WHERE b.f1 = a.f1 ) );
FLUSH TABLES;
SELECT a.* FROM t1 a WHERE ( SELECT EXISTS ( SELECT 1 FROM t1 b WHERE b.f1 = a.f1 ) );
--enable_ps2_protocol
# Cleanup
DROP TABLE t1;

View file

@ -1,4 +1,5 @@
--source include/no_valgrind_without_big.inc
--source include/maybe_debug.inc
######## t/ddl_innodb.test ######
#
# Stress the storage engine InnoDB with CREATE/DROP TABLE/INDEX
@ -34,6 +35,13 @@ if (!$run)
##### Some preparations needed for the ddl*.inc scripts
--source suite/stress/include/ddl.pre
if ($have_debug) {
--disable_query_log
SET @old_debug_dbug = @@global.debug_dbug;
SET DEBUG_DBUG="+d,ib_buf_create_intermittent_wait";
--enable_query_log
}
--source suite/stress/include/ddl1.inc
--source suite/stress/include/ddl2.inc
--source suite/stress/include/ddl3.inc
@ -43,5 +51,11 @@ if (!$run)
--source suite/stress/include/ddl7.inc
--source suite/stress/include/ddl8.inc
if ($have_debug) {
--disable_query_log
SET @@global.debug_dbug = @old_debug_dbug;
--enable_query_log
}
##### Cleanup
--source suite/stress/include/ddl.cln

View file

@ -3588,22 +3588,47 @@ retry:
if (!mtr->have_x_latch(reinterpret_cast<const buf_block_t&>(*bpage)))
{
const bool got= bpage->lock.x_lock_try();
if (!got)
/* Buffer-fix the block to prevent the block being concurrently freed
after we release the buffer pool mutex. It should work fine with
concurrent load of the page (free on disk) to buffer pool due to
possible read ahead. After we find a zero filled page during load, we
call buf_pool_t::corrupted_evict, where we try to wait for all buffer
fixes to go away only after resetting the page ID and releasing the
page latch. */
auto state= bpage->fix();
DBUG_EXECUTE_IF("ib_buf_create_intermittent_wait",
{
static bool need_to_wait = false;
need_to_wait = !need_to_wait;
/* Simulate try lock failure in every alternate call. */
if (need_to_wait) {
goto must_wait;
}
});
if (!bpage->lock.x_lock_try())
{
#ifndef DBUG_OFF
must_wait:
#endif
mysql_mutex_unlock(&buf_pool.mutex);
bpage->lock.x_lock();
const page_id_t id{bpage->id()};
if (UNIV_UNLIKELY(id != page_id))
{
ut_ad(id.is_corrupted());
ut_ad(bpage->is_freed());
bpage->unfix();
bpage->lock.x_unlock();
goto retry;
}
mysql_mutex_lock(&buf_pool.mutex);
state= bpage->state();
ut_ad(!bpage->is_io_fixed(state));
ut_ad(bpage->buf_fix_count(state));
}
auto state= bpage->fix();
ut_ad(state >= buf_page_t::FREED);
ut_ad(state < buf_page_t::READ_FIX);

View file

@ -6387,7 +6387,7 @@ my_bool translog_write_record(LSN *lsn,
struct st_translog_parts parts;
LEX_CUSTRING *part;
int rc;
uint short_trid= trn->short_id;
SHORT_TRANSACTION_ID short_trid= trn->short_id;
DBUG_ENTER("translog_write_record");
DBUG_PRINT("enter", ("type: %u (%s) ShortTrID: %u rec_len: %lu",
(uint) type, log_record_type_descriptor[type].name,