mariadb/mysql-test/suite
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
..
archive Merge branch '10.6' into '10.11' 2025-04-16 03:34:40 +02:00
atomic Merge branch '10.6' into 10.11 2025-04-26 10:47:03 +02:00
binlog MDEV-38769: rollback on CREATE TEMPORARY TABLE ... SELECT errors 2026-02-06 14:24:16 +02:00
binlog_encryption cleanup: select ... into tests 2025-07-17 09:18:18 +02:00
client
compat MDEV-38451 SHOW FUNCTION CODE package_func crashes on the second execution 2026-01-13 15:37:08 +04:00
csv
encryption Merge 10.6 into 10.11 2026-02-19 09:46:55 +02:00
engines MDEV-38506 fix the test 2026-01-26 10:01:31 +01:00
federated MDEV-29874: FederatedX error 10000 on multi-table UPDATE/DELETE 2025-10-22 15:35:54 +07:00
funcs_1 MDEV-38471 - funcs_1.processlist_val_no_prot fails sporadically 2026-01-23 20:49:53 +04:00
funcs_2 Merge 10.5 into 10.6 2025-03-26 17:09:57 +02:00
galera MDEV-38385 Galera test failure on MDEV-30418 2026-02-15 09:22:53 +02:00
galera_3nodes MDEV-37816: galera tests failing with Table performance_schema.xxx doesn't exist 2025-10-09 16:01:09 +11:00
galera_3nodes_sr galera mtr tests: synchronization between branches and editions 2025-04-02 04:50:11 +02:00
galera_sr MDEV-34124: Make sequences work with streaming replication 2025-11-25 13:01:26 +02:00
gcol MDEV-38006 Inconsistent behaviors when casting into time 2026-01-14 19:44:54 +01:00
handler Merge branch '10.5' into 10.6 2024-12-17 11:06:09 +11:00
heap Merge branch '10.6' into 10.11 2025-01-30 11:55:13 +01:00
innodb MDEV-38928 Assertion `undo_no <= 1' failed in trx_t::reset_and_truncate_undo() 2026-03-05 22:53:07 +05:30
innodb_fts Merge branch '10.6' into 10.11 2026-01-28 14:22:20 +01:00
innodb_gis Merge 10.6 into 10.11 2026-02-19 09:46:55 +02:00
innodb_i_s
innodb_zip MDEV-37138: Innochecksum fails to handle doublewrite buffer and 2025-11-11 13:43:43 +05:30
jp
json MDEV-34081: View containing JSON_TABLE does not return JSON 2025-10-22 22:49:26 +05:30
large_tests
maria MDEV-38087 Unexpected error Unknown column '???' in 'GROUP BY' 2026-01-14 19:44:30 +01:00
mariabackup MDEV-38246 aria_read index failed on encrypted database during backup 2026-01-29 20:53:42 +01:00
mtr/t Remove dates from all rdiff files 2025-01-05 16:40:11 +02:00
mtr2
multi_source MDEV-7611: create multi_source.mariadb-dump_slave 2025-07-10 18:31:36 -06:00
optimizer_unfixed_bugs
parts MDEV-38928 Assertion `undo_no <= 1' failed in trx_t::reset_and_truncate_undo() 2026-03-05 22:53:07 +05:30
perfschema MDEV-38531 - perfschema.statement_digest_consumers2 fails sporadically 2026-01-13 03:28:00 +04:00
perfschema_stress
period Merge branch '10.6' into 10.11 2025-09-12 13:08:40 +02:00
plugins Merge branch '10.6' into 10.11 2026-01-28 14:22:20 +01:00
roles Merge branch '10.6' into 10.11 2025-01-30 11:55:13 +01:00
rpl MDEV-38825 Slave delays when there is "nothing" to replicate 2026-02-28 00:13:32 -07:00
s3 Merge branch '10.6' into 10.11 2025-06-04 14:09:23 +02:00
sql_sequence MDEV-38815 Server crashes in Item_func_nextval::val_int upon update on a view 2026-02-16 17:03:06 +03:00
storage_engine
stress
sys_vars MDEV-38671: Default to large innodb_buffer_pool_size_max (except on AIX) 2026-03-02 11:30:56 +02:00
sysschema MDEV-37979 sys.ps_setup_save does not restore SQL_LOG_BIN after error, causes replication discrepancy 2026-01-14 19:44:30 +01:00
unit
vcol Improvements for myisamchk 2025-09-04 18:08:39 +03:00
versioning MDEV-38710 Assertion is_lock_owner on error returning from auto-create in mysql_admin_table 2026-01-31 11:42:12 +01:00
wsrep Galera library 26.4.25 contains gcs protocol change 5-->6 2025-11-27 11:40:21 +02:00