- 18 Jan, 2024 1 commit
-
-
Libing Song authored
Summary ======= With FULL_NODUP mode, before image inclues all columns and after image inclues only the changed columns. flashback will swap the value of changed columns from after image to before image. For example: BI: c1, c2, c3_old, c4_old AI: c3_new, c4_new flashback will reconstruct the before and after images to BI: c1, c2, c3_new, c4_new AI: c3_old, c4_old Implementation ============== When parsing the before and after image, position and length of the fields are collected into ai_fields and bi_fields, if it is an Update_rows_event and the after image doesn't includes all columns. The changed fields are swapped between bi_fields and ai_fields. Then it recreates the before image and after image by using bi_fields and ai_fields. nullbit will be set to 1 if the field is NULL, otherwise nullbit will be 0. It also optimized flashback a little bit. - calc_row_event_length is used instead of print_verbose_one_row - swap_buff1 and swap_buff2 are removed.
-
- 17 Jan, 2024 1 commit
-
-
Andrew Hutchings authored
BASE 62 uses 0-9, A-Z and then a-z to give the numbers 0-61. This patch increases the range of the string functions to cover this. Based on ideas and tests in PR #2589, but re-written into the charset functions. Includes fix by Sergei, UBSAN complained: ctype-simple.c:683:38: runtime error: negation of -9223372036854775808 cannot be represented in type 'long long int'; cast to an unsigned type to negate this value to itself Co-authored-by: Weijun Huang <huangweijun1001@gmail.com> Co-authored-by: Sergei Golubchik <serg@mariadb.org>
-
- 12 Jan, 2024 1 commit
-
-
Libing Song authored
Field_new_decimal::store_value(const my_decimal*, int*) Analysis ======== When rpl applier is unpacking a before row image, Field::reset() will be called before setting a field to null if null bit of the field is set in the row image. For Field_new_decimal::reset(), it calls Field_new_decimal::store_value() to reset the value. store_value() asserts that the field is in the write_set bitmap since it thinks the field is updating. But that is not true for the row image generated in FULL_NODUP mode. In the mode, the before image includes all fields and the after image includes only updated fields. Fix === In the case unpacking binlog row images, the assertion is meaningless. So the unpacking field is marked in write_set temporarily to avoid the assertion failure.
-
- 10 Jan, 2024 10 commits
-
-
Marko Mäkelä authored
-
Marko Mäkelä authored
-
Marko Mäkelä authored
-
Marko Mäkelä authored
-
Marko Mäkelä authored
-
Marko Mäkelä authored
-
Marko Mäkelä authored
-
Marko Mäkelä authored
When innodb_undo_log_truncate=ON causes an InnoDB undo tablespace to be truncated, we must guarantee that the undo tablespace will be rebuilt atomically: After mtr_t::commit_shrink() has durably written the mini-transaction that rebuilds the undo tablespace, we must not write any old pages to the tablespace. To guarantee this, in trx_purge_truncate_history() we used to traverse the entire buf_pool.flush_list in order to acquire exclusive latches on all pages for the undo tablespace that reside in the buffer pool, so that those pages cannot be written and will be evicted during mtr_t::commit_shrink(). But, this traversal may interfere with the page writing activity of buf_flush_page_cleaner(). It would be better to lazily discard the old pages of the truncated undo tablespace. fil_space_t::is_being_truncated, fil_space_t::clear_stopping(): Remove. fil_space_t::create_lsn: A new field, identifying the LSN of the latest rebuild of a tablespace. buf_page_t::flush(), buf_flush_try_neighbors(): Evict pages whose FIL_PAGE_LSN is below fil_space_t::create_lsn. mtr_t::commit_shrink(): Update fil_space_t::create_lsn and fil_space_t::size right before the log is durably written and the tablespace file is being truncated. fsp_page_create(), trx_purge_truncate_history(): Simplify the logic. Reviewed by: Thirunarayanan Balathandayuthapani, Vladislav Lesin Performance tested by: Axel Schwenke Correctness tested by: Matthias Leich
-
Marko Mäkelä authored
-
Marko Mäkelä authored
trx_purge_free_segment(), trx_purge_truncate_rseg_history(): Do not claim that the blocks will be modified in the mini-transaction, because that will not always be the case. Whenever there is a modification, mtr_t::set_modified() will flag it. The debug assertion that failed in recovery is checking that all changes to data pages are covered by log records. Due to these incorrect calls, we would unnecessarily write unmodified data pages, which is something that commit 05fa4558 aims to avoid. The incorrect calls had originally been added in commit de31ca6a (MDEV-32820) and commit 86767bcc (MDEV-29593). Reviewed by: Vladislav Lesin Tested by: Elena Stepanova
-
- 09 Jan, 2024 7 commits
-
-
Sergei Golubchik authored
perfschema thread walker needs to take thread's LOCK_thd_kill to prevent the thread from disappearing why it's being looked at. But there's no need to lock it for the current thread. In fact, it was harmful as some code down the stack might take LOCK_thd_kill (e.g. set_killed() does it, and my_malloc_size_cb_func() calls set_killed()). And it caused a bunch of mutexes being locked under LOCK_thd_kill, which created problems later when my_malloc_size_cb_func() called set_killed() at some unspecified point under some random mutexes.
-
Sergei Golubchik authored
-
Sergei Golubchik authored
same assertion with spider. spider status variables didn't expect to be queried from a different thread without LOCK_thd_data. And they didn't expect to be queried under LOCK_thd_data either (because spider_get_trx() calls thd_set_ha_data()).
-
Sergei Golubchik authored
reduce code duplication
-
Sergei Golubchik authored
need to protect access to thread-local cache_mngr with LOCK_thd_data technically only access from different threads has to be protected, but this is the SHOW STATUS code path, so the difference is neglectable
-
Sergei Golubchik authored
use utf8mb4 with PCRE2, not utf8mb3
-
Sergei Petrunia authored
- Move it from delete.test to delete_innodb.test - Use --source include/innodb_stable_estimates.inc to make it predicatable.
-
- 08 Jan, 2024 4 commits
-
-
Marko Mäkelä authored
-
Marko Mäkelä authored
buf_flush_page_cleaner(): A continue or break inside DBUG_EXECUTE_IF actually is a no-op. Use an explicit call to _db_keyword_() to actually avoid advancing the checkpoint. buf_flush_list_now_set(): Invoke os_aio_wait_until_no_pending_writes() to ensure that the page write to the system tablespace is completed.
-
Sergei Golubchik authored
-
Sergei Golubchik authored
-
- 05 Jan, 2024 5 commits
-
-
Marko Mäkelä authored
-
Marko Mäkelä authored
-
Marko Mäkelä authored
-
Marko Mäkelä authored
-
mariadb-DebarunBanerjee authored
MDEV-33101 Server crashes when starting the server with innodb-force-recovery=6 and enabling the innodb_truncate_temporary_tablespace_now variable The issue is introduced by "MDEV-28699: Shrink temporary tablespaces without restart". SRV_FORCE_NO_LOG_REDO forces server to read only mode and we don't initialize temporary tablespace in read only mode. solution: innodb_truncate_temporary_tablespace_now should be no-op in read only mode.
-
- 03 Jan, 2024 8 commits
-
-
Marko Mäkelä authored
-
Marko Mäkelä authored
-
Marko Mäkelä authored
-
Marko Mäkelä authored
srv_start(): Move a read only mode startup tweak from innodb_init_params() to the correct location. Also if innodb_force_recovery=6 we will disable the doublewrite buffer, because InnoDB must run in read-only mode to prevent further corruption. This change only affects debug checks. Whenever srv_read_only_mode holds, the buf_pool.flush_list will be empty, that is, there will be no writes of persistent InnoDB data pages. Reviewed by: Thirunarayanan Balathandayuthapani
-
Marko Mäkelä authored
-
Thirunarayanan Balathandayuthapani authored
- innodb.doublewrite_debug should avoid the checkpoint before killing the server. So used debug sync and innodb_flush_sync to avoid the checkpoint completely. Test case allowed to skip on MSAN builder due to extra checkpoint.
-
Marko Mäkelä authored
wsrep_plugin_init(), wsrep_plugin_deinit(): Remove these dummy functions in order to fix an error that would be flagged by cmake -DWITH_UBSAN=ON when using clang. wsrep_show_ready(), wsrep_show_bf_aborts(): Correct the signature.
-
Igor Babaev authored
If a query has a HAVING clause that contains a predicate with a constant IN subquery whose lef part in its turn is a subquery and the predicate is subject to pushdown from HAVING to WHERE then execution of the query could cause a crash of the server. The cause of the problem was the missing implementation of the walk() method for the class Item_in_optimizer. As a result in some cases the left operand of the Item_in_optimizer condition could be traversed twice by the walk procedure. For many call-back functions used as an argument of this procedure it does not matter. Yet it matters for the call-back function cleanup_excluding_immutables_processor() used in pushdown of predicates from HAVING to WHERE. If the processed item is marked with the IMMUTABLE_FL flag then the processor just removes this flag, otherwise it performs cleanup of the item making it unfixed. If an item is marked with an the IMMUTABLE_FL and it traversed with this processor twice then it becomes unfixed after the second traversal though the flag indicates that the item should not be cleaned up. Approved by Oleksandr Byelkin <sanja@mariadb.com>
-
- 02 Jan, 2024 1 commit
-
-
Marko Mäkelä authored
-
- 27 Dec, 2023 2 commits
-
-
Alexander Barkov authored
Problem: sp_cache erroneously looked up fully qualified SP names (e.g. `DB`.`SP`), in case insensitive style. It was wrong, because only the "name" part is always case insensitive, while the "db" part should be compared according to lower_case_table_names (case sensitively for 0, case insensitively for 1 and 2). Fix: Adding a "casedn_name" parameter make_qname() to tell if the name part should be lower cased: `DB1`.`SP` -> "DB1.SP" (when casedn_name=false) `DB1`.`SP` -> "DB1.sp" (when casedn_name=true) and using make_qname() with casedn_name=true when creating sp_cache hash lookup keys. Details: As a result, it now works as follows: - sp_head::m_db is converted to lower case if lower_case_table_names>0 during the sp_name initialization phase. So when make_qname() is called, sp_head::m_db is already normalized. There are no changes in here. - The initialization phase of sp_head when creating sp_head::m_qname now calls make_qname() with casedn_name=true, so sp_head::m_name gets written to sp_head::m_qname in lower case. - sp_cache_lookup() now also calls make_qname() with casedn_name=true, so sp_head::m_name gets written to the temporary lookup key in lower case. - sp_cache::m_hashtable now uses case sensitive comparison
-
Alexander Barkov authored
Part#1 A non-functional change Changing the signature of Identifier_chain2::make_qname() from bool make_qname(MEM_ROOT *mem_root, LEX_CSTRING *dst) const; to LEX_CSTRING make_qname(MEM_ROOT *mem_root) const; Now the result is returned as LEX_CSTRING from the function rather than is passed as a parameter. The return value {NULL,0} means "EOM".
-