- 28 Jun, 2023 3 commits
-
-
Marko Mäkelä authored
fsp_truncate_list(): Fix some formatting as well as -Wconversion on 32-bit
-
Marko Mäkelä authored
-
Thirunarayanan Balathandayuthapani authored
-
- 27 Jun, 2023 6 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
recv_sys_t::parse(): For undo tablespace truncation mini-transactions, remember the start_lsn instead of the end LSN. This is what we expect after commit 461402a5 (MDEV-30479).
-
- 26 Jun, 2023 3 commits
-
-
Marko Mäkelä authored
-
Marko Mäkelä authored
-
Rucha Deodhar authored
mysql.proc. The table is probably corrupted" Analysis: When mysql_upgrade runs statements for upgrade, characterset is converted to utf8mb4 because server starts with old_mode that interprets utf8 to utf8mb4, but mysql.proc table has "utf8mb3" as hardcoded, so it crashes with corrupted table. Fix: Changed Table_check_intact::check() definition to allow both utf8mb3 and utf8mb4 by checking prefix and changing the upgrade scripts to explicitly use utf8mb3
-
- 25 Jun, 2023 9 commits
-
-
Monty authored
-
Monty authored
This is mainly done to be able to push to 11.0 The test is moved in 10.6 to another file, which will add back the test.
-
Michael Widenius authored
MDEV-29253 Detect incompatible MySQL partition scheme and either convert them or report to user and in error log. This task is about converting in place MySQL 5.6 and 5.7 partition tables to MariaDB as part of mariadb-upgrade. - Update TABLE_SHARE::init_from_binary_frm_image() to be able to read MySQL frm files with partitions. - Create .par file, if it do not exists, on open of partitioned table. Executing mariadb-upgrade will create all the missing .par files. The MySQL .frm file will be changed to MariaDB format after next ALTER TABLE. Other changes: - If we are using stored mysql_version to distingush between MySQL and MariaDB .frm file information, do not upgrade mysql_version in the .frm file as part of CHECK TABLE .. FOR UPGRADE as this would cause problems next time we parse the .frm file.
-
Monty authored
- Moved view checks after privilege tables are fixed. This is to avoid warnings about wrongly defined mysql.proc when checking views. - Don't use stat tables before they have been fixed. - Don't run mysql_fix_view() if 'FOR MYSQL' is used if the view is already a MariaDB view. - Added 'FOR UPGRADE' as an option for 'REPAIR VIEW' to be able to detect if the REPAIR command comes from mariadb_upgrade. In this case we get a warning, instead of an error, if a definer of a view does not exists.
-
Vicentiu Ciorbaru authored
In this case, one would end up calling my_error(ER_BAD_DB_ERROR, ...) with a null ptr for DB, which caused a NULL ptr dereference.
-
Vicentiu Ciorbaru authored
-
Vicentiu Ciorbaru authored
The original code generated a warning in gcc 13.1
-
Monty authored
-
Monty authored
-
- 21 Jun, 2023 3 commits
-
-
Brandon Nesterenko authored
When opening and locking tables, if triggers will be invoked in a separate database, thd->set_db() is invoked, thus freeeing the memory and headers which thd->db had previously pointed to. In row based replication, the event execution logic initializes thd->db to point to the database which the event targets, which is owned by the corresponding table share (introduced in d9898c9a for MDEV-7409). The problem then, is that during the table opening and locking process for a row event, memory which belongs to the table share would be freed, which is not valid. This patch replaces the thd->reset_db() calls to thd->set_db(), which copies-by-value, rather than by reference. Then when the memory is freed, our copy of memory is freed, rather than memory which belongs to a table share. Notes: 1. The call to change thd->db now happens on a higher-level, in Rows_log_event::do_apply_event() rather than ::do_exec_row(), in the call stack. This is because do_exec_row() is called within a loop, and each invocation would redundantly set and unset the db to the same value. 2. thd->set_db() is only used if triggers are to be invoked, as there is no vulnerability in the non-trigger case, and copying memory would be an unnecessary inefficiency. Reviewed By: ============ Andrei Elkin <andrei.elkin@mariadb.com>
-
Monty authored
The reason for the crash wad that 'best splitting' optimization predicted less rows to be found than what opt_range did. This code in apply_selectivity_for_table(), when using use_cond_selectivity=1, was not prepared for this case which caused an assert in debug builds. Production builds is not affected. The fix is to choose the smaller of the two row counts. It will have a minimum on costs when using use_cond_selectivity=1 and should not cause any problems in production.
-
Monty authored
MDEV-31445 Server crashes in ha_partition::index_blocks / cost_for_index_read The crash happened in the case where partition pruning finds 0 partitions.
-
- 20 Jun, 2023 1 commit
-
-
Sergei Petrunia authored
-
- 19 Jun, 2023 1 commit
-
-
Meng-Hsiu Chiang authored
-Wdeprecated-declarations: Replace deprecated xmlXPathInit() with xmlInitParser()[1] -Wmaybe-uninitialized: `fil1` was initialized to 0 in commit 0138220f to fix compiler warnings, but `fil2` was missed. ref: [1]: https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-xpath.html#xmlXPathInit
-
- 18 Jun, 2023 14 commits
-
-
Sergei Golubchik authored
-
Sergei Golubchik authored
-
Sergei Golubchik authored
storage/innobase/fsp/fsp0fsp.cc:3108:58: error: conversion to ‘uint16_t {aka short unsigned int}’ from ‘unsigned int’ may alter its value [-Werror=conversion] storage/innobase/handler/handler0alter.cc:10202:25: error: conversion to ‘unsigned char:7’ from ‘ulint {aka unsigned int}’ may alter its value [-Werror=conversion]
-
Sergei Golubchik authored
AES_ENCRYPT(str, key, [, iv [, mode ]]) AES_DECRYPT(str, key, [, iv [, mode ]]) mode is aes-{128,192,256}-{ecb,cbc,ctr} e.g. "aes-128-cbc". and a @@block_encryption_mode variable for the default value of mode change in behavior: AES_ENCRYPT(str, key) can no longer be used in persistent virtual columns (and alike)
-
Sergei Golubchik authored
apparently it works now just fine, tests don't fail anymore
-
Sergei Golubchik authored
-
Sergei Golubchik authored
-
Sergei Golubchik authored
* invoke parent's cleanup() * don't reinit memroot, if already inited (causes memory leak) also move free_root() from destructor to cleanup() to not accumulate allocations from prepare and multiple executes
-
tanruixiang authored
The idea is to have simple functions that the user can combine to produce the exact result one wants, whether the user wants JSON object that has common keys with another JSON object, or same key/value pair etc. So making simpler function helps here. We accomplish this by making three separate functions. 1) JSON_OBJECT_FILTER_KEYS(Obj, Arr_keys): Put keys ( which are basically strings ) in hash, go over the object and get key one by one. If the key is present in the hash, add the key-value pair to result. 2) JSON_OBJECT_TO_ARRAY(Obj) : Create a string variable, Go over the json object, and add each key value pair as an array into the result. 3) JSON_ARRAY_INTERSECT(arr1, arr2) : Go over one of the json and add each item of the array in hash (after normalizing each item). Go over the second array, search the normalized item one by one in the hash. If item is found, add it to the result. Implementation Idea: Holyfoot ( Alexey Botchkov) Author: tanruixiang and Rucha Deodhar
-
Rucha Deodhar authored
objects Idea behind implementation: We get the json object specified by the json path. Then, transform it into key-value pairs by going over the json. Get each key-value pair one-by-one and return the result.
-
Thirunarayanan Balathandayuthapani authored
- Patch does shrinking the system tablespace during startup process. Steps for shrinking the system tablespace: 1) Find the last used extent in the system tablespace by iterating through the BITMAP in extent descriptor page 2) Check whether tablespace is being used within fixed size and If the last used extent is lesser than fixed size then set the desired target size to fixed size 3) Flush all the pages belong to system tablespace in flush list 4) Truncate the truncated pages from FSP_FREE and FSP_FREE_FRAG list 5) Reset the bitmap in descriptor pages for the truncated pages 6) Update the FSP_SIZE and FSP_FREE_LIMIT in header page 7) In case of multiple files, calculate the truncated last file size and do the truncation in last file - recv_sys_t::apply(): Handle the truncation of the system tablespace only if we have recv_size of tablespace exists
-
Thirunarayanan Balathandayuthapani authored
After further I/O on a tablespace has been stopped (for example due to DROP TABLE or an operation that rebuilds a table), page cleaner thread tries to flush the pending writes for the tablespace and releases the tablespace reference even though it was not acquired. fil_space_t::flush(): Don't release the tablespace when it is being stopped and closed Thanks to Marko Mäkelä for suggesting this patch.
-
Sergei Golubchik authored
view creation (that mysqltest automatically does in --view protocol) can cause sp cache invalidation, and that will cause the test to fail (because the test checks that invalidation did not happen). disable view protocol in the parts of the test where this is the case
-
Dmitry Shulga authored
The follow-up patch to check in mtr tests that recompilation of a SP's instruction doesn't lead to eviction of SP from sp_cache. This patch adds the debug keyword 'check_sp_cache_not_invalidated' checked in sp_cache_flush_obsolete. In case this debug keyword is set the macros DBUG_SUICIDE() called to cause test failure. The function sp_cache_flush_obsolete() is called on opening a stored routine. So setting this keyword before second execution of some stored routine that supposed to cause recompilation of SP's statement will guarantee that this stored routing not evicted from sp_cache. Suggested approach has one limitation - the statement CREATE/ALTER/DROP VIEW forces invalidation of the whole sp_cache (by invoking the function sp_cache_invalidate()). So, for those tests (actually, there are very small number of such tests) that create/alter/drop a view before the second execution of some stored routine, the debug keyword 'check_sp_cache_not_invalidated' isn't set. The proposal to add some way a check that a stored routine is not force out from sp_cache on re-parsing a failing statement of a stored routine was done during reiew, that is the reason the proposed change has been formatted as a separate patch.
-