- 10 Jul, 2024 2 commits
-
-
Vladislav Vaintroub authored
The server does not log errors after startup when it is started without the --console parameter and not as a service. This issue arises due to an undocumented behavior of FreeConsole() in Windows when only a single process (mariadbd/mysqld) is attached to it, causing the window to close. In this case stderr is redirected to a file before FreeConsole() is called. Procmon shows FreeConsole closing file handle subsequent writes to stderr fail with ERROR_INVALID_HANDLE because WriteFile() cannot operate on the closed handle. This results in losing all messages after startup, including warnings, errors, notes, and crash reports. Additionally, some users reported stderr being redirected to multi-master.info and failing at startup, but this could not be reproduced here. The workaround involves calling FreeConsole() right before the redirection of stdout/stderr. This fix has been tested with XAMPP and via cmd.exe using "start mysqld". Automated testing using MTR is challenging for this case. The fix is only applicable to version 10.5. In later versions, the FreeConsole() call has been removed.
-
Thirunarayanan Balathandayuthapani authored
MDEV-34474 InnoDB: Failing assertion: stat_n_leaf_pages > 0 in ha_innobase::estimate_rows_upper_bound - Column stat_value and sample_size in mysql.innodb_index_stats table is declared as BIGINT UNSIGNED without any check constraint. user manually updates the value of stat_value and sample_size to zero. InnoDB aborts the server while reading the statistics information because InnoDB expects at least one leaf page to exist for the index. - To fix this issue, InnoDB should interpret the value of stat_n_leaf_pages, stat_index_size in innodb_index_stats stat_clustered_index_size, stat_sum_of_other_index_sizes in innodb_table_stats as valid one even though user mentioned it as 0.
-
- 08 Jul, 2024 9 commits
-
-
Julius Goryavsky authored
-
Julius Goryavsky authored
The test has been made more stable according to the recommendations of the Codership team.
-
sjaakola authored
The problem was in error message suppression, which did not match the actual warning messages, due to bad quotations. Changed warnings message suppressions to more simple format. Signed-off-by: Julius Goryavsky <julius.goryavsky@mariadb.com>
-
Denis Protivensky authored
DML transactions on FK-child tables also get table locks on FK-parent tables. If there is a DML transaction holding such a lock, and a TOI transaction starts, the latter BF-aborts the former and puts itself into a waiting state. If at this moment another DML transaction on FK-child table starts, it doesn't check that the transaction waiting on a parent table lock is TOI, and it erroneously BF-aborts the waiting TOI transaction. The fix: don't roll back high-priority transaction waiting on a lock in InnoDB, instead roll back an incoming DML transaction. Signed-off-by: Julius Goryavsky <julius.goryavsky@mariadb.com>
-
Brandon Nesterenko authored
The IO thread can report error code 2013 into the error log when it is stopped during the initial connection process to the primary, as well as when trying to read an event. However, because the IO thread is being stopped, its connection to the primary is force-killed by the signaling thread (see THD::awake_no_mutex()), and thereby these connection errors should be ignored. Reviewed By: ============ Kristian Nielsen <knielsen@knielsen-hq.org>
-
Alexander Barkov authored
my_like_range*() can create longer keys than Field::char_length(). This caused warnings during print_range(). Fix: Suppressing warnings in print_range().
-
Anson Chung authored
Line numbers had to be removed from the ignorelists in order to be diffed against since locations of the same findings can differ across runs. Therefore preprocessing has to be done on the CI findings so that it can be compared to the ignorelist and new findings can be outputted. However, since line numbers have to be removed, a situation occurs where it is difficult to reference the location of findings in code given the output of the CI job. To lessen this pain, change the cppcheck template to include code snippets which make it easier to reference where in the code the finding is referring to, even in the absence of line numbers. Ignorelisting works as before since locations of the finding may change but not the code it is referring to. Furthermore, due to the innate difficulty in maintaining ignorelists across branches and triaging new findings, allow failure as to not have constantly failing pipelines as a result of a new findings that have not been addressed yet. Lastly, update SAST ignorelists to match the newly refactored cppcheck job and the current state of the codebase. All new code of the whole pull request, including one or several files that are either new files or modified ones, are contributed under the BSD-new license. I am contributing on behalf of my employer Amazon Web Services, Inc.
-
Anson Chung authored
Rectify cases of mismatched brackets and address possible cases of division by zero by checking if the denominator is zero before dividing. No functional changes were made. All new code of the whole pull request, including one or several files that are either new files or modified ones, are contributed under the BSD-new license. I am contributing on behalf of my employer Amazon Web Services, Inc.
-
Marko Mäkelä authored
crc32_avx512(): Explicitly cast ssize_t(size) to make it clear that we are indeed applying a negative offset to a pointer.
-
- 07 Jul, 2024 1 commit
-
-
Monty authored
The issue was that when repairing an Aria table of row format PAGE and the data file was bigger the 4G, the data file length was cut short because of wrong parameters to MY_ALIGN(). The effect was that ALTER TABLE, OPTIMIZE TABLE or REPAIR TABLE would fail on these tables, possibly corrupting them. The MDEV also exposed a bug where error state was not propagated properly to the upper level if the number of rows in the table changed.
-
- 05 Jul, 2024 3 commits
-
-
Brandon Nesterenko authored
The special logic used by the memory storage engine to keep slaves in sync with the master on a restart can break replication. In particular, after a restart, the master writes DELETE statements in the binlog for each MEMORY-based table so the slave can empty its data. If the DELETE is not executable, e.g. due to invalid triggers, the slave will error and fail, whereas the master will never see the problem. Instead of DELETE statements, use TRUNCATE to keep slaves in-sync with the master, thereby bypassing triggers. Reviewed By: =========== Kristian Nielsen <knielsen@knielsen-hq.org> Andrei Elkin <andrei.elkin@mariadb.com>
-
Thirunarayanan Balathandayuthapani authored
During read only mode, InnoDB doesn't allow checkpoint to happen. So InnoDB should throw the warning when InnoDB tries to force the checkpoint when innodb_read_only = 1 or innodb_force_recovery = 6.
-
Hugo Wen authored
MariaDB supports a "wait-free concurrent allocator based on pinning addresses". In `lf_pinbox_real_free()` it tries to sort the pinned addresses for better performance to use binary search during "real free". `alloca()` was used to allocate stack memory and copy addresses. To prevent a stack overflow when allocating the stack memory the function checks if there's enough stack space. However, the available stack size was calculated inaccurately which eventually caused database crash due to stack overflow. The crash was seen on MariaDB 10.6.11 but the same code defect exists on all MariaDB versions. A similar issue happened previously and the fix in fc2c1e43 was to add a `ALLOCA_SAFETY_MARGIN` which is 8192 bytes. However, that safety margin is not enough during high connection workloads. MySQL also had a similar issue and the fix https://github.com/mysql/mysql-server/commit/b086fda was to remove the use of `alloca` and replace qsort approach by a linear scan through all pointers (pins) owned by each thread. This commit is mostly the same as it is the only way to solve this issue as: 1. Frame sizes in different architecture can be different. 2. Number of active (non-null) pinned addresses varies, so the frame size for the recursive sorting function `msort_with_tmp` is also hard to predict. 3. Allocating big memory blocks in stack doesn't seem to be a very good practice. For further details see the mentioned commit in MySQL and the inline comments. All new code of the whole pull request, including one or several files that are either new files or modified ones, are contributed under the BSD-new license. I am contributing on behalf of my employer Amazon Web Services, Inc.
-
- 04 Jul, 2024 1 commit
-
-
Galina Shalygina authored
The crash is caused by the attempt to refix the constant subquery during pushdown from HAVING into WHERE optimization. Every condition that is going to be pushed into WHERE clause is first cleaned up, then refixed. Constant subqueries are not cleaned or refixed because they will remain the same after refixing, so this complicated procedure can be omitted for them (introduced in MDEV-21184). Constant subqueries are marked with flag IMMUTABLE_FL, that helps to miss the cleanup stage for them. Also they are marked as fixed, so refixing is also not done for them. Because of the multiple equality propagation several references to the same constant subquery can exist in the condition that is going to be pushed into WHERE. Before this patch, the problem appeared in the following way. After the first reference to the constant subquery is processed, the flag IMMUTABLE_FL for the constant subquery is disabled. So, when the second reference to this constant subquery is processed, the flag is already disabled and the subquery goes through the procedure of cleaning and refixing. That causes a crash. To solve this problem, IMMUTABLE_FL should be disabled only after all references to the constant subquery are processed, so after the whole condition that is going to be pushed is cleaned up and refixed. Approved by Igor Babaev <igor@maridb.com>
-
- 03 Jul, 2024 2 commits
-
-
Oleksandr Byelkin authored
-
Daniel Black authored
Valgrind looks as the assertions as examining uninitalized values. As the assertions are tested in other Debug builds we know it isn't all invalid. Account for Valgrind by removing the assertion under the WITH_VALGRIND=1 compulation.
-
- 02 Jul, 2024 3 commits
-
-
Monty authored
The feedback plugin server_uid variable and the calculate_server_uid() function is moved from feedback/utils.cc to sql/mysqld.cc server_uid is added as a global variable (shown in 'show variables') and is written to the error log on server startup together with server version and server commit id.
-
Monty authored
We have an issue if a user have the following in a configuration file: log_slow_filter="" # Log everything to slow query log log_queries_not_using_indexes=ON This set log_slow_filter to 'not_using_index' which disables slow_query_logging of most queries. In effect, on should never use log_slow_filter="" in config files but instead use log_slow_filter=ALL. Fixed by changing log_slow_filter="" that comes either from a configuration file or from the command line, when starting to the server, to log_slow_filter=ALL. A warning will be printed when this happens. Other things: - One can now use =ALL for any 'set' variable to set all options at once. (backported from 10.6)
-
Lena Startseva authored
Fix for v. 10.5
-
- 01 Jul, 2024 2 commits
-
-
Alexander Barkov authored
Item_func_hex::fix_length_and_dec() evaluated a too short data type for signed numeric arguments, which resulted in a 'Data too long for column' error on CREATE..SELECT. Fixing the code to take into account that a short negative numer can produce a long HEX value: -1 -> 'FFFFFFFFFFFFFFFF' Also fixing Item_func_hex::val_str_ascii_from_val_real(). Without this change, MTR test with HEX with negative float point arguments failed on some platforms (aarch64, ppc64le, s390-x).
-
Daniel Black authored
extra_port and port are 16 bit numbers and not 32 bit as they are tcp ports. Restrict their value.
-
- 29 Jun, 2024 1 commit
-
-
Daniel Black authored
Mismatched IF/ENDIF statements in cmake caused a warning.
-
- 28 Jun, 2024 1 commit
-
-
Lena Startseva authored
-
- 27 Jun, 2024 1 commit
-
-
Meng-Hsiu Chiang authored
PFS_atomic class contains wrappers around my_atomic_* operations, which are macros to GNU atomic operations (__atomic_*). Due to different implementations of compilers, clang may encounter errors when compiling on x86_32 architecture. The following functions are replaced with C++ std::atomic type in performance schema code base: - PFS_atomic::store_*() -> my_atomic_store* -> __atomic_store_n() => std::atomic<T>::store() - PFS_atomic::load_*() -> my_atomic_load* -> __atomic_load_n() => std::atomic<T>::load() - PFS_atomic::add_*() -> my_atomic_add* -> __atomic_fetch_add() => std::atomic<T>::fetch_add() - PFS_atomic::cas_*() -> my_atomic_cas* -> __atomic_compare_exchange_n() => std::atomic<T>::compare_exchange_strong() and PFS_atomic class could be dropped completely. Note that in the wrapper memory order passed to original GNU atomic extensions are hard-coded as `__ATOMIC_SEQ_CST`, which is equivalent to `std::memory_order_seq_cst` in C++, and is the default parameter for std::atomic_* functions. All new code of the whole pull request, including one or several files that are either new files or modified ones, are contributed under the BSD-new license. I am contributing on behalf of my employer Amazon Web Services.
-
- 26 Jun, 2024 2 commits
-
-
Daniel Black authored
CMake WSREP=ON has some implications for client executables so still present this as an option when compiling WITHOUT_SERVER. In this case default to ON for maximium compatibility of the build client executables and libraries.
-
Daniel Black authored
The log_event_old.cc is included by mysqlbinlog.cc. With -DWITHOUT_SERVER the include path for the wsrep include headers isn't there. As these aren't needed by the mariadb-binlog, move these to under a ifndef MYSQL_CLIENT preprocessor. Caused by MDEV-18590
-
- 25 Jun, 2024 4 commits
-
-
Yuchen Pei authored
-
Yuchen Pei authored
Just like the spider/bugfix suite. One caveat is that my_2_3.cnf needs something under mysqld.2.3 group, otherwise mtr will fail with something like: There is no group named 'mysqld.2.3' that can be used to resolve 'port' for ... This will allow new tests under the spider suite to use what is needed. It also somehow fixes issues of running a test followed by spider.slave_trx_isolation.
-
Yuchen Pei authored
-
Dmitry Shulga authored
Executing an INSERT statement in PS mode having positional parameter bound with an array could result in incorrect number of inserted rows in case there is a BEFORE INSERT trigger that executes yet another INSERT statement to put a copy of row being inserted into some table. The reason for incorrect number of inserted rows is that a data structure used for binding positional argument with its actual values is stored in THD (this is thd->bulk_param) and reused on processing every INSERT statement. It leads to consuming actual values bound with top-level INSERT statement by other INSERT statements used by triggers' body. To fix the issue, reset the thd->bulk_param temporary to the value nullptr before invoking triggers and restore its value on finishing its execution.
-
- 24 Jun, 2024 3 commits
-
-
Rex authored
Having Item_func_not items in item trees breaks assumptions during the optimization phase about transformation possibilities in fix_fields(). Remove Item_func_not by extending normalization during parsing. Reviewed by Oleksandr Byelkin (sanja@mariadb.com)
-
Marko Mäkelä authored
New error codes can only be added in the latest major version. Adding ER_KILL_DENIED_HIGH_PRIORITY would shift by one all error codes that were added in MariaDB Server 10.6 or later. This amends commit 1001dae1 Suggested by: Sergei Golubchik
-
Marko Mäkelä authored
ha_innobase::info_low(): For HA_STATUS_VARIABLE without HA_STATUS_VARIABLE_EXTRA, let us avoid unnecessary and costly updates of the data_free statistics, which are only needed for SHOW TABLE STATUS. This optimization had been enabled in commit 247ecb75 but not utilized until now.
-
- 22 Jun, 2024 3 commits
-
-
Christian Hesse authored
Now that we have proper paths in `galera_recovery` changing the directory is no longer required.
-
Christian Hesse authored
The variable `sbindir` is never set for cmake. This adds borked paths to `galera_recovery`, though it dit not break as the systemd unit changes the dir to make the relative path work anyway. Let's fix this nevertheless...
-
Rex authored
RAND() and UUID() are treated differently with respect to subquery materialization both should be marked as uncacheable, forcing materialization. Altered Create_func_uuid(_short)::create_builder(). Added comment in header about UNCACHEABLE_RAND meaning also unmergeable.
-
- 21 Jun, 2024 1 commit
-
-
Thirunarayanan Balathandayuthapani authored
- Few of test case should make sure that InnoDB does hit the debug sync point during startup of the server. InnoDB can remove the double quotes of debug point in restart parameters.
-
- 20 Jun, 2024 1 commit
-
-
Dave Gosselin authored
Find and fix missing virtual override markings. Updates cmake maintainer flags to include -Wsuggest-override and -Winconsistent-missing-override.
-