mariadb/mysql-test/suite/parts/r
Thirunarayanan Balathandayuthapani 14f96a2e08 MDEV-38928 Assertion `undo_no <= 1' failed in trx_t::reset_and_truncate_undo()
Problem:
========
1) ALTER IGNORE TABLE...ALGORITHM=COPY on an InnoDB temporary table
triggers an assertion failure in trx_t::reset_and_truncate_undo().
The IGNORE_UNDO mode rewrites the insert undo log to retain only
the latest record, but temporary tables undo logs are not processed
by the purge thread. Applying this optimization
to a temporary table is incorrect.

2) For partitioned tables with ALTER IGNORE...ALGORITHM=COPY, the
IGNORE_UNDO in trx_undo_report_row_operation() resets trx->undo_no
to 0, but trx->mod_tables retains entries from earlier partitions.
When a different partition (dict_table_t) is inserted into, its
mod_tables entry is created with first=1. After the rewinding, it
writes the undo record with top_undo_no=0, time.valid(0) fails
because first(1) > 0.

3) The savepoint for partial rollback also did not account for
IGNORE_UNDO mode, where trx->undo_no is continuously reset to 0.

Solution:
=========
ha_innobase::extra(): Set skip_alter_undo=IGNORE_UNDO only for
non-temporary tables during HA_EXTRA_BEGIN_ALTER_IGNORE_COPY.
Temporary tables keep NORMAL_UNDO since purge won't process
write temporary table undo logs.

trx_t::reset_and_truncate_undo(): Remove the table parameter
because same transaction could modify multiple tables in
case of partition.

trx_undo_report_row_operation(): After rewinding trx->undo_no to 0
in IGNORE_UNDO mode, clear mod_tables and re-emplace the
table with first=0.

row_insert_for_mysql(): Use savept=0 for IGNORE_UNDO mode. So that
partial rollback target the last inserted undo record.

Change TRX_DML_BULK=2, TRX_DDL_BULK=3 so that bit 1 is set for all
bulk insert modes and for dict_table_t::IGNORE_UNDO. This allows
to replace the savept conditional with a single bit test:
(trx->bulk_insert | table->skip_alter_undo) & 2
2026-03-05 22:53:07 +05:30
..
alter_data_directory_innodb.result MDEV-29446 Change SHOW CREATE TABLE to display default collation 2022-09-12 22:10:39 +04:00
alter_table,list.rdiff Merge 10.6 into 10.7 2022-09-21 09:33:07 +03:00
alter_table.result MDEV-37328 Assertion failure in make_empty_rec upon CONVERT PARTITION 2025-07-28 18:06:11 +02:00
backup_log.result Revert MDEV-25292 Atomic CREATE OR REPLACE TABLE 2022-10-27 23:13:41 +02:00
backup_log_rocksdb.result MDEV-18465 Logging of DDL statements during backup 2021-05-19 22:54:13 +02:00
cache.result MDEV Assertion `partition_id == m_extra_cache_part_id' failed in ha_partition::late_extra_no_cache 2017-12-12 15:10:53 +02:00
debug_innodb_crash.result Merge 10.5 into 10.6 2022-09-20 16:53:20 +03:00
debug_innodb_fail.result Merge 10.6 into 10.7 2022-09-21 09:33:07 +03:00
debug_myisam_crash.result Merge 10.5 into 10.6 2022-09-20 16:53:20 +03:00
debug_myisam_fail.result Merge 10.6 into 10.7 2022-09-21 09:33:07 +03:00
engine_defined_part_attributes.result Merge 10.7 into 10.8 2022-09-21 09:52:09 +03:00
fulltext.result MDEV-17627 Assertion `inited==RND' failed in handler::ha_rnd_end() upon actions on partitioned table with FTS 2019-07-12 19:38:10 +02:00
insert_ignore-5421.result
longname.result Merge 10.5 into 10.6 2022-09-20 16:53:20 +03:00
mdev_21007.result MDEV-21007 Do not assert auto_increment_value unless all parts open 2024-04-08 16:35:21 +10:00
mdev_24610.result MDEV-24610 MEMORY SE: check overflow in info calls with HA_STATUS_AUTO 2024-05-22 09:18:09 +10:00
optimizer.result MDEV-16188 Post-merge corrections and adjustments 2019-02-04 22:44:33 -08:00
part_blocked_sql_func_innodb.result
part_blocked_sql_func_myisam.result
part_ctype_tis620.result Merge 10.4 into 10.5 2022-11-30 13:10:52 +02:00
part_ctype_utf32.result
part_supported_sql_func_innodb.result MDEV-29446 Change SHOW CREATE TABLE to display default collation 2022-09-12 22:10:39 +04:00
part_supported_sql_func_myisam.result MDEV-29446 Change SHOW CREATE TABLE to display default collation 2022-09-12 22:10:39 +04:00
partition_alter1_1_2_innodb.result Merge 10.3 into 10.4 2022-09-13 16:36:38 +03:00
partition_alter1_1_2_myisam.result Merge 10.3 into 10.4 2022-09-13 16:36:38 +03:00
partition_alter1_1_innodb.result Merge 10.3 into 10.4 2022-09-13 16:36:38 +03:00
partition_alter1_1_myisam.result Merge 10.3 into 10.4 2022-09-13 16:36:38 +03:00
partition_alter1_2_innodb.result Merge 10.5 into 10.6 2022-09-20 16:53:20 +03:00
partition_alter1_2_myisam.result Merge 10.3 into 10.4 2022-09-13 16:36:38 +03:00
partition_alter2_1_1_innodb.result Merge 10.3 into 10.4 2022-09-13 16:36:38 +03:00
partition_alter2_1_2_innodb.result Merge 10.3 into 10.4 2022-09-13 16:36:38 +03:00
partition_alter2_1_maria.result Merge 10.3 into 10.4 2022-09-13 16:36:38 +03:00
partition_alter2_1_myisam.result Merge 10.3 into 10.4 2022-09-13 16:36:38 +03:00
partition_alter2_2_1_innodb.result Merge 10.3 into 10.4 2022-09-13 16:36:38 +03:00
partition_alter2_2_2_innodb.result Merge 10.3 into 10.4 2022-09-13 16:36:38 +03:00
partition_alter2_2_maria.result Merge 10.3 into 10.4 2022-09-13 16:36:38 +03:00
partition_alter2_2_myisam.result Merge 10.3 into 10.4 2022-09-13 16:36:38 +03:00
partition_alter3_innodb.result Merge 10.5 into 10.6 2022-09-20 16:53:20 +03:00
partition_alter3_myisam.result MDEV-29446 Change SHOW CREATE TABLE to display default collation 2022-09-12 22:10:39 +04:00
partition_alter4_innodb.result Merge 10.6 into 10.11 2024-02-14 16:12:53 +02:00
partition_alter4_myisam.result Merge 10.6 into 10.11 2024-02-14 16:12:53 +02:00
partition_alter_innodb.result MDEV-38928 Assertion `undo_no <= 1' failed in trx_t::reset_and_truncate_undo() 2026-03-05 22:53:07 +05:30
partition_alter_instant.result Merge 10.3 into 10.4 2022-09-13 16:36:38 +03:00
partition_alter_maria.result MDEV-29446 Change SHOW CREATE TABLE to display default collation 2022-09-12 22:10:39 +04:00
partition_alter_myisam.result Merge branch '10.6' into 10.11 2024-05-10 20:02:18 +02:00
partition_auto_increment_archive.result MDEV-29446 Change SHOW CREATE TABLE to display default collation 2022-09-12 22:10:39 +04:00
partition_auto_increment_blackhole.result MDEV-29636 Assertion `part_share->auto_inc_initialized || !can_use_for_auto_inc_init()' failed in ha_partition::set_auto_increment_if_higher upon REPLACE with partition pruning 2022-12-07 16:34:56 +09:00
partition_auto_increment_innodb.result Merge 10.5 into 10.6 2022-12-13 16:58:58 +02:00
partition_auto_increment_maria.result MDEV-29636 Assertion `part_share->auto_inc_initialized || !can_use_for_auto_inc_init()' failed in ha_partition::set_auto_increment_if_higher upon REPLACE with partition pruning 2022-12-07 16:34:56 +09:00
partition_auto_increment_max.result MDEV-9519: Data corruption will happen on the Galera cluster size change 2019-02-26 08:09:04 +02:00
partition_auto_increment_memory.result MDEV-29636 Assertion `part_share->auto_inc_initialized || !can_use_for_auto_inc_init()' failed in ha_partition::set_auto_increment_if_higher upon REPLACE with partition pruning 2022-12-07 16:34:56 +09:00
partition_auto_increment_myisam.result MDEV-29636 Assertion `part_share->auto_inc_initialized || !can_use_for_auto_inc_init()' failed in ha_partition::set_auto_increment_if_higher upon REPLACE with partition pruning 2022-12-07 16:34:56 +09:00
partition_basic_innodb.result Merge 10.3 into 10.4 2022-09-13 16:36:38 +03:00
partition_basic_myisam.result Merge 10.3 into 10.4 2022-09-13 16:36:38 +03:00
partition_basic_symlink_innodb.result Merge remote-tracking branch 'origin/10.4' into 10.5 2022-09-14 16:24:51 +04:00
partition_basic_symlink_myisam.result Merge 10.3 into 10.4 2022-09-13 16:36:38 +03:00
partition_bigint_innodb.result MDEV-29446 Change SHOW CREATE TABLE to display default collation 2022-09-12 22:10:39 +04:00
partition_bigint_myisam.result MDEV-29446 Change SHOW CREATE TABLE to display default collation 2022-09-12 22:10:39 +04:00
partition_bit_innodb.result MDEV-29446 Change SHOW CREATE TABLE to display default collation 2022-09-12 22:10:39 +04:00
partition_bit_myisam.result MDEV-29446 Change SHOW CREATE TABLE to display default collation 2022-09-12 22:10:39 +04:00
partition_char_innodb.result MDEV-29446 Change SHOW CREATE TABLE to display default collation 2022-09-12 22:10:39 +04:00
partition_char_myisam.result MDEV-29446 Change SHOW CREATE TABLE to display default collation 2022-09-12 22:10:39 +04:00
partition_datetime_innodb.result MDEV-29446 Change SHOW CREATE TABLE to display default collation 2022-09-12 22:10:39 +04:00
partition_datetime_myisam.result MDEV-29446 Change SHOW CREATE TABLE to display default collation 2022-09-12 22:10:39 +04:00
partition_debug.result Merge 10.6 into 10.11 2024-10-03 10:55:08 +03:00
partition_debug_innodb.result Merge 10.6 into 10.7 2022-09-21 09:33:07 +03:00
partition_debug_sync_innodb.result Merge 10.5 into 10.6 2022-09-20 16:53:20 +03:00
partition_decimal_innodb.result MDEV-29446 Change SHOW CREATE TABLE to display default collation 2022-09-12 22:10:39 +04:00
partition_decimal_myisam.result MDEV-29446 Change SHOW CREATE TABLE to display default collation 2022-09-12 22:10:39 +04:00
partition_double_innodb.result MDEV-29446 Change SHOW CREATE TABLE to display default collation 2022-09-12 22:10:39 +04:00
partition_double_myisam.result MDEV-29446 Change SHOW CREATE TABLE to display default collation 2022-09-12 22:10:39 +04:00
partition_engine_innodb.result Merge remote-tracking branch 'origin/10.4' into 10.5 2022-09-14 16:24:51 +04:00
partition_engine_myisam.result Merge remote-tracking branch 'origin/10.4' into 10.5 2022-09-14 16:24:51 +04:00
partition_exch_innodb.result
partition_exch_myisam.result
partition_exch_myisam_innodb.result cleanup parts.partition_exch_* tests 2017-09-18 10:40:26 +02:00
partition_exch_qa.result
partition_exch_qa_1_innodb.result MDEV-29446 Change SHOW CREATE TABLE to display default collation 2022-09-12 22:10:39 +04:00
partition_exch_qa_1_myisam.result MDEV-29446 Change SHOW CREATE TABLE to display default collation 2022-09-12 22:10:39 +04:00
partition_exch_qa_2.result cleanup parts.partition_exch_* tests 2017-09-18 10:40:26 +02:00
partition_exch_qa_3.result cleanup parts.partition_exch_* tests 2017-09-18 10:40:26 +02:00
partition_exch_qa_4_innodb.result
partition_exch_qa_4_myisam.result
partition_exch_qa_5_innodb.result MDEV-28548: ER_TABLEACCESS_DENIED_ERROR is missing information about DB 2022-09-30 08:48:57 +02:00
partition_exch_qa_5_myisam.result MDEV-28548: ER_TABLEACCESS_DENIED_ERROR is missing information about DB 2022-09-30 08:48:57 +02:00
partition_exch_qa_6.result MDEV-28548: ER_TABLEACCESS_DENIED_ERROR is missing information about DB 2022-09-30 08:48:57 +02:00
partition_exch_qa_7_innodb.result MDEV-5215 prerequisite: remove test and test_* database hacks in the test suite 2022-11-01 16:33:00 +01:00
partition_exch_qa_7_myisam.result MDEV-5215 prerequisite: remove test and test_* database hacks in the test suite 2022-11-01 16:33:00 +01:00
partition_exch_qa_8_innodb.result MDEV-28548: ER_TABLEACCESS_DENIED_ERROR is missing information about DB 2022-09-30 08:48:57 +02:00
partition_exch_qa_8_myisam.result MDEV-28548: ER_TABLEACCESS_DENIED_ERROR is missing information about DB 2022-09-30 08:48:57 +02:00
partition_exch_qa_10.result
partition_exch_qa_11.result
partition_exch_qa_12.result
partition_exch_qa_13.result
partition_exch_qa_14.result MDEV-13157 Specifying DATA DIRECTORY in tables leads to failing EXCHANGE PARTITION 2017-09-18 10:40:26 +02:00
partition_exch_qa_15.result cleanup parts.partition_exch_* tests 2017-09-18 10:40:26 +02:00
partition_exchange_archive.result
partition_exchange_blackhole.result
partition_exchange_innodb.result MDEV-29446 Change SHOW CREATE TABLE to display default collation 2022-09-12 22:10:39 +04:00
partition_exchange_memory.result MDEV-29446 Change SHOW CREATE TABLE to display default collation 2022-09-12 22:10:39 +04:00
partition_exchange_myisam.result MDEV-29446 Change SHOW CREATE TABLE to display default collation 2022-09-12 22:10:39 +04:00
partition_float_innodb.result MDEV-29446 Change SHOW CREATE TABLE to display default collation 2022-09-12 22:10:39 +04:00
partition_float_myisam.result MDEV-29446 Change SHOW CREATE TABLE to display default collation 2022-09-12 22:10:39 +04:00
partition_innodb_status_file.result
partition_int_innodb.result MDEV-29446 Change SHOW CREATE TABLE to display default collation 2022-09-12 22:10:39 +04:00
partition_int_myisam.result MDEV-29446 Change SHOW CREATE TABLE to display default collation 2022-09-12 22:10:39 +04:00
partition_mdev6067.result
partition_mediumint_innodb.result MDEV-29446 Change SHOW CREATE TABLE to display default collation 2022-09-12 22:10:39 +04:00
partition_mediumint_myisam.result MDEV-29446 Change SHOW CREATE TABLE to display default collation 2022-09-12 22:10:39 +04:00
partition_mgm_lc0_archive.result
partition_mgm_lc0_innodb.result MDEV-21472: ALTER TABLE ... ANALYZE PARTITION ... with EITS reads and locks all rows 2024-01-30 09:19:01 +02:00
partition_mgm_lc0_memory.result MDEV-21472: ALTER TABLE ... ANALYZE PARTITION ... with EITS reads and locks all rows 2024-01-30 09:19:01 +02:00
partition_mgm_lc0_myisam.result MDEV-21472: ALTER TABLE ... ANALYZE PARTITION ... with EITS reads and locks all rows 2024-01-30 09:19:01 +02:00
partition_mgm_lc1_archive.result
partition_mgm_lc1_innodb.result MDEV-21472: ALTER TABLE ... ANALYZE PARTITION ... with EITS reads and locks all rows 2024-01-30 09:19:01 +02:00
partition_mgm_lc1_memory.result MDEV-21472: ALTER TABLE ... ANALYZE PARTITION ... with EITS reads and locks all rows 2024-01-30 09:19:01 +02:00
partition_mgm_lc1_myisam.result MDEV-21472: ALTER TABLE ... ANALYZE PARTITION ... with EITS reads and locks all rows 2024-01-30 09:19:01 +02:00
partition_mgm_lc2_archive.result
partition_mgm_lc2_innodb.result MDEV-35648 Update partition lc2 tests for mac 2024-12-17 15:28:33 +11:00
partition_mgm_lc2_memory.result MDEV-35648 Update partition lc2 tests for mac 2024-12-17 15:28:33 +11:00
partition_mgm_lc2_myisam.result MDEV-35648 Update partition lc2 tests for mac 2024-12-17 15:28:33 +11:00
partition_open.result introduce hton->drop_table() method 2020-07-04 01:44:46 +02:00
partition_purge.result MDEV-32050 fixup: Stabilize tests 2023-11-21 12:42:00 +02:00
partition_recover_myisam.result Merge branch '10.5' into 10.6 2024-05-08 20:06:00 +02:00
partition_repair_myisam.result Add support for minimum field width for strings to my_vsnprintf() 2021-05-19 22:27:29 +02:00
partition_smallint_innodb.result MDEV-29446 Change SHOW CREATE TABLE to display default collation 2022-09-12 22:10:39 +04:00
partition_smallint_myisam.result MDEV-29446 Change SHOW CREATE TABLE to display default collation 2022-09-12 22:10:39 +04:00
partition_special_innodb.result MDEV-32050: Look up tables in the purge coordinator 2023-10-25 10:08:20 +03:00
partition_special_myisam.result MDEV-29446 Change SHOW CREATE TABLE to display default collation 2022-09-12 22:10:39 +04:00
partition_syntax_innodb.result MDEV-29446 Change SHOW CREATE TABLE to display default collation 2022-09-12 22:10:39 +04:00
partition_syntax_myisam.result MDEV-29446 Change SHOW CREATE TABLE to display default collation 2022-09-12 22:10:39 +04:00
partition_t55.out
partition_tinyint_innodb.result MDEV-29446 Change SHOW CREATE TABLE to display default collation 2022-09-12 22:10:39 +04:00
partition_tinyint_myisam.result MDEV-29446 Change SHOW CREATE TABLE to display default collation 2022-09-12 22:10:39 +04:00
partition_value_innodb.result MDEV-18650: Options deprecated in previous versions - storage_engine 2020-02-13 13:42:01 +02:00
partition_value_myisam.result MDEV-18650: Options deprecated in previous versions - storage_engine 2020-02-13 13:42:01 +02:00
percona_nonflushing_analyze_debug.result MDEV-15101: Stop ANALYZE TABLE from flushing table definition cache 2020-06-12 21:15:30 +03:00
print_error.result MDEV-15336 Server crashes in handler::print_error / ha_partition::print_error upon query timeout 2018-02-24 01:28:51 +01:00
reorganize.result MDEV-23730 s3.replication_partition 'innodb,mix' segv 2020-10-21 03:09:29 +03:00
reorganize_partition_innodb.result MDEV-29446 Change SHOW CREATE TABLE to display default collation 2022-09-12 22:10:39 +04:00
rpl_partition.result Merge 10.9 into 10.10 2022-09-21 10:59:56 +03:00
show_create.result MDEV-29446 Change SHOW CREATE TABLE to display default collation 2022-09-12 22:10:39 +04:00
truncate_locked.result MDEV-15551 Server hangs or assertion `strcmp(share->unique_file_name,filename) || share->last_version' fails in test_if_reopen or unexpected ER_LOCK_DEADLOCK 2018-07-19 11:35:39 +02:00
update_and_cache.result MDEV-16741 Assertion `m_extra_cache' failed in ha_partition::late_extra_cache 2018-09-10 19:30:06 +02:00