- 08 Jul, 2024 1 commit
-
-
Oleksandr Byelkin authored
-
- 04 Jul, 2024 3 commits
-
-
Oleksandr Byelkin authored
-
Oleksandr Byelkin authored
-
Alexander Barkov authored
Fixing applying the COLLATE clause to a parameter caused an error error: COLLATION '...' is not valid for CHARACTER SET 'binary' Fix: - Changing the collation derivation for a non-prepared Item_param to DERIVATION_IGNORABLE. - Allowing to apply any COLLATE clause to expressions with DERIVATION_IGNORABLE. This includes: 1. A non-prepared Item_param 2. An explicit NULL 3. Expressions derived from #1 and #2 For example: SELECT ? COLLATE utf8mb_unicode_ci; SELECT NULL COLLATE utf8mb_unicode_ci; SELECT CONCAT(?) COLLATE utf8mb_unicode_ci; SELECT CONCAT(NULL) COLLATE utf8mb_unicode_ci - Additional change: preserving the collation of an expression when the expression gets assigned to a PS parameter and evaluates to SQL NULL. Before this change, the collation of the parameter was erroneously set to &my_charset_binary. - Additional change: removing the multiplication to mbmaxlen from the fix_char_length_ulonglong() argument, because the multiplication already happens inside fix_char_length_ulonglong(). This fixes a too large column size created for a COLLATE clause.
-
- 03 Jul, 2024 6 commits
-
-
Brandon Nesterenko authored
In 10.0 there was an assert to ensure that there were semi sync clients before removing one, but it was removed in 10.1. This patch adds the assertion back.
-
mariadb-DebarunBanerjee authored
The performance regression seen while loading BP is caused by the deadlock fix given in MDEV-33543. The area of impact is wider but is more visible when BP is being loaded initially via DMLs. Specifically the response time could be impacted in DML doing pessimistic operation on index(split/merge) and the leaf pages are not found in buffer pool. It is more likely to occur with small BP size. The origin of the issue dates back to MDEV-30400 that introduced btr_cur_t::search_leaf() replacing btr_cur_search_to_nth_level() for leaf page searches. In btr_latch_prev, we use RW_NO_LATCH to get the previous page fixed in BP without latching. When the page is not in BP, we try to acquire and wait for S latch violating the latching order. This deadlock was analyzed in MDEV-33543 and fixed by using the already present wait logic in buf_page_get_gen() instead of waiting for latch. The wait logic is inferior to usual S latch wait and is simply a repeated sleep 100 of micro-sec (The actual sleep time could be more depending on platforms). The bug was seen with "change-buffering" code path and the idea was that this path should be less exercised. The judgement was not correct and the path is actually quite frequent and does impact performance when pages are not in BP and being loaded by DML expanding/shrinking large data. Fix: While trying to get a page with RW_NO_LATCH and we are attempting "out of order" latch, return from buf_page_get_gen immediately instead of waiting and follow the ordered latching path.
-
Oleksandr Byelkin authored
-
Oleksandr Byelkin authored
-
Monty authored
If compiled for debugging, LOCK_DURATION is also filled in.
-
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 5 commits
-
-
Dmitry Shulga authored
The memory leak happened on second execution of a prepared statement that runs UPDATE statement with correlated subquery in right hand side of the SET clause. In this case, invocation of the method table->stat_records() could return the zero value that results in going into the 'if' branch that handles impossible where condition. The issue is that this condition branch missed saving of leaf tables that has to be performed as first condition optimization activity. Later the PS statement memory root is marked as read only on finishing first time execution of the prepared statement. Next time the same statement is executed it hits the assertion on attempt to allocate a memory on the PS memory root marked as read only. This memory allocation takes place by the sequence of the following invocations: Prepared_statement::execute mysql_execute_command Sql_cmd_dml::execute Sql_cmd_update::execute_inner Sql_cmd_update::update_single_table st_select_lex::save_leaf_tables List<TABLE_LIST>::push_back To fix the issue, add the flag SELECT_LEX::leaf_tables_saved to control whether the method SELECT_LEX::save_leaf_tables() has to be called or it has been already invoked and no more invocation required. Similar issue could take place on running the DELETE statement with the LIMIT clause in PS/SP mode. The reason of memory leak is the same as for UPDATE case and be fixed in the same way.
-
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)
-
Daniel Black authored
When getaddrinfo returns and error, the contents of ai are invalid so we cannot continue based on their data structures. In the previous branch of the if statement, we abort there if there is an error so for consistency we abort here too. The test case fixes the port number to UINTMAX32 for both an enumberated bind-address and the default bind-address covering the two calls to getaddrinfo. Review thanks Sanja.
-
Lena Startseva authored
Fix for v. 10.5
-
- 01 Jul, 2024 4 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).
-
Denis Protivensky authored
Signed-off-by: Julius Goryavsky <julius.goryavsky@mariadb.com>
-
Denis Protivensky authored
InnoDB transactions may be reused after committed: - when taken from the transaction pool - during a DDL operation execution In this case wsrep flag on trx object is cleared, which may cause wrong execution logic afterwards (wsrep-related hooks are not run). Make trx->wsrep flag initialize from THD object only once on InnoDB transaction start and don't change it throughout the transaction's lifetime. The flag is reset at commit time as before. Unconditionally set wsrep=OFF for THD objects that represent InnoDB background threads. Make Wsrep_schema::store_view() operate in its own transaction. Fix streaming replication transactions' fragments rollback to not switch THD->wsrep value during transaction's execution (use THD->wsrep_ignore_table as a workaround). Signed-off-by: Julius Goryavsky <julius.goryavsky@mariadb.com>
-
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 2 commits
-
-
Daniel Black authored
Noticed thanks to Razvan Liviu Varzaru
-
Daniel Black authored
Mismatched IF/ENDIF statements in cmake caused a warning.
-
- 28 Jun, 2024 3 commits
-
-
Marko Mäkelä authored
-
Marko Mäkelä authored
During a Sysbench oltp_point_select workload with 1 table and 400 concurrent connections, a bottleneck on dict_table_t::lock_mutex was observed in ha_innobase::info_low(). dict_table_t::lock_latch: Replaces lock_mutex. In ha_innobase::info_low() and several other places, we will acquire a shared dict_table_t::lock_latch or we may elide the latch if hardware memory transactions are available. innobase_build_v_templ(): Remove the parameter "bool locked", and require the caller to hold exclusive dict_table_t::lock_latch (instead of holding an exclusive dict_sys.latch). Tested by: Vladislav Vaintroub Reviewed by: Vladislav Vaintroub
-
Lena Startseva authored
-
- 27 Jun, 2024 3 commits
-
-
Marko Mäkelä authored
As part of commit 685d958e (MDEV-14425) the parameter innodb_log_write_ahead_size was removed, because it was thought that determining the physical block size would be a sufficient replacement. However, we can only determine the physical block size on Linux or Microsoft Windows. On some file systems, the physical block size is not relevant. For example, XFS uses a block size of 4096 bytes even if the underlying block size may be smaller. On Linux, we failed to determine the physical block size if innodb_log_file_buffered=OFF was not requested or possible. This will be fixed. log_sys.write_size: The value of the reintroduced parameter innodb_log_write_ahead_size. To keep it simple, this is read-only and a power of two between 512 and 4096 bytes, so that the previous alignment guarantees are fulfilled. This will replace the previous log_sys.get_block_size(). log_sys.block_size, log_t::get_block_size(): Remove. log_t::set_block_size(): Ensure that write_size will not be less than the physical block size. There is no point to invoke this function with 512 or less, because that is the minimum value of write_size. innodb_params_adjust(): Add some disabled code for adjusting the minimum value and default value of innodb_log_write_ahead_size to reflect the log_sys.write_size. log_t::set_recovered(): Mark the recovery completed. This is the place to adjust some things if we want to allow write_size>4096. log_t::resize_write_buf(): Refer to write_size. log_t::resize_start(): Refer to write_size instead of get_block_size(). log_write_buf(): Simplify some arithmetics and remove a goto. log_t::write_buf(): Refer to write_size. If we are writing less than that, do not switch buffers, but keep writing to the same buffer. Move some code to improve the locality of reference. recv_scan_log(): Refer to write_size instead of get_block_size(). os_file_create_func(): For type==OS_LOG_FILE on Linux, always invoke os_file_log_maybe_unbuffered(), so that log_sys.set_block_size() will be invoked even if we are not attempting to use O_DIRECT. recv_sys_t::find_checkpoint(): Read the entire log header in a single 12 KiB request into log_sys.buf. Tested with: ./mtr --loose-innodb-log-write-ahead-size=4096 ./mtr --loose-innodb-log-write-ahead-size=2048
-
Marko Mäkelä authored
-
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 6 commits
-
-
Marko Mäkelä authored
BTR_MODIFY_PREV: Remove. This mode was only used by the change buffer, which commit f27e9c89 (MDEV-29694) removed. buf_page_get_gen(): Revert the change that was made in commit 90b95c61 (MDEV-33543) because it is not applicable after MDEV-29694. This fixes the performance regression that Vladislav Vaintroub reported. This is a 11.x specific fix; this needs to be fixed differently in older major versions where the change buffer is present.
-
Marko Mäkelä authored
innodb_doublewrite_update(): Disallow any change if srv_read_only_mode holds, that is, the server was started with innodb_read_only=ON or innodb_force_recovery=6. This fixes up commit 1122ac97 (MDEV-33545).
-
Yuchen Pei authored
-
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.
-
Yuchen Pei authored
-
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 5 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
One of possible use cases that reproduces the memory leakage listed below: set timestamp= unix_timestamp('2000-01-01 00:00:00'); create or replace table t1 (x int) with system versioning partition by system_time interval 1 hour auto partitions 3; create table t2 (x int); create trigger tr after insert on t2 for each row update t1 set x= 11; create or replace procedure sp2() insert into t2 values (5); set timestamp= unix_timestamp('2000-01-01 04:00:00'); call sp2; set timestamp= unix_timestamp('2000-01-01 13:00:00'); call sp2; # <<=== Memory leak happens there. In case MariaDB server is built with the option -DWITH_PROTECT_STATEMENT_MEMROOT, the second execution would hit assert failure. The reason of leaking a memory is that once a new partition be created the table should be closed and re-opened. It results in calling the function extend_table_list() that indirectly invokes the function sp_add_used_routine() to add routines implicitly used by the statement that makes a new memory allocation. To fix it, don't remove routines and tables the statement implicitly depends on when a table being closed for subsequent re-opening.
-
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 2 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
-