summaryrefslogtreecommitdiff
path: root/mysql-test/suite/innodb/t
Commit message (Collapse)AuthorAgeFilesLines
* MDEV-21921 Make transaction_isolation and transaction_read_only into system ↵Junqi Xie2023-04-129-33/+33
| | | | | | | | | | | | | | variables In MariaDB, we have a confusing problem where: * The transaction_isolation option can be set in a configuration file, but it cannot be set dynamically. * The tx_isolation system variable can be set dynamically, but it cannot be set in a configuration file. Therefore, we have two different names for the same thing in different contexts. This is needlessly confusing, and it complicates the documentation. The same thing applys for transaction_read_only. MySQL 5.7 solved this problem by making them into system variables. https://dev.mysql.com/doc/relnotes/mysql/5.7/en/news-5-7-20.html This commit takes a similar approach by adding new system variables and marking the original ones as deprecated. This commit also resolves some legacy problems related to SET STATEMENT and transaction_isolation.
* Merge 11.0 into 11.1Marko Mäkelä2023-03-291-0/+22
|\
| * Merge 10.11 into 11.0Marko Mäkelä2023-03-291-0/+22
| |\
| | * Merge 10.10 into 10.11Marko Mäkelä2023-03-291-0/+22
| | |\
| | | * Merge 10.9 into 10.10Marko Mäkelä2023-03-291-0/+22
| | | |\
| | | | * Merge 10.8 into 10.9Marko Mäkelä2023-03-291-0/+22
| | | | |\
| | | | | * Merge 10.6 into 10.8Marko Mäkelä2023-03-291-0/+22
| | | | | |\
| | | | | | * MDEV-29545 InnoDB: Can't find record during replace stmtThirunarayanan Balathandayuthapani2023-03-241-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: ======== - InnoDB replace statement returns can't find record as result during bulk insert operation. InnoDB returns DB_END_OF_INDEX blindly when bulk transaction is visible to current transaction even though the search tuple is inserted as a part of current replace statement. Solution: ========= row_search_mvcc(): InnoDB should allow the transaction to read all the rows when innodb intends to do any locking on the record even though bulk insert transaction changes are visible to the current transaction
* | | | | | | Merge 11.0 into 11.1Marko Mäkelä2023-03-174-0/+42
|\ \ \ \ \ \ \ | |/ / / / / /
| * | | | | | Merge 10.11 into 11.0Marko Mäkelä2023-03-174-0/+42
| |\ \ \ \ \ \ | | |/ / / / /
| | * | | | | Merge 10.10 into 10.11Marko Mäkelä2023-03-173-0/+18
| | |\ \ \ \ \ | | | |/ / / /
| | | * | | | Merge 10.9 into 10.10Marko Mäkelä2023-03-173-0/+18
| | | |\ \ \ \ | | | | |/ / /
| | | | * | | Merge 10.8 into 10.9Marko Mäkelä2023-03-173-0/+18
| | | | |\ \ \ | | | | | |/ /
| | | | | * | Merge 10.6 into 10.8Marko Mäkelä2023-03-173-0/+18
| | | | | |\ \ | | | | | | |/
| | | | | | * MDEV-30870 Undo tablespace name displays wrongly for I_S queriesThirunarayanan Balathandayuthapani2023-03-172-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - INNODB_SYS_TABLESPACES in information schema should display innodb_undo001, innodb_undo002 etc as tablespace name for undo tablespaces
| | | | | | * MDEV-29975 InnoDB fails to release savepoint during bulk insertThirunarayanan Balathandayuthapani2023-03-171-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - InnoDB does rollback the whole transaction and discards the savepoint when there is a failure happens during bulk insert operation. When server request to release the savepoint, InnoDB should return DB_SUCCESS when it deals with bulk insert operation
| | * | | | | Merge 10.10 into 10.11Marko Mäkelä2023-03-171-0/+24
| | |\ \ \ \ \ | | | |/ / / /
| | | * | | | Merge 10.9 into 10.10Marko Mäkelä2023-03-171-0/+24
| | | |\ \ \ \ | | | | |/ / /
| | | | * | | Merge 10.8 into 10.9Marko Mäkelä2023-03-171-0/+24
| | | | |\ \ \ | | | | | |/ /
| | | | | * | MDEV-30183 Assertion `!memcmp(rec_trx_id, old_pk_trx_id->data, 6 + 7)' ↵Thirunarayanan Balathandayuthapani2023-03-061-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | failed in row_log_table_apply_update - This failure caused by commit 358921ce32203a9a8dd277a5ba7ac177c9e79e53 row_ins_duplicate_online() should consider if the record is an exact match of the tuple when number of matching fields equals with number of unique fields + DB_TRX_ID + DB_ROLL_PTR
* | | | | | | MDEV-30545 Remove innodb_defragment and related parametersMarko Mäkelä2023-03-1115-777/+0
|/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The deprecated parameters will be removed: innodb_defragment innodb_defragment_n_pages innodb_defragment_stats_accuracy innodb_defragment_fill_factor_n_recs innodb_defragment_fill_factor innodb_defragment_frequency The mysql.innodb_index_stats.stat_name values 'n_page_split' and 'n_pages_freed' will lose their special meaning. The related changes to OPTIMIZE TABLE in InnoDB will be removed as well. The parameter innodb_optimize_fulltext_only will retain its special meaning in OPTIMIZE TABLE. Tested by: Matthias Leich
* | | | | | Merge 10.11 into 11.0Marko Mäkelä2023-02-285-3/+75
|\ \ \ \ \ \ | |/ / / / /
| * | | | | Merge 10.10 into 10.11Marko Mäkelä2023-02-285-3/+75
| |\ \ \ \ \ | | |/ / / /
| | * | | | Merge 10.9 into 10.10Marko Mäkelä2023-02-285-3/+75
| | |\ \ \ \ | | | |/ / /
| | | * | | Merge 10.8 into 10.9Marko Mäkelä2023-02-285-3/+75
| | | |\ \ \ | | | | |/ /
| | | | * | Merge 10.6 into 10.8Marko Mäkelä2023-02-285-3/+75
| | | | |\ \ | | | | | |/
| | | | | * Merge 10.5 into 10.6Marko Mäkelä2023-02-274-3/+17
| | | | | |\
| | | | | | * MDEV-30671 InnoDB undo log truncation fails to wait for purge of historyMarko Mäkelä2023-02-244-4/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is not safe to invoke trx_purge_free_segment() or execute innodb_undo_log_truncate=ON before all undo log records in the rollback segment has been processed. A prominent failure that would occur due to premature freeing of undo log pages is that trx_undo_get_undo_rec() would crash when trying to copy an undo log record to fetch the previous version of a record. If trx_undo_get_undo_rec() was not invoked in the unlucky time frame, then the symptom would be that some committed transaction history is never removed. This would be detected by CHECK TABLE...EXTENDED that was impleented in commit ab0190101b0587e0e03b2d75a967050b9a85fd1b. Such a garbage collection leak should be possible even when using innodb_undo_log_truncate=OFF, just involving trx_purge_free_segment(). trx_rseg_t::needs_purge: Change the type from Boolean to a transaction identifier, noting the most recent non-purged transaction, or 0 if everything has been purged. On transaction start, we initialize this to 1 more than the transaction start ID. On recovery, the field may be adjusted to the transaction end ID (TRX_UNDO_TRX_NO) if it is larger. The field TRX_UNDO_NEEDS_PURGE becomes write-only; only some debug assertions that would validate the value. The field reflects the old inaccurate Boolean field trx_rseg_t::needs_purge. trx_undo_mem_create_at_db_start(), trx_undo_lists_init(), trx_rseg_mem_restore(): Remove the parameter max_trx_id. Instead, store the maximum in trx_rseg_t::needs_purge, where trx_rseg_array_init() will find it. trx_purge_free_segment(): Contiguously hold a lock on trx_rseg_t to prevent any concurrent allocation of undo log. trx_purge_truncate_rseg_history(): Only invoke trx_purge_free_segment() if the rollback segment is empty and there are no pending transactions associated with it. trx_purge_truncate_history(): Only proceed with innodb_undo_log_truncate=ON if trx_rseg_t::needs_purge indicates that all history has been purged. Tested by: Matthias Leich
| | | | | * | MDEV-27701 Race on trx->lock.wait_lock between lock_rec_move() and ↵Vlad Lesin2023-02-201-0/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | lock_sys_t::cancel() The initial issue was in assertion failure, which checked the equality of lock to cancel with trx->lock.wait_lock in lock_sys_t::cancel(). If we analyze lock_sys_t::cancel() code from the perspective of trx->lock.wait_lock racing, we won't find the error there, except the cases when we need to reload it after the corresponding latches acquiring. So the fix is just to remove the assertion and reload trx->lock.wait_lock after acquiring necessary latches. Reviewed by: Marko Mäkelä <marko.makela@mariadb.com>
* | | | | | | MDEV-30544 Deprecate innodb_defragment and related parametersMarko Mäkelä2023-02-211-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is a little used option innodb_defragment that would make OPTIMIZE TABLE not rebuild the table as usual for InnoDB, but instead cause the index B-trees to be optimized in place. This option uses excessive locking (exclusively locking index trees). It never covered SPATIAL INDEX or FULLTEXT INDEX. Storage space was never reclaimed. Because this option is not particularly useful and causes a maintenance burden (most recently in commit de4030e4d49805a7ded5c0bfee01cc3fd7623522), it is best to deprecate it, to prepare for its removal.
* | | | | | | Merge 10.11 into 11.0Marko Mäkelä2023-02-169-5/+72
|\ \ \ \ \ \ \ | |/ / / / / /
| * | | | | | Merge 10.10 into 10.11Marko Mäkelä2023-02-165-2/+53
| |\ \ \ \ \ \ | | |/ / / / /
| | * | | | | Merge 10.9 into 10.10Marko Mäkelä2023-02-165-2/+53
| | |\ \ \ \ \ | | | |/ / / /
| | | * | | | Merge 10.8 into 10.9Marko Mäkelä2023-02-165-2/+53
| | | |\ \ \ \ | | | | |/ / /
| | | | * | | Merge 10.6 into 10.8Marko Mäkelä2023-02-161-1/+10
| | | | |\ \ \ | | | | | |/ /
| | | | | * | Merge 10.5 into 10.6Marko Mäkelä2023-02-161-1/+10
| | | | | |\ \ | | | | | | |/
| | | | | | * MDEV-30552 fixup: Fix the test for non-debugMarko Mäkelä2023-02-161-1/+10
| | | | | | |
| | | | * | | Merge 10.6 into 10.8Marko Mäkelä2023-02-162-1/+22
| | | | |\ \ \ | | | | | |/ /
| | | | | * | Merge 10.5 into 10.6Marko Mäkelä2023-02-142-1/+22
| | | | | |\ \ | | | | | | |/
| | | | | | * MDEV-30552 InnoDB recovery crashes when error handling scenarioThirunarayanan Balathandayuthapani2023-02-141-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - InnoDB fails to reset the after_apply variable before applying the redo log in last batch during multi-batch recovery.
| | | | | | * MDEV-30551 InnoDB recovery hangs when buffer pool ran out of memoryThirunarayanan Balathandayuthapani2023-02-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - During non-last batch of multi-batch recovery, InnoDB holds log_sys.mutex and preallocates the block which may intiate page flush, which may initiate log flush, which requires log_sys.mutex to acquire again. This leads to assert failure. So InnoDB recovery should release log_sys.mutex before preallocating the block.
| | | | * | | MDEV-30426 Assertion !rec_offs_nth_extern(offsets2, n) during bulk insertThirunarayanan Balathandayuthapani2023-02-142-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - cmp_rec_rec_simple() fails to detect duplicate key error for bulk insert operation
| | | | * | | Merge 10.6 into 10.8Marko Mäkelä2023-02-101-1/+2
| | | | |\ \ \ | | | | | |/ /
| | | | | * | Merge branch '10.6.12' into 10.6Oleksandr Byelkin2023-02-061-1/+2
| | | | | |\ \
| | | | | | * | Implement multiple-signal debug_syncVicențiu Ciorbaru2023-02-031-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The patch is inspired from MySQL. Instead of using a single String to hold the current active debug_sync signal, use a Hash_set to store LEX_STRINGS. This patch ensures that a signal can not be lost, by being overwritten by another thread via set DEBUG_SYNC = '... SIGNAL ...'; All signals are kepts "alive" until they are consumed by a wait event. This requires updating test cases that assume the GLOBAL signal is never consumed. Follow-up work needed: Port the additional syntax that allows one to set multiple signals and also conditionally deactivate signals when waiting.
| * | | | | | | Merge branch '10.10' into 10.11mariadb-10.11.2Oleksandr Byelkin2023-02-014-3/+19
| |\ \ \ \ \ \ \ | | |/ / / / / /
| | * | | | | | Merge branch '10.9' into 10.10mariadb-10.10.3Oleksandr Byelkin2023-02-011-0/+16
| | |\ \ \ \ \ \ | | | |/ / / / /
| | | * | | | | Merge branch '10.8' into 10.9mariadb-10.9.5Oleksandr Byelkin2023-02-011-0/+16
| | | |\ \ \ \ \ | | | | |/ / / /
| | | | * | | | Merge branch '10.7' into 10.8mariadb-10.8.7Oleksandr Byelkin2023-02-011-0/+16
| | | | |\ \ \ \
| | | | | * \ \ \ Merge branch '10.6' into 10.7mariadb-10.7.810.7Oleksandr Byelkin2023-02-011-0/+16
| | | | | |\ \ \ \ | | | | | | |/ / /