summaryrefslogtreecommitdiff
path: root/mysql-test/suite/innodb
Commit message (Collapse)AuthorAgeFilesLines
* Merge 10.6 into 10.7Marko Mäkelä2023-01-0411-6/+121
|\
| * Remove redundant statements from a testMarko Mäkelä2023-01-042-5/+0
| |
| * Merge 10.5 into 10.6Marko Mäkelä2023-01-039-1/+121
| |\
| | * Merge 10.4 into 10.5Marko Mäkelä2023-01-039-1/+121
| | |\
| | | * Merge 10.3 into 10.4Marko Mäkelä2023-01-039-1/+121
| | | |\
| | | | * MDEV-30225 RR isolation violation with locking unique searchVlad Lesin2022-12-206-1/+116
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before the fix next-key lock was requested only if a record was delete-marked for locking unique search in RR isolation level. There can be several delete-marked records for the same unique key, that's why InnoDB scans the records until eighter non-delete-marked record is reached or all delete-marked records with the same unique key are scanned. For range scan next-key locks are used for RR to protect scanned range from inserting new records by other transactions. And this is the reason of why next-key locks are used for delete-marked records for unique searches. If a record is not delete-marked, the requested lock type was "not-gap". When a record is not delete-marked during lock request by trx 1, and some other transaction holds conflicting lock, trx 1 creates waiting not-gap lock on the record and suspends. During trx 1 suspending the record can be delete-marked. And when the lock is granted on conflicting transaction commit or rollback, its type is still "not-gap". So we have "not-gap" lock on delete-marked record for RR. And this let some other transaction to insert some record with the same unique key when trx 1 is not committed, what can cause isolation level violation. The fix is to set next-key locks for both delete-marked and non-delete-marked records for unique search in RR.
| | | | * MDEV-30233 DROP DATABASE test fails: Directory not emptyMarko Mäkelä2022-12-153-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some tests drop the default mtr database "test". This may fail due to the directory not being empty. InnoDB may not delete all tables immediately, due to the "background drop table queue" or its replacement in commit 1bd681c8b3c5213ce1f7976940a7dc38b48a0d39 (the purge of history would clean up after a DDL operation during which the server was killed). Let us try to avoid "drop database test" whenever it is easily possible. Where it is not, SET GLOBAL innodb_max_purge_lag_wait=0 will ensure that the replacement of the "background drop table queue" will have completed its job.
* | | | | MDEV-30321: blob data corrupted by row_merge_write_blob_to_tmp_file()Michael Roosz2023-01-042-0/+32
| | | | |
* | | | | Merge 10.6 into 10.7Marko Mäkelä2022-12-1317-21/+382
|\ \ \ \ \ | |/ / / /
| * | | | Merge 10.5 into 10.6Marko Mäkelä2022-12-1317-21/+382
| |\ \ \ \ | | |/ / /
| | * | | Merge 10.4 into 10.5Marko Mäkelä2022-12-1317-22/+381
| | |\ \ \ | | | |/ /
| | | * | Merge 10.3 into 10.4Marko Mäkelä2022-12-1312-15/+369
| | | |\ \ | | | | |/
| | | | * MDEV-29144 ER_TABLE_SCHEMA_MISMATCH or crash on DISCARD/IMPORTMarko Mäkelä2022-12-092-0/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mysql_discard_or_import_tablespace(): On successful ALTER TABLE...DISCARD TABLESPACE, evict the table handle from the table definition cache, so that ha_innobase::close() will be invoked, like InnoDB expects to be the case. This will avoid an assertion failure ut_a(table->get_ref_count() == 0) during IMPORT TABLESPACE. ha_innobase::open(): Do not issue any ER_TABLESPACE_DISCARDED warning. Member functions for DML will do that. ha_innobase::truncate(), ha_innobase::check_if_supported_inplace_alter(): Issue ER_TABLESPACE_DISCARDED warnings, to compensate for the removal of the warning in ha_innobase::open(). row_quiesce_write_indexes(): Only write information about committed indexes. The ALTER TABLE t NOWAIT ADD INDEX(c) in the nondeterministic test case will most of the time fail due to a metadata lock (MDL) timeout and leave behind an uncommitted index. Reviewed by: Sergei Golubchik
| | | | * Add a global suppression for O_DIRECT failuresMarko Mäkelä2022-11-291-6/+0
| | | | | | | | | | | | | | | | | | | | Fixes up commit b8ad6fbd95830b61d282abc1167300fff261be7e
| | | | * Fixed warning from innodb.create_isl_with_direct if have_symlink is disabledbb-10.3-montyMonty2022-11-291-6/+5
| | | | |
| | | | * MDEV-29977 Memory leak in row_log_table_apply_updateThirunarayanan Balathandayuthapani2022-11-152-4/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - InnoDB fails to free the persistent cursor for the clustered index when InnoDB replays the update operation on the table that is being rebuilt.
| | | | * MDEV-27882 Innodb - recognise MySQL-8.0 innodb flags and give a specific ↵Daniel Black2022-11-116-8/+122
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | error message Per fsp0types.h, SDI is on tablespace flags position 14 where MariaDB stores its pagesize. Flag at position 13, also in MariaDB pagesize flags, is a MySQL encryption flag. These are checked only if fsp_flags_is_valid fails, so valid MariaDB pages sizes don't become errors. The error message "Cannot reset LSNs in table" was rather specific and not always true to replaced with more generic error. ALTER TABLE tbl IMPORT TABLESPACE now reports Unsupported on MySQL tablespace (rather than index corrupted) along with a server error message. MySQL innodb Errors are with with UNSUPPORTED rather than CORRUPTED to avoid user anxiety. Reviewer: Marko Mäkelä
| | | | * MDEV-10087 mysqld_update()/mysql_delete() continues execution even after ↵Vlad Lesin2022-11-092-0/+131
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | subquery with JOIN gets error from storage engine The issue is that record_should_be_deleted() returns true in mysql_delete() even if sub-select with join gets error from storage engine when DELETE FROM ... WHERE ... IN (SELECT ...) statement is executed. The same is true for mysql_update() where select->skip_record() returns true even if sub-select with join gets error from storage engine. In the test case if sub-select is chosen as deadlock victim the whole transaction is rolled back during sub-select execution, but mysql_delete()/mysql_update() continues transaction execution and invokes table->delete_row() as record_should_be_deleted() wrongly returns true in mysql_delete() and table->update_row() as select->skip_record(thd) wrongly returns 1 for mysql_update(). record_should_be_deleted() wrogly returns true because thd->is_error() returns false SQL_SELECT::skip_record() invoked from record_should_be_deleted(). It's supposed that THD error should be set in rr_handle_error() called from rr_sequential() during sub-select JOIN::exec_inner() execution. But rr_handle_error() does not set THD error because READ_RECORD::print_error is not set in JOIN_TAB::read_record. READ_RECORD::print_error should be initialized in init_read_record()/init_read_record_idx(). But make_join_readinfo() does not invoke init_read_record()/init_read_record_idx() for JOIN_TAB::read_record. The fix is to set JOIN_TAB::read_record.print_error in make_join_readinfo(), i.e. in the same place where JOIN_TAB::read_record.table is set. Reviewed by Sergey Petrunya.
| | | * | MDEV-27670 Assertion `(cs->state & 0x20000) == 0' failed in ↵Alexander Barkov2022-11-222-0/+128
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | my_strnncollsp_nchars_generic_8bit Also fixes: MDEV-27768 MDEV-25440: Assertion `(cs->state & 0x20000) == 0' failed in my_strnncollsp_nchars_generic_8bit The "strnncollsp_nchars" virtual function pointer for tis620_thai_nopad_ci was incorrectly initialized to a generic function my_strnncollsp_nchars_generic_8bit(), which crashed on assert. Implementing a tis620 specific function version.
* | | | | Merge 10.6 into 10.7Marko Mäkelä2022-12-072-0/+128
|\ \ \ \ \ | |/ / / /
| * | | | Merge 10.5 into 10.6Marko Mäkelä2022-12-052-0/+128
| |\ \ \ \ | | |/ / /
| | * | | Merge 10.4 into 10.5Jan Lindström2022-11-302-0/+128
| | | | |
* | | | | Merge 10.6 into 10.7Marko Mäkelä2022-11-304-45/+137
|\ \ \ \ \ | |/ / / /
| * | | | Merge 10.5 into 10.6Marko Mäkelä2022-11-301-0/+2
| |\ \ \ \ | | |/ / /
| | * | | MDEV-24412: Disable the test on ./mtr --embeddedMarko Mäkelä2022-11-301-0/+2
| | | | |
| * | | | Merge 10.5 into 10.6Marko Mäkelä2022-11-304-45/+135
| |\ \ \ \ | | |/ / /
| | * | | MDEV-24412: Create a separate testMarko Mäkelä2022-11-304-45/+135
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some builders in our CI, most notably FreeBSD and IBM AIX, do not support sparse files. Also, Microsoft Windows requires special means for creating sparse files. Since these platforms do not run ./mtr --big-test, we will for now simply move the test to a separate file that requires that option.
* | | | | Merge 10.6 into 10.7Marko Mäkelä2022-11-282-1/+46
|\ \ \ \ \ | |/ / / /
| * | | | Merge 10.5 into 10.6Marko Mäkelä2022-11-282-1/+46
| |\ \ \ \ | | |/ / /
| | * | | MDEV-24412 InnoDB: Upgrade after a crash is not supportedMarko Mäkelä2022-11-282-1/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | recv_log_recover_10_4(): Widen the operand of bitwise and to 64 bits, so that the upgrade check will work when the redo log record is located more than 4 gigabytes from the start of the first file.
| | * | | MDEV-30106 InnoDB fails to validate the change buffer on startupMarko Mäkelä2022-11-281-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ibuf_init_at_db_start(): Validate the change buffer root page. A later version may stop creating a change buffer, and this validation check will prevent a downgrade from such later versions. ibuf_max_size_update(): If the change buffer was not loaded, do nothing. dict_boot(): Merge the local variable "error" to "err". Ignore failures of ibuf_init_at_db_start() if innodb_force_recovery>=4.
* | | | | Merge 10.6 into 10.7Marko Mäkelä2022-11-242-3/+5
|\ \ \ \ \ | |/ / / /
| * | | | Merge 10.5 into 10.6Marko Mäkelä2022-11-232-3/+5
| |\ \ \ \ | | |/ / /
* | | | | Merge 10.6 into 10.7Marko Mäkelä2022-11-178-9/+169
|\ \ \ \ \ | |/ / / /
| * | | | MDEV-29978 Corruption errors upon CHECK on temporary InnoDB tableMarko Mäkelä2022-11-142-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | row_check_index(): Treat secondary indexes of temporary tables as if SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED is in effect. That is, only consider the delete-mark and nothing else.
| * | | | MDEV-27214 Import with disabled keys corrupts meta-data like rows, indexes, ...Alexander Barkov2022-11-114-6/+123
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This bug was previously fixed in 10.6.11 by: MDEV-28327 InnoDB persistent statistics fail to update after bulk insert Adding MTR tests only. Also, fixing the old test for MDEV-28327 to make "mtr" reliably pass with/without --mysqld=--innodb-stats-persistent=0, and with different page sizes, as suggested by Marko.
* | | | | Merge 10.6 into 10.7Marko Mäkelä2022-11-103-0/+3
|\ \ \ \ \ | |/ / / /
| * | | | MDEV-29710: Disable some more tests on ValgrindMarko Mäkelä2022-11-103-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A number of tests often trip warnings on Valgrind, because Valgrind runs all threads in a single thread and may cause starvation: InnoDB: A long wait (... seconds) was observed for dict_sys.latch Let us disable those tests on Valgrind in order to avoid bogus failures.
* | | | | Merge 10.6 into 10.7Marko Mäkelä2022-11-0910-12/+95
|\ \ \ \ \ | |/ / / /
| * | | | Add an end marker to a testMarko Mäkelä2022-11-092-0/+3
| | | | |
| * | | | MDEV-29504/MDEV-29849 TRUNCATE breaks FOREIGN KEY lockingMarko Mäkelä2022-11-088-12/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ha_innobase::referenced_by_foreign_key(): Protect the check with dict_sys.freeze(), to prevent races with TRUNCATE TABLE. The test innodb.instant_alter_crash has been adjusted for this additional locking. dict_table_is_referenced_by_foreign_key(): Removed (merged to the only caller). create_table_info_t::create_table(): Ignore missing indexes for FOREIGN KEY constraints if foreign_key_checks=0. create_table_info_t::create_table_update_dict(): Rewritten as a static function. Do not return any error. ha_innobase::create(): When trx!=nullptr and we are operating on a persistent table, do not rollback, commit, or release the data dictionary latch. ha_innobase::truncate(): Protect the entire critical section with an exclusive dict_sys.latch, so that ha_innobase::referenced_by_foreign_key() on referenced tables will return a consistent result. In case of a failure, invoke dict_load_foreigns() to restore also any FOREIGN KEY constraints. ha_innobase::free_foreign_key_create_info(): Define inline. lock_release(): Disregard innodb_evict_tables_on_commit_debug=ON when dict_sys.locked() holds. It would hold when fts_load_stopword() is invoked by create_table_info_t::create_table_update_dict(). dict_sys_t::locked(): Return whether the current thread is holding the exclusive dict_sys.latch. dict_sys_t::frozen_not_locked(): Return whether any thread is holding a shared dict_sys.latch. In the test main.mysql_upgrade, the InnoDB persistent statistics will no longer be recalculated in ha_innobase::open() as part of CHECK TABLE ... FOR UPGRADE. They were deleted earlier in the test. Tested by: Matthias Leich
* | | | | Merge branch '10.6' into 10.7Oleksandr Byelkin2022-11-022-0/+29
|\ \ \ \ \ | |/ / / /
| * | | | Merge branch '10.5' into 10.6Oleksandr Byelkin2022-11-022-0/+29
| |\ \ \ \ | | |/ / /
| | * | | MDEV-28822 Table from older version requires table rebuild when adding ↵Alexander Barkov2022-10-262-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | column to table with multi-column index This problem was earlier fixed in 10.4 by the patch for MDEV-29481. Adding MTR tests only.
* | | | | Merge branch '10.6' into 10.7Oleksandr Byelkin2022-10-2915-27/+264
|\ \ \ \ \ | |/ / / /
| * | | | MDEV-29886 Assertion !index->table->is_temporary() failed in CHECK TABLEMarko Mäkelä2022-10-262-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ha_innobase::check(): Do not enable READ UNCOMMITTED isolation level for temporary tables, because it would report index count mismatch for secondary indexes. row_check_index(): Ignore EXTENDED for temporary tables, because the tables are private to the current connection and there will be no purge of committed transaction history.
| * | | | MDEV-29869 mtr failure: innodb.deadlock_wait_thr_raceVlad Lesin2022-10-267-26/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. The merge aeccbbd926e759a5c3b9818d9948a35918404478 has overwritten lock0lock.cc, and the changes of MDEV-29622 and MDEV-29635 were partially lost, this commit restores the changes. 2. innodb.deadlock_wait_thr_race test: The following hang was found during testing. There is deadlock_report_before_lock_releasing sync point in Deadlock::report(), which is waiting for sel_cont signal under lock_sys_t lock. The signal must be issued after "UPDATE t SET b = 100" rollback, and that rollback is executing undo record, which is blocked on dict_sys latch request. dict_sys is locked by the thread of statistics update(dict_stats_save()), and during that update lock_sys lock is requested, and can't be acquired as Deadlock::report() holds it. We have to disable statistics update to make the test stable. But even if statistics update is disabled, and transaction with consistent snapshot is started at the very beginning of the test to prevent purging, the purge can still be invoked for system tables, and it tries to open system table by id, what causes dict_sys.freeze() call and dict_sys latching. What, in combination with lock_sys::xx_lock() causes the same deadlock as described above. We need to disable purging globally for the test as well. All the above is applicable to innodb.deadlock_wait_lock_race test also.
| * | | | MDEV-29662 Replace same values in 'IN' list with an equalityOleg Smirnov2022-10-261-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If all elements in the list of 'IN' or 'NOT IN' clause are equal and there are no NULLs then clause - "a IN (e1,..,en)" can be converted to "a = e1" - "a NOT IN (e1,..,en)" can be converted to "a <> e1". This means an object of Item_func_in can be replaced with an object of Item_func_eq for IN (e1,..,en) clause and Item_func_ne for NOT IN (e1,...,en). Such a replacement allows the optimizer to choose a better execution plan
| * | | | Merge 10.5 into 10.6Marko Mäkelä2022-10-254-0/+182
| |\ \ \ \ | | |/ / / | | | | | | | | | | | | | | | | | | | | To prevent ASAN heap-use-after-poison in the MDEV-16549 part of ./mtr --repeat=6 main.derived the initialization of Name_resolution_context was cleaned up.
| | * | | Merge 10.4 into 10.5Marko Mäkelä2022-10-252-0/+72
| | |\ \ \ | | | |/ /