summaryrefslogtreecommitdiff
path: root/mysql-test/suite
Commit message (Collapse)AuthorAgeFilesLines
* Merge 10.6 into 10.7Marko Mäkelä2021-09-072-1/+5
|\
| * Added galera MTR failed tests in diasbled listRamesh Sivaraman2021-09-072-1/+5
| |
* | Merge 10.6 into 10.7Marko Mäkelä2021-09-063-17/+87
|\ \ | |/
| * Merge 10.5 into 10.6Marko Mäkelä2021-09-063-17/+87
| |\
| | * Added support for CHECK TABLE for S3 tablesMonty2021-09-013-18/+32
| | | | | | | | | | | | | | | | | | | | | | | | Other things: - Don't allocate an IO_CACHE for scanning tables of type BLOCK (It was never used in this case) - Fixed bug in page cache that cased a hang when trying to read a not existing S3 block.
| | * Added support for ANALYZE TABLE to S3 tablesMonty2021-09-013-3/+59
| | | | | | | | | | | | | | | Other things - Cleaned up error messages for CHECK, REPAIR and OPTIMIZE
* | | MDEV-26352 : Add new thread states for certain WSREP scenariosJan Lindström2021-09-035-30/+42
| | | | | | | | | | | | | | | | | | | | | | | | This adds following new thread states: * waiting to execute in isolation - DDL is waiting to execute in TOI mode. * waiting for TOI DDL - some other statement is waiting for DDL to complete. * waiting for flow control - some statement is paused while flow control is in effect. * waiting for certification - the transaction is being certified.
* | | Merge 10.6 into 10.7Marko Mäkelä2021-08-3197-1801/+2094
|\ \ \ | |/ /
| * | MDEV-4750 follow-up: Reduce disabling innodb_stats_persistentMarko Mäkelä2021-08-3189-1711/+2044
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This essentially reverts commit 4e89ec6692786bc1cbdce64d43d8e85a5d247dab and only disables InnoDB persistent statistics for tests where it is desirable. By design, InnoDB persistent statistics will not be updated except by ANALYZE TABLE or by STATS_AUTO_RECALC. The internal transactions that update persistent InnoDB statistics in background tasks (with innodb_stats_auto_recalc=ON) may cause nondeterministic query plans or interfere with some tests that deal with other InnoDB internals, such as the purge of transaction history.
| * | MDEV-25919: Lock tables before acquiring dict_sys.latchMarko Mäkelä2021-08-319-92/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In commit 1bd681c8b3c5213ce1f7976940a7dc38b48a0d39 (MDEV-25506 part 3) we introduced a "fake instant timeout" when a transaction would wait for a table or record lock while holding dict_sys.latch. This prevented a deadlock of the server but could cause bogus errors for operations on the InnoDB persistent statistics tables. A better fix is to ensure that whenever a transaction is being executed in the InnoDB internal SQL parser (which will for now require dict_sys.latch to be held), it will already have acquired all locks that could be required for the execution. So, we will acquire the following locks upfront, before acquiring dict_sys.latch: (1) MDL on the affected user table (acquired by the SQL layer) (2) If applicable (not for RENAME TABLE): InnoDB table lock (3) If persistent statistics are going to be modified: (3.a) MDL_SHARED on mysql.innodb_table_stats, mysql.innodb_index_stats (3.b) exclusive table locks on the statistics tables (4) Exclusive table locks on the InnoDB data dictionary tables (not needed in ANALYZE TABLE and the like) Note: Acquiring exclusive locks on the statistics tables may cause more locking conflicts between concurrent DDL operations. Notably, RENAME TABLE will lock the statistics tables even if no persistent statistics are enabled for the table. DROP DATABASE will only acquire locks on statistics tables if persistent statistics are enabled for the tables on which the SQL layer is invoking ha_innobase::delete_table(). For any "garbage collection" in innodb_drop_database(), a timeout while acquiring locks on the statistics tables will result in any statistics not being deleted for any tables that the SQL layer did not know about. If innodb_defragment=ON, information may be written to the statistics tables even for tables for which InnoDB persistent statistics are disabled. But, DROP TABLE will no longer attempt to delete that information if persistent statistics are not enabled for the table. This change should also fix the hangs related to InnoDB persistent statistics and STATS_AUTO_RECALC (MDEV-15020) as well as a bug that running ALTER TABLE on the statistics tables concurrently with running ALTER TABLE on InnoDB tables could cause trouble. lock_rec_enqueue_waiting(), lock_table_enqueue_waiting(): Do not issue a fake instant timeout error when the transaction is holding dict_sys.latch. Instead, assert that the dict_sys.latch is never being held here. lock_sys_tables(): A new function to acquire exclusive locks on all dictionary tables, in case DROP TABLE or similar operation is being executed. Locking non-hard-coded tables is optional to avoid a crash in row_merge_drop_temp_indexes(). The SYS_VIRTUAL table was introduced in MySQL 5.7 and MariaDB Server 10.2. Normally, we require all these dictionary tables to exist before executing any DDL, but the function row_merge_drop_temp_indexes() is an exception. When upgrading from MariaDB Server 10.1 or MySQL 5.6 or earlier, the table SYS_VIRTUAL would not exist at this point. ha_innobase::commit_inplace_alter_table(): Invoke log_write_up_to() while not holding dict_sys.latch. dict_sys_t::remove(), dict_table_close(): No longer try to drop index stubs that were left behind by aborted online ADD INDEX. Such indexes should be dropped from the InnoDB data dictionary by row_merge_drop_indexes() as part of the failed DDL operation. Stubs for aborted indexes may only be left behind in the data dictionary cache. dict_stats_fetch_from_ps(): Use a normal read-only transaction. ha_innobase::delete_table(), ha_innobase::truncate(), fts_lock_table(): While waiting for purge to stop using the table, do not hold dict_sys.latch. ha_innobase::delete_table(): Implement a work-around for the rollback of ALTER TABLE...ADD PARTITION. MDL_EXCLUSIVE would not be held if ALTER TABLE hits lock_wait_timeout while trying to upgrade the MDL due to a conflicting LOCK TABLES, such as in the first ALTER TABLE in the test case of Bug#53676 in parts.partition_special_innodb. Therefore, we must explicitly stop purge, because it would not be stopped by MDL. dict_stats_func(), btr_defragment_chunk(): Allocate a THD so that we can acquire MDL on the InnoDB persistent statistics tables. mysqltest_embedded: Invoke ha_pre_shutdown() before free_used_memory() in order to avoid ASAN heap-use-after-free related to acquire_thd(). trx_t::dict_operation_lock_mode: Changed the type to bool. row_mysql_lock_data_dictionary(), row_mysql_unlock_data_dictionary(): Implemented as macros. rollback_inplace_alter_table(): Apply an infinite timeout to lock waits. innodb_thd_increment_pending_ops(): Wrapper for thd_increment_pending_ops(). Never attempt async operation for InnoDB background threads, such as the trx_t::commit() in dict_stats_process_entry_from_recalc_pool(). lock_sys_t::cancel(trx_t*): Make dictionary transactions immune to KILL. lock_wait(): Make dictionary transactions immune to KILL, and to lock wait timeout when waiting for locks on dictionary tables. parts.partition_special_innodb: Use lock_wait_timeout=0 to instantly get ER_LOCK_WAIT_TIMEOUT. main.mdl: Filter out MDL on InnoDB persistent statistics tables Reviewed by: Thirunarayanan Balathandayuthapani
| * | MDEV-24258 Merge dict_sys.mutex into dict_sys.latchMarko Mäkelä2021-08-312-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the parent commit, dict_sys.latch could theoretically have been replaced with a mutex. But, we can do better and merge dict_sys.mutex into dict_sys.latch. Generally, every occurrence of dict_sys.mutex_lock() will be replaced with dict_sys.lock(). The PERFORMANCE_SCHEMA instrumentation for dict_sys_mutex will be removed along with dict_sys.mutex. The dict_sys.latch will remain instrumented as dict_operation_lock. Some use of dict_sys.lock() will be replaced with dict_sys.freeze(), which we will reintroduce for the new shared mode. Most notably, concurrent table lookups are possible as long as the tables are present in the dict_sys cache. In particular, this will allow more concurrency among InnoDB purge workers. Because dict_sys.mutex will no longer 'throttle' the threads that purge InnoDB transaction history, a performance degradation may be observed unless innodb_purge_threads=1. The table cache eviction policy will become FIFO-like, similar to what happened to fil_system.LRU in commit 45ed9dd957eebc7fc84feb2509f4aa6baa908a95. The name of the list dict_sys.table_LRU will become somewhat misleading; that list contains tables that may be evicted, even though the eviction policy no longer is least-recently-used but first-in-first-out. (Note: Tables can never be evicted as long as locks exist on them or the tables are in use by some thread.) As demonstrated by the test perfschema.sxlock_func, there will be less contention on dict_sys.latch, because some previous use of exclusive latches will be replaced with shared latches. fts_parse_sql_no_dict_lock(): Replaced with pars_sql(). fts_get_table_name_prefix(): Merged to fts_optimize_create(). dict_stats_update_transient_for_index(): Deduplicated some code. ha_innobase::info_low(), dict_stats_stop_bg(): Use a combination of dict_sys.latch and table->stats_mutex_lock() to cover the changes of BG_STAT_SHOULD_QUIT, because the flag is being read in dict_stats_update_persistent() while not holding dict_sys.latch. row_discard_tablespace_for_mysql(): Protect stats_bg_flag by exclusive dict_sys.latch, like most other code does. row_quiesce_table_has_fts_index(): Remove unnecessary mutex acquisition. FLUSH TABLES...FOR EXPORT is protected by MDL. row_import::set_root_by_heuristic(): Remove unnecessary mutex acquisition. ALTER TABLE...IMPORT TABLESPACE is protected by MDL. row_ins_sec_index_entry_low(): Replace a call to dict_set_corrupted_index_cache_only(). Reads of index->type were not really protected by dict_sys.mutex, and writes (flagging an index corrupted) should be extremely rare. dict_stats_process_entry_from_defrag_pool(): Only freeze the dictionary, do not lock it exclusively. dict_stats_wait_bg_to_stop_using_table(), DICT_BG_YIELD: Remove trx. We can simply invoke dict_sys.unlock() and dict_sys.lock() directly. dict_acquire_mdl_shared()<trylock=false>: Assert that dict_sys.latch is only held in shared more, not exclusive mode. Only acquire it in exclusive mode if the table needs to be loaded to the cache. dict_sys_t::acquire(): Remove. Relocating elements in dict_sys.table_LRU would require holding an exclusive latch, which we want to avoid for performance reasons. dict_sys_t::allow_eviction(): Add the table first to dict_sys.table_LRU, to compensate for the removal of dict_sys_t::acquire(). This function is only invoked by INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS. dict_table_open_on_id(), dict_table_open_on_name(): If dict_locked=false, try to acquire dict_sys.latch in shared mode. Only acquire the latch in exclusive mode if the table is not found in the cache. Reviewed by: Thirunarayanan Balathandayuthapani
* | | Merge 10.6 into 10.7Marko Mäkelä2021-08-317-326/+30
|\ \ \ | |/ /
| * | Merge 10.5 into 10.6Marko Mäkelä2021-08-317-326/+30
| |\ \ | | |/
| | * Merge 10.4 into 10.5Marko Mäkelä2021-08-312-0/+22
| | |\
| | | * Merge 10.3 into 10.4Marko Mäkelä2021-08-314-7/+24
| | | |\
| | | | * MDEV 22785 Crash with prepared statements and NEXTVAL()Michael Widenius2021-08-262-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The problem was that a PREARE followed by a non prepared statement using DEFAULT NEXT_VALUE() could change table->next_local to point to a not persitent memory aria. The next EXECUTE would then try to use the wrong pointer, which could cause a crash. Fixed by reseting the pointer to it's old value when doing EXECUTE.
| | | | * Fixed failing maria.repair testMichael Widenius2021-08-262-7/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Backported patch from MariaDB 10.6 The issue was that the using session_mem_used to break a test does not guarantee where the test breaks, which gives different results depending on the environment or how MariaDB is compield.
* | | | | MDEV-16355 Add option for mysqldump to read data as of specific timestamp ↵Sergei Golubchik2021-08-272-0/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | from system-versioned tables Based on Aleksey Midenkov's patch mysqldump changes: * --as-of option specifies historical point; * query forging protection for --as-of parameter. system versioned tables are detected by querying I_S.TABLES: * it transfers much less data when the full table definition is not needed * it does not give false positives on x TEXT DEFAULT 'WITH SYSTEM VERSIONING'
* | | | | Merge 10.6 into 10.7Marko Mäkelä2021-08-263-2/+6
|\ \ \ \ \ | |/ / / /
| * | | | Merge 10.5 into 10.6Marko Mäkelä2021-08-262-2/+4
| |\ \ \ \ | | |/ / /
| | * | | Merge 10.4 into 10.5Marko Mäkelä2021-08-262-2/+4
| | |\ \ \ | | | |/ /
| | | * | After-merge fix f84e28c119b495da77e197f7cd18af4048fc3126Marko Mäkelä2021-08-252-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In a rebase of the merge, two preceding commits were accidentally reverted: commit 112b23969a30ba6441efa5e22a3017435febfa17 (MDEV-26308) commit ac2857a5fbf851d90171ac55f23385869ee6ba83 (MDEV-25717) Thanks to Daniele Sciascia for noticing this.
| * | | | Merge 10.5 into 10.6Marko Mäkelä2021-08-251-0/+2
| |\ \ \ \ | | |/ / /
| | * | | Merge 10.4 into 10.5Marko Mäkelä2021-08-251-0/+2
| | |\ \ \ | | | |/ /
| | | * | Merge 10.3 into 10.4Marko Mäkelä2021-08-251-0/+2
| | | |\ \ | | | | |/
| | | | * Merge 10.2 into 10.3Marko Mäkelä2021-08-231-0/+2
| | | | |\
| | | | | * Disable 2 commonly failing innodb_gis testsMarko Mäkelä2021-08-231-0/+2
| | | | | |
* | | | | | Merge 10.6 into 10.7Marko Mäkelä2021-08-234-0/+24
|\ \ \ \ \ \ | |/ / / / /
| * | | | | Merge 10.5 into 10.6Marko Mäkelä2021-08-232-0/+22
| |\ \ \ \ \ | | |/ / / /
| | * | | | Merge 10.4 into 10.5Marko Mäkelä2021-08-232-0/+22
| | |\ \ \ \ | | | |/ / /
| | | * | | Merge 10.3 into 10.4Marko Mäkelä2021-08-232-0/+24
| | | |\ \ \ | | | | |/ /
| | | | * | MDEV-26458 Crash on ALTER TABLE after DISCARD TABLESPACEMarko Mäkelä2021-08-232-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ha_innobase::check_if_supported_inplace_alter(): Do not invoke innobase_table_is_empty() if the tablespace has been discarded. That is, native ALTER TABLE in InnoDB will treat an empty table in the same way as a tablespace whose tablespace has been discarded. (Note: ALTER TABLE...ALGORITHM=COPY will fail if the tablespace has been discarded.) This fixes a crash that was introduced in commit c755974775a7a7f4fc24abeacd2fc9ea7bf0c247 (MDEV-19611).
| * | | | | MDEV-25958: rpl_semi_sync_fail_over.test fails in buildbotSujatha2021-08-192-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Post push fix. Added a missing WAIT_FOR signal line.
* | | | | | Merge 10.6 into 10.7Marko Mäkelä2021-08-1942-161/+1012
|\ \ \ \ \ \ | |/ / / / /
| * | | | | MDEV-20931 fixup: innodb.import_corrtupted test cleanupMarko Mäkelä2021-08-191-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In MariaDB 10.6, ALTER TABLE t2 IMPORT TABLESPACE will not remove the file t2.ibd on failure. This fixes a failure of ./mtr --no-reorder innodb.import_corrupted innodb.innodb-agregate
| * | | | | Merge 10.5 to 10.6Marko Mäkelä2021-08-1929-47/+658
| |\ \ \ \ \ | | |/ / / /
| | * | | | MDEV-26439 Typo in Foreign Key error messageMarko Mäkelä2021-08-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | foreign_push_index_error(): Fix a typo of 'match' that was introduced in commit 5130f5206c150ba1e8a723aae63884ff64408012 (MDEV-20480). Thanks to Oli Sennhauser for reporting this.
| | * | | | Merge 10.4 into 10.5Marko Mäkelä2021-08-193-2/+3
| | |\ \ \ \ | | | |/ / /
| | | * | | After-merge fixup f84e28c119b495da77e197f7cd18af4048fc3126st-10.4-thiruThirunarayanan Balathandayuthapani2021-08-192-1/+3
| | | | | |
| | * | | | MDEV-20931 fixupMarko Mäkelä2021-08-192-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The merge commit 4a2595727465648f2d4e794d1b2f182345f0bee8 caused a test failure on Windows. The suppression regexp needs to accept the backslash. fil_invalid_page_access_msg(): Simplify the implementation and invoke sql_print_error() directly. fil_space_t::io(): Invoke fil_invalid_page_access_msg() only from one location.
| | * | | | Merge 10.4 into 10.5Marko Mäkelä2021-08-1825-45/+631
| | |\ \ \ \ | | | |/ / /
| | | * | | Merge 10.3 into 10.4Marko Mäkelä2021-08-1820-40/+445
| | | |\ \ \ | | | | |/ /
| | | | * | Merge 10.2 into 10.3Marko Mäkelä2021-08-181-0/+1
| | | | |\ \ | | | | | |/
| | | | | * MDEV-20931 fixup: innodb.import_corrupted test case cleanupMarko Mäkelä2021-08-181-0/+1
| | | | | |
| | | | * | MDEV-21555 Assertion secondary index is out of sync on delete from versioned ↵Aleksey Midenkov2021-08-182-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | table Delete-marked record is on the secondary index and the clustered index already purged the corresponding record. We cannot detect if such record is historical and we should not: the algorithm of row_ins_check_foreign_constraint() skips such record anyway.
| | | | * | Merge 10.2 into 10.3Marko Mäkelä2021-08-1811-29/+350
| | | | |\ \ | | | | | |/ | | | | | | | | | | | | MDEV-18734 FIXME: vcol.partition triggers ASAN heap-use-after-free
| | | | | * MDEV-26131 fixup: ./mtr --embedded encryption.innodb_importMarko Mäkelä2021-08-181-0/+1
| | | | | |
| | | | | * MDEV-20931 ALTER...IMPORT can crash the serverEugene Kosov2021-08-172-0/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Main idea: don't log-and-crash but propogate error to the upper layers of stack to handle it and show to a user.
| | | | | * MDEV-26131 SEGV in ha_innobase::discard_or_import_tablespaceThirunarayanan Balathandayuthapani2021-08-165-29/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Import operation without .cfg file fails when there is mismatch of index between metadata table and .ibd file. Moreover, MDEV-19022 shows that InnoDB can end up with index tree where non-leaf page has only one child page. So it is unsafe to find the secondary index root page. This patch does the following when importing the table without .cfg file: 1) If the metadata contains more than one index then InnoDB stops the import operation and report the user to drop all secondary indexes before doing import operation. 2) When the metadata contain only clustered index then InnoDB finds the index id by reading page 0 & page 3 instead of traversing the whole tablespace.
| | | | | * MDEV-18734 ASAN heap-use-after-free upon sorting by blob column from ↵Aleksey Midenkov2021-08-054-0/+182
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | partitioned table ha_partition stores records in array of m_ordered_rec_buffer and uses it for prio queue in ordered index scan. When the records are restored from the array the blob buffers may be already freed or rewritten. The solution is to take temporary ownership of cached blob buffers via String::swap(). When the record is restored from m_ordered_rec_buffer the ownership is returned to table fields. Cleanups: init_record_priority_queue(): removed needless !m_ordered_rec_buffer check as there is same assertion few lines before. dbug_print_row() for arbitrary row pointer