mirror of
https://github.com/MariaDB/server.git
synced 2026-03-06 00:18:40 +01:00
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 |
||
|---|---|---|
| .. | ||
| archive | ||
| atomic | ||
| binlog | ||
| binlog_encryption | ||
| client | ||
| compat | ||
| csv | ||
| encryption | ||
| engines | ||
| federated | ||
| funcs_1 | ||
| funcs_2 | ||
| galera | ||
| galera_3nodes | ||
| galera_3nodes_sr | ||
| galera_sr | ||
| gcol | ||
| handler | ||
| heap | ||
| innodb | ||
| innodb_fts | ||
| innodb_gis | ||
| innodb_i_s | ||
| innodb_zip | ||
| jp | ||
| json | ||
| large_tests | ||
| maria | ||
| mariabackup | ||
| mtr/t | ||
| mtr2 | ||
| multi_source | ||
| optimizer_unfixed_bugs | ||
| parts | ||
| perfschema | ||
| perfschema_stress | ||
| period | ||
| plugins | ||
| roles | ||
| rpl | ||
| s3 | ||
| sql_sequence | ||
| storage_engine | ||
| stress | ||
| sys_vars | ||
| sysschema | ||
| unit | ||
| vcol | ||
| versioning | ||
| wsrep | ||