Skip to content

Commit

Permalink
Merge 10.5 into 10.6
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-m committed Jan 23, 2023
2 parents 1bbf37e + 647a723 commit 851c567
Show file tree
Hide file tree
Showing 10 changed files with 105 additions and 29 deletions.
1 change: 0 additions & 1 deletion mysql-test/suite/galera/disabled.def
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
##############################################################################

galera_as_slave_ctas : MDEV-28378 timeout
galera_bf_abort_at_after_statement : Timeout in wait_condition.inc for SELECT COUNT(*) = 1 FROM t1 where id = 1 and val = 3
galera_pc_recovery : MDEV-25199 cluster fails to start up
galera_sst_encrypted : MDEV-29876 Galera test failure on galera_sst_encrypted
MW-284 : MDEV-29861 Galera test case hangs
Expand Down
2 changes: 0 additions & 2 deletions mysql-test/suite/galera_3nodes/disabled.def
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@

galera_2_cluster : MDEV-29877 Galera test failure on galera_2_cluster
galera_gtid_2_cluster : MDEV-29877 Galera test failure on galera_2_cluster
galera_parallel_apply_3nodes : MDEV-29368 DEBUG_SYNC timeout
galera_parallel_apply_3nodes : MDEV-29774 Galera test galera_parallel_apply_3nodes is unstable
galera_vote_rejoin_mysqldump : MDEV-24481: galera_3nodes.galera_vote_rejoin_mysqldump MTR failed: mysql_shutdown failed
galera_ssl_reload : MDEV-30172 At line 50: mysql_shutdown failed
GCF-354 : mysqltest: At line 39: query 'DROP TABLE test.t1' failed: 1047: WSREP has not yet prepared node for application use
Expand Down
1 change: 1 addition & 0 deletions mysql-test/suite/innodb/t/undo_truncate.opt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
--innodb-buffer-pool-size=24M
--innodb-immediate-scrub-data-uncompressed=ON
2 changes: 1 addition & 1 deletion sql/service_wsrep.cc
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ extern "C" my_bool wsrep_thd_bf_abort(THD *bf_thd, THD *victim_thd,
}

victim_thd->wsrep_aborter= bf_thd->thread_id;
victim_thd->awake_no_mutex(KILL_QUERY);
victim_thd->awake_no_mutex(KILL_QUERY_HARD);
mysql_mutex_unlock(&victim_thd->LOCK_thd_data);
} else {
WSREP_DEBUG("wsrep_thd_bf_abort skipped awake, signal %d", signal);
Expand Down
2 changes: 1 addition & 1 deletion sql/sp_head.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1499,7 +1499,7 @@ sp_head::execute(THD *thd, bool merge_da_on_success)
wsrep_current_error_status(thd));
thd->wsrep_cs().reset_error();
/* Reset also thd->killed if it has been set during BF abort. */
if (thd->killed == KILL_QUERY)
if (killed_mask_hard(thd->killed) == KILL_QUERY)
thd->killed= NOT_KILLED;
/* if failed transaction was not replayed, must return with error from here */
if (!must_replay) err_status = 1;
Expand Down
22 changes: 2 additions & 20 deletions storage/innobase/mtr/mtr0mtr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ void mtr_t::commit_shrink(fil_space_t &space)
ut_ad(!m_memo.empty());
ut_ad(!recv_recovery_is_on());
ut_ad(m_log_mode == MTR_LOG_ALL);
ut_ad(!m_freed_pages);
ut_ad(UT_LIST_GET_LEN(space.chain) == 1);

log_write_and_flush_prepare();
Expand All @@ -261,26 +262,7 @@ void mtr_t::commit_shrink(fil_space_t &space)
os_file_truncate(space.chain.start->name, space.chain.start->handle,
os_offset_t{space.size} << srv_page_size_shift, true);

if (m_freed_pages)
{
ut_ad(!m_freed_pages->empty());
ut_ad(m_freed_space == &space);
ut_ad(memo_contains(*m_freed_space));
ut_ad(is_named_space(m_freed_space));
m_freed_space->update_last_freed_lsn(m_commit_lsn);

if (!is_trim_pages())
for (const auto &range : *m_freed_pages)
m_freed_space->add_free_range(range);
else
m_freed_space->clear_freed_ranges();
delete m_freed_pages;
m_freed_pages= nullptr;
m_freed_space= nullptr;
/* mtr_t::start() will reset m_trim_pages */
}
else
ut_ad(!m_freed_space);
space.clear_freed_ranges();

const page_id_t high{space.id, space.size};

Expand Down
6 changes: 2 additions & 4 deletions storage/spider/ha_spider.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1365,10 +1365,8 @@ int ha_spider::reset()
#endif
result_list.direct_distinct = FALSE;
store_error_num = 0;
if (
wide_handler &&
wide_handler->sql_command != SQLCOM_END
) {
if (wide_handler)
{
wide_handler->sql_command = SQLCOM_END;
wide_handler->between_flg = FALSE;
wide_handler->idx_bitmap_is_set = FALSE;
Expand Down
44 changes: 44 additions & 0 deletions storage/spider/mysql-test/spider/bugfix/r/mdev_30191.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#
# MDEV-30191 SIGSEGV & heap-use-after-free in spider_db_print_item_type, SIGABRT in __cxa_pure_virtual/spider_db_print_item_type, Got error 128 "Out of memory in engine", 56/112 memory not freed, and Assertion `fixed()' failed in Item_sp_variable::val_str on SP call
#
for master_1
for child2
child2_1
child2_2
child2_3
for child3
connection child2_1;
CREATE DATABASE auto_test_remote;
USE auto_test_remote;
CREATE TABLE tbl_a (c INT);
connection master_1;
CREATE DATABASE auto_test_local;
USE auto_test_local;
CREATE TABLE tbl_a (
c INT
) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='table "tbl_a", srv "s_2_1"';
CREATE TABLE tbl_b (c INT);
CREATE PROCEDURE sp() BEGIN
DECLARE v1 DATE;
WHILE EXISTS (SELECT 1 FROM tbl_a WHERE c>v1 AND c<=v1) DO
SELECT 1;
END WHILE;
WHILE EXISTS (SELECT 1
FROM tbl_a
WHERE c<v1 AND EXISTS (SELECT 1
FROM tbl_b
WHERE tbl_a.c=tbl_b.c)) DO
SELECT 1;
END WHILE;
END $$
CALL sp();
connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
for master_1
for child2
child2_1
child2_2
child2_3
for child3
3 changes: 3 additions & 0 deletions storage/spider/mysql-test/spider/bugfix/t/mdev_30191.cnf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
!include include/default_mysqld.cnf
!include ../my_1_1.cnf
!include ../my_2_1.cnf
51 changes: 51 additions & 0 deletions storage/spider/mysql-test/spider/bugfix/t/mdev_30191.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
--echo #
--echo # MDEV-30191 SIGSEGV & heap-use-after-free in spider_db_print_item_type, SIGABRT in __cxa_pure_virtual/spider_db_print_item_type, Got error 128 "Out of memory in engine", 56/112 memory not freed, and Assertion `fixed()' failed in Item_sp_variable::val_str on SP call
--echo #

--disable_query_log
--disable_result_log
--source ../../t/test_init.inc
--enable_result_log
--enable_query_log

--connection child2_1
CREATE DATABASE auto_test_remote;
USE auto_test_remote;
CREATE TABLE tbl_a (c INT);

--connection master_1
CREATE DATABASE auto_test_local;
USE auto_test_local;

eval CREATE TABLE tbl_a (
c INT
) $MASTER_1_ENGINE $MASTER_1_CHARSET COMMENT='table "tbl_a", srv "s_2_1"';
CREATE TABLE tbl_b (c INT);

--delimiter $$
CREATE PROCEDURE sp() BEGIN
DECLARE v1 DATE;
WHILE EXISTS (SELECT 1 FROM tbl_a WHERE c>v1 AND c<=v1) DO
SELECT 1;
END WHILE;
WHILE EXISTS (SELECT 1
FROM tbl_a
WHERE c<v1 AND EXISTS (SELECT 1
FROM tbl_b
WHERE tbl_a.c=tbl_b.c)) DO
SELECT 1;
END WHILE;
END $$
--delimiter ;
CALL sp();

--connection master_1
DROP DATABASE IF EXISTS auto_test_local;
--connection child2_1
DROP DATABASE IF EXISTS auto_test_remote;

--disable_query_log
--disable_result_log
--source ../t/test_deinit.inc
--enable_query_log
--enable_result_log

0 comments on commit 851c567

Please sign in to comment.