summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Added detection of memory overwrite with multi_mallocbb-10.5-montyMonty2023-02-2718-58/+136
| | | | | | | | | | | | | | | | | | | | | | | This patch also fixes some bugs detected by valgrind after this patch: - Not enough copy_func elements was allocated by Create_tmp_table() which causes an memory overwrite in Create_tmp_table::add_fields() I added an ASSERT() to be able to detect this also without valgrind. The bug was that TMP_TABLE_PARAM::copy_fields was not correctly set when calling create_tmp_table(). - Aria::empty_bits is not allocated if there is no varchar/char/blob fields in the table. Fixed code to take this into account. This cannot cause any issues as this is just a memory access into other Aria memory and the content of the memory would not be used. - Aria::last_key_buff was not allocated big enough. This may have caused issues with rtrees and ma_extra(HA_EXTRA_REMEMBER_POS) as they would use the same memory area. - Aria and MyISAM didn't take extended key parts into account, which caused problems when copying rec_per_key from engine to sql level. - Mark asan builds with 'asan' in version strihng to detect these in not_valgrind_build.inc. This is needed to not have main.sp-no-valgrind fail with asan.
* MDEV-30671 InnoDB undo log truncation fails to wait for purge of historyMarko Mäkelä2023-02-2416-200/+206
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-30552 fixup: Fix the test for non-debugMarko Mäkelä2023-02-162-2/+11
|
* Fix clang -Winconsistent-missing-overrideMarko Mäkelä2023-02-161-1/+1
|
* MDEV-30657 InnoDB: Not applying UNDO_APPEND due to corruptionMarko Mäkelä2023-02-152-7/+21
| | | | | | | | | | | | This almost completely reverts commit acd23da4c2363511aae7d984c24cc6847aa3f19c and retains a safe optimization: recv_sys_t::parse(): Remove any old redo log records for the truncated tablespace, to free up memory earlier. If recovery consists of multiple batches, then recv_sys_t::apply() will must invoke recv_sys_t::trim() again to avoid wrongly applying old log records to an already truncated undo tablespace.
* MDEV-30333 Wrong result with not_null_range_scan and LEFT JOIN with empty tableMonty2023-02-153-5/+95
| | | | | | | | | | | | | | There was a bug in JOIN::make_notnull_conds_for_range_scans() when clearing TABLE->tmp_set, which was used to mark fields that could not be null. This function was only used if 'not_null_range_scan=on' is set. The effect was that tmp_set contained a 'random value' and this caused the optimizer to think that some fields could not be null. FLUSH TABLES clears tmp_set and because of this things worked temporarily. Fixed by clearing tmp_set properly.
* Fix S3 engine Coverity hitsAndrew Hutchings2023-02-142-4/+4
| | | | Very minor hits found by Coverity for the S3 engine.
* MDEV-30552 InnoDB recovery crashes when error handling scenarioThirunarayanan Balathandayuthapani2023-02-144-0/+50
| | | | | - 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-144-3/+28
| | | | | | | | | - 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-30412: JSON_OBJECTAGG doesn't escape double quote in keyWeijun Huang2023-02-143-1/+21
|
* Merge 10.4 into 10.5Marko Mäkelä2023-02-10277-1500/+2048
|\
| * MDEV-30621: Türkiye is the correct current country namingDaniel Black2023-02-103-4/+6
| | | | | | | | | | | | | | As requested to the UN the country formerly known as Turkey is to be refered to as Türkiye. Reviewer: Alexander Barkov
| * MDEV-30608: rpl.rpl_delayed_parallel_slave_sbm sometimes fails with ↵Brandon Nesterenko2023-02-093-0/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Seconds_Behind_Master should not have used second transaction timestamp One of the constraints added in the MDEV-29639 patch, is that only the first event after idling should update last_master_timestamp; and as long as the replica has more events to execute, the variable should not be updated. The corresponding test, rpl_delayed_parallel_slave_sbm.test, aims to verify this; however, if the IO thread takes too long to queue events, the SQL thread can appear to catch up too fast. This fix ensures that the relay log has been fully written before executing the events. Note that the underlying cause of this test failure needs to be addressed as a bug-fix, this is a temporary fix to stop test failures. To track work on the bug-fix for the underlying issue, please see MDEV-30619.
| * MDEV-30586 DELETE with aggregation in subquery of WHERE returns bogus errorIgor Babaev2023-02-094-0/+81
| | | | | | | | | | | | | | | | | | | | | | The parser code for single-table DELETE missed the call of the function LEX::check_main_unit_semantics(). As a result the the field nested level of SELECT_LEX structures remained set 0 for all non-top level selects. This could lead to different kind of problems. In particular this did not allow to determine properly the selects where set functions had to be aggregated when they were used in inner subqueries. Approved by Oleksandr Byelkin <sanja@mariadb.com>
| * Apply clang-tidy to remove empty constructors / destructorsVicențiu Ciorbaru2023-02-09242-1341/+1101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch is the result of running run-clang-tidy -fix -header-filter=.* -checks='-*,modernize-use-equals-default' . Code style changes have been done on top. The result of this change leads to the following improvements: 1. Binary size reduction. * For a -DBUILD_CONFIG=mysql_release build, the binary size is reduced by ~400kb. * A raw -DCMAKE_BUILD_TYPE=Release reduces the binary size by ~1.4kb. 2. Compiler can better understand the intent of the code, thus it leads to more optimization possibilities. Additionally it enabled detecting unused variables that had an empty default constructor but not marked so explicitly. Particular change required following this patch in sql/opt_range.cc result_keys, an unused template class Bitmap now correctly issues unused variable warnings. Setting Bitmap template class constructor to default allows the compiler to identify that there are no side-effects when instantiating the class. Previously the compiler could not issue the warning as it assumed Bitmap class (being a template) would not be performing a NO-OP for its default constructor. This prevented the "unused variable warning".
| * MDEV-30624 HeidiSQL 12.3Vladislav Vaintroub2023-02-092-2/+31
| |
| * Update Windows time zone mappings using latest CLDR dataVladislav Vaintroub2023-02-091-1/+2
| |
| * Add more workaround atop existing WolfSSL 5.5.4 workaround to compile ASAN ↵Vladislav Vaintroub2023-02-081-0/+3
| | | | | | | | | | | | | | | | on buildbot The -D flag was not passed to asm compiler, despite SET_PROPERTY(COMPILE_OPTIONS) The exact reason for that remains unknown. It was not seen with gcc, as nor was be reproduced on newer CMake.
| * innodb: cmake - sched_getcpu removed - not usedDaniel Black2023-02-081-6/+0
| |
| * MDEV-30554 RockDB libatomic linking on riscv64Daniel Black2023-02-071-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The existing storage/rocksdb/CMakeCache.txt defined ATOMIC_EXTRA_LIBS when atomics where required. This was determined by the toplevel configure.cmake test (HAVE_GCC_C11_ATOMICS_WITH_LIBATOMIC). As build_rocksdb.cmake is included after ATOMIC_EXTRA_LIBS was set, we just need to use it. As such no riscv64 specific macro is needed in build_rocksdb.cmake. As highlighted by Gianfranco Costamagna (@LocutusOfBorg) in #2472 overwriting SYSTEM_LIBS was problematic. This is corrected in case in future SYSTEM_LIBS is changed elsewhere. Closes #2472.
| * MDEV-30492 Crash when use mariabackup.exe with config ↵Daniel Black2023-02-073-0/+47
| | | | | | | | | | | | | | 'innodb_flush_method=async_unbuffered' Normalize innodb_flush_method, the same as the service, before attempting to print it.
| * MDEV-30558: ER_KILL_{,QUERY_}DENIED_ERROR - normalize id typeDaniel Black2023-02-072-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | The error string from ER_KILL_QUERY_DENIED_ERROR took a different type to ER_KILL_DENIED_ERROR for the thread id. This shows up in differences on 32 big endian arches like powerpc (Deb notation). Normalize the passing of the THD->id to its real type of my_thread_id, and cast to (long long) on output. As such normalize the ER_KILL_QUERY_DENIED_ERROR to that convention too. Note for upwards merge, convert the type to %lld on new translations of ER_KILL_QUERY_DENIED_ERROR.
| * Merge branch '10.4.28' into 10.4Oleksandr Byelkin2023-02-0623-128/+769
| |\
| | * bump the VERSIONDaniel Bartholomew2023-02-061-1/+1
| | |
| | * MDEV-24301 [Warning] Aborted connection (This connection closed normally)Daniel Black2023-02-061-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | Warning on a normal graceful disconnnect is excessive, so lets not do it. MDEV-19282 restructed the code from 10.3 so applying this as a 10.4+ fix.
| | * MDEV-30538 Plans for SELECT and multi-table UPDATE/DELETE unexpectedly differIgor Babaev2023-02-034-5/+201
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch allowed transformation of EXISTS subqueries into equivalent IN predicands at the top level of WHERE conditions for multi-table UPDATE and DELETE statements. There was no reason to prohibit the transformation for such statements. The transformation provides more opportunities of using semi-join optimizations. Approved by Oleksandr Byelkin <sanja@mariadb.com>
| | * MDEV-30556 UPPER() returns an empty string for U+0251 in Unicode-5.2.0+ ↵Alexander Barkov2023-02-0310-20/+517
| | | | | | | | | | | | collations for utf8
| | * MDEV-30473 : Do not allow GET_LOCK() / RELEASE_LOCK() in clusterJan Lindström2023-01-304-97/+0
| | | | | | | | | | | | | | | | | | | | | Following tests do not test anymore what they intended to test deleted: suite/galera/t/MDEV-24143.test deleted: suite/galera/t/galera_bf_abort_get_lock.test
| | * MDEV-30473 : Do not allow GET_LOCK() / RELEASE_LOCK() in clusterJan Lindström2023-01-273-0/+47
| | | | | | | | | | | | | | | If WSREP_ON=ON do not allow GET_LOCK and RELEASE_LOCK functions. Instead print clear error message.
* | | MDEV-30534: Remove EOL Debian version 9 (stretch) from autobake-deb.shTuukka Pasanen2023-02-081-6/+0
| | | | | | | | | | | | | | | | | | Debian 9 has EOL July 6th, 2020. This commit cleans it up from debian/autobake-deb.sh which is used to build official versions of MariaDB
* | | MDEV-30572: my_large_malloc will only retry on ENOMEMDaniel Black2023-02-071-1/+1
| | | | | | | | | | | | | | | Correct error in to only say "continuing to smaller size" if it really is.
* | | MDEV-30479 optimization: Invoke recv_sys_t::trim() earlierMarko Mäkelä2023-02-062-16/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | recv_sys_t::parse(): Discard old page-level redo log when parsing a TRIM_PAGES record. recv_sys_t::apply(): trim() was invoked in parse() already. recv_sys_t::truncated_undo_spaces[]: Only store the size, no LSN.
* | | MDEV-30479 OPT_PAGE_CHECKSUM mismatch after innodb_undo_log_truncate=ONMarko Mäkelä2023-02-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | page_recv_t::trim(): Do remove log records for mini-transactions that end right at the threshold LSN. This will avoid an inconsistency where a dirty page had been evicted from the buffer pool during undo tablespace truncation, and recovery would attempt to apply log records for which the last available copy in the data file is too new. These changes would be discarded anyway.
* | | Merge mariadb-10.5.19 into 10.5Marko Mäkelä2023-02-06116-650/+3288
|\ \ \
| * | | MDEV-30940: Revert "binlog.innodb_rc_insert_before_delete is disabled with ↵mariadb-10.5.19Andrei2023-01-302-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MDEV-30490" This reverts commit b2ea57e899b50cb428b6b58a21de5cfe1b191576, as well as edits binlog.innodb_rc_insert_before_delete.test to be safely runnable with any preceding test. Note: manual 10.5 -> 10.6 merge is required to the test.
| * | | binlog.innodb_rc_insert_before_delete is disabled with MDEV-30490Andrei2023-01-301-0/+1
| | | |
| * | | Merge branch '10.4' into 10.5Oleksandr Byelkin2023-01-306-12/+59
| |\ \ \ | | |/ /
| | * | Fix number of rows passing in case of EQ_REFmariadb-10.4.28Oleksandr Byelkin2023-01-301-3/+5
| | | |
| | * | MDEV-30218: Incorrect optimization for rowid_filtering, correctionSergei Petrunia2023-01-283-15/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Enable use of Rowid Filter optimization with eq_ref access. Use the following assumptions: - Assume index-only access cost is 50% of non-index-only access cost. - Take into account that "Eq_ref access cache" reduces the number of lookups eq_ref access will make. = This means the number of Rowid Filter checks is reduced also = Eq_ref access cost is computed using that assumption (see prev_record_reads() call), so we should use it in all cost ' computations.
| | * | Merge branch '10.3' into 10.4Oleksandr Byelkin2023-01-2861-293/+1743
| | |\ \ | | | |/ | | |/|
| | | * MDEV-30010 post-push: fixing test results.mariadb-10.3.38Andrei2023-01-282-8/+52
| | | |
| * | | binlog.innodb_rc_insert_before_delete is disabled with MDEV-30490Andrei2023-01-281-0/+1
| | | |
| * | | Merge branch '10.4' into 10.5Oleksandr Byelkin2023-01-27114-649/+3235
| |\ \ \
| | * | | MDEV-30218: Incorrect optimization for rowid_filtering, correctionSergei Petrunia2023-01-263-15/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Enable use of Rowid Filter optimization with eq_ref access. Use the following assumptions: - Assume index-only access cost is 50% of non-index-only access cost. - Take into account that "Eq_ref access cache" reduces the number of lookups eq_ref access will make. = This means the number of Rowid Filter checks is reduced also = Eq_ref access cost is computed using that assumption (see prev_record_reads() call), so we should use it in all cost ' computations.
| | * | | Merge branch '10.3' into 10.4Oleksandr Byelkin2023-01-2661-293/+1699
| | |\ \ \ | | | |/ / | | |/| / | | | |/
| | | * MDEV-30457 Windows, signtool error "No file digest algorithm specified."Vladislav Vaintroub2023-01-241-1/+1
| | | | | | | | | | | | | | | | | | | | Add /fd parameter. It is now mandatory for the recent versions of signtool
| | | * MDEV-30323 Some DDLs like ANALYZE can complete on parallel slave out of orderbb-10.3-andreiAndrei2023-01-244-3/+237
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ANALYZE was observed to race over a preceding in binlog order DML in updating the binlog and slave gtid states. Tagging ANALYZE and other admin class commands in binlog by the fixes of MDEV-17515 left a flaw allowing such race leading to the gtid mode out-of-order error. This is fixed now to observe by ADMIN commands the ordered access to the slave gtid status variables and binlog.
| | | * MDEV-30010 Slave (additional info): Commit failed due to failure of an ↵Andrei2023-01-242-0/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | earlier commit on which this one depends Error_code: 1964 This commit merely adds is a Read-Committed version MDEV-30225 test solely to prove the RC isolation yields ROW binlog format as it is supposed to per docs.
| | | * MDEV-30081 Crash with splitting from constant mergeable derived tableIgor Babaev2023-01-243-1/+108
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This bug manifested itself in very rare situations when splitting optimization was applied to a materialized derived table with group clause by key over a constant meargeable derived table that was in inner part of an outer join. In this case the used tables for the key to access the split table incorrectly was evaluated to a not empty table map. Approved by Oleksandr Byelkin <sanja@mariadb.com>
| | | * MDEV-29639: Seconds_Behind_Master is incorrect for Delayed, Parallel ReplicasBrandon Nesterenko2023-01-246-9/+231
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem ======== On a parallel, delayed replica, Seconds_Behind_Master will not be calculated until after MASTER_DELAY seconds have passed and the event has finished executing, resulting in potentially very large values of Seconds_Behind_Master (which could be much larger than the MASTER_DELAY parameter) for the entire duration the event is delayed. This contradicts the documented MASTER_DELAY behavior, which specifies how many seconds to withhold replicated events from execution. Solution ======== After a parallel replica idles, the first event after idling should immediately update last_master_timestamp with the time that it began execution on the primary. Reviewed By =========== Andrei Elkin <andrei.elkin@mariadb.com>