- 04 Feb, 2024 1 commit
-
-
Igor Babaev authored
This bug led to wrong result sets returned by the second execution of prepared statements from selects using mergeable derived tables pushed into external engine. Such derived tables are always materialized. The decision that they have to be materialized is taken late in the function mysql_derived_optimized(). For regular derived tables this decision is usually taken at the prepare phase. However in some cases for some derived tables this decision is made in mysql_derived_optimized() too. It can be seen in the code of mysql_derived_fill() that for such a derived table it's critical to change its translation table to tune it to the fields of the temporary table used for materialization of the derived table and this must be done after each refill of the derived table. The same actions are needed for derived tables pushed into external engines. Approved by Oleksandr Byelkin <sanja@mariadb.com>
-
- 02 Feb, 2024 3 commits
-
-
Sergei Petrunia authored
@@ -314,7 +314,7 @@ select straight_join * from t0, part ignore index (primary) where p_partkey=t0.a and p_size=1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t0 ALL NULL NULL NULL NULL 5 Using where +1 SIMPLE t0 ALL NULL NULL NULL NULL 6 Using where 1 SIMPLE part eq_ref i_p_size i_p_size 9 const,dbt3_s001.t0.a 1
-
Sergei Petrunia authored
Variant#3: moved the logic out of create_key_parts_for_pseudo_indexes Range Analyzer (get_mm_tree functions) can only process up to MAX_KEY=64 indexes. The problem was that calculate_cond_selectivity_for_table used it to estimate selectivities for columns, and since a table can have > MAX_KEY columns, would invoke Range Analyzer with more than MAX_KEY "pseudo-indexes". Fixed by making calculate_cond_selectivity_for_table() to run Range Analyzer with at most MAX_KEY pseudo-indexes. If there are more columns to process, Range Analyzer will be invoked multiple times. Also made this change: - param.real_keynr[0]= 0; + MEM_UNDEFINED(¶m.real_keynr, sizeof(param.real_keynr)); Range Analyzer should have no use on real_keynr when it is run with pseudo-indexes.
-
Alexander Barkov authored
mariadb-backup: Adding a function get_os_user() to detect the OS user name if the user name is not specified, to make mariadb-backup: - work like MariaDB client tools work - match its --help page, which says: -u, --user=name This option specifies the username used when connecting to the server, if that's not the current user.
-
- 01 Feb, 2024 2 commits
-
-
Alexander Barkov authored
MDEV-33355 Add a Galera-2-node-to-MariaDB replication MTR test cloning the slave with mariadb-backup Replication from a 2-node Galera cluster to a regular MariaDB server. Cloning the slave using mariadb-backup.
-
Alexander Barkov authored
-
- 31 Jan, 2024 2 commits
-
-
Nikita Malyavin authored
According to the standard, the autoincrement column (i.e. *identity column*) should be advanced each insert implicitly made by UPDATE/DELETE ... FOR PORTION. This is very unconvenient use in several notable cases. Concider a WITHOUT OVERLAPS key with an autoinc column: id int auto_increment, unique(id, p without overlaps) An update or delete with FOR PORTION creates a sense that id will remain unchanged in such case. The standard's IDENTITY reminds MariaDB's AUTO_INCREMENT, however the generation rules differ in many ways. For example, there's also a notion autoincrement index, which is bound to the autoincrement field. We will define our own generation rule for the PORTION OF operations involving AUTO_INCREMENT: * If an autoincrement index contains WITHOUT OVERLAPS specification, then a new value should not be generated, otherwise it should. Apart from WITHOUT OVERLAPS there is also another notable case, referred by the reporter - a unique key that has an autoincrement column and a field from the period specification: id int auto_increment, unique(id, s), period for p(s, e) for this case, no exception is made, and the autoincrementing rules will be proceeded accordung to the standard (i.e. the value will be advanced on implicit inserts).
-
Thirunarayanan Balathandayuthapani authored
Reason: ====== undo_space_dblwr test case fails if the first page of undo tablespace is not flushed before restart the server. While restarting the server, InnoDB fails to detect the first page of undo tablespace from doublewrite buffer. Fix: === Use "ib_log_checkpoint_avoid_hard" debug sync point to avoid checkpoint and make sure to flush the dirtied page before killing the server. innodb_make_page_dirty(): Fails to set srv_fil_make_page_dirty_debug variable.
-
- 30 Jan, 2024 1 commit
-
-
Tuukka Pasanen authored
There is no need for CMAKE_SYSTEM_PROCESSOR parameter in Debian build as dh_auto_configure should handle things better and more reliable
-
- 26 Jan, 2024 1 commit
-
-
Vladislav Vaintroub authored
-
- 24 Jan, 2024 1 commit
-
-
Alexander Barkov authored
write_record() when performing REPLACE has an optimization: - if the unique violation happened in the last unique key, then do UPDATE - otherwise, do DELETE+INSERT This patch changes the way of detecting if this optimization can be applied if the table has long (hash based) unique (i.e. UNIQUE..USING HASH) constraints. Problem: The old condition did not take into account that TABLE_SHARE and TABLE see long uniques differently: - TABLE_SHARE sees as HA_KEY_ALG_LONG_HASH and HA_NOSAME - TABLE sees as usual non-unique indexes So the old condition could erroneously decide that the UPDATE optimization is possible when there are still some unique hash constraints in the table. Fix: - If the current key is a long unique, it now works as follows: UPDATE can be done if the current long unique is the last long unique, and there are no in-engine (normal) uniques. - For in-engine uniques nothing changes, it still works as before: If the current key is an in-engine (normal) unique: UPDATE can be done if it is the last normal unique.
-
- 23 Jan, 2024 9 commits
-
-
Sergei Golubchik authored
use the original, not the truncated, field in the long unique prefix, that is, in the hash(left(field, length)) expression. because MyISAM CHECK/REPAIR in compute_vcols() moves table->field but not prefix fields from keyparts. Also, implement Field_string::cmp_prefix() for prefix comparison of CHAR columns to work.
-
Sergei Golubchik authored
no need to use it when both arguments have the same length
-
Sergei Golubchik authored
-
Sergei Golubchik authored
use thd->start_time for the "start_time" column of the slow_log table. "current_time" here refers to the current_time() function return value not to the actual *current* time. also fixes MDEV-33267 User with minimal permissions can intentionally corrupt mysql.slow_log table
-
Sergei Golubchik authored
-
Sergei Golubchik authored
should fix numerous failures of main.bootstrap tets
-
Alexander Barkov authored
Item_func_quote did not calculate its max_length correctly for nullable arguments. Fix: In case if the argument is nullable, reserve at least 4 characters so the string "NULL" fits.
-
Daniel Black authored
MCOL-5611 supporting with Boost-1.80, the version "next_prime" disappears from https://github.com/boostorg/unordered/blob/boost-1.79.0/include/boost/unordered/detail/implementation.hpp makes it the currenly highest supported versions. Lets check this version. While CMake-3.19+ supports version ranges in package determinations this isn't supported for Boost in Cmake-3.28. So we check for the 1.80 and don't compile ColumnStore.
-
Dmitry Shulga authored
-
- 22 Jan, 2024 2 commits
-
-
Rex authored
Statements affect by this bug are all SQL statements that 1) prefixed with "EXPLAIN" 2) have a lower level join structure created for a union subquery. A bug in select_describe() passed an incorrect "result" object to mysql_explain_union(), resulting in unpredictable behaviour and out of context calls. Reviewed by: Oleksandr Byelkin, sanja@mariadb.com
-
Brandon Nesterenko authored
An existing binlog checksum can be overridden to 0 if writing a NULL payload when using Zlib for the computation. That is, calling into Zlib's crc32 with empty data initializes an incremental CRC computation to 0. This patch changes the Log_event_writer::write_data() to exit immediately if there is nothing to write, thereby bypassing the checksum computation. This follows the pattern of Log_event_writer::encrypt_and_write(), which also exits immediately if there is no data to write. Reviewed By: ============ Andrei Elkin <andrei.elkin@mariadb.com>
-
- 19 Jan, 2024 1 commit
-
-
Thirunarayanan Balathandayuthapani authored
MDEV-32968 InnoDB fails to restore tablespace first page from doublewrite buffer when page is empty recv_dblwr_t::find_first_page(): Free the allocated memory to read the first 3 pages from tablespace. innodb.doublewrite: Added sleep to ensure page cleaner thread wake up from my_cond_wait
-
- 17 Jan, 2024 1 commit
-
-
Sophist authored
-
- 16 Jan, 2024 1 commit
-
-
Alexander Barkov authored
Adding GEOMETRY type user variables.
-
- 15 Jan, 2024 1 commit
-
-
Thirunarayanan Balathandayuthapani authored
MDEV-32968 InnoDB fails to restore tablespace first page from doublewrite buffer when page is empty - InnoDB fails to find the space id from the page0 of the tablespace. In that case, InnoDB can use doublewrite buffer to recover the page0 and write into the file. - buf_dblwr_t::init_or_load_pages(): Loads only the pages which are valid.(page lsn >= checkpoint). To do that, InnoDB has to open the redo log before system tablespace, read the latest checkpoint information. recv_dblwr_t::find_first_page(): 1) Iterate the doublewrite buffer pages and find the 0th page 2) Read the tablespace flags, space id from the 0th page. 3) Read the 1st, 2nd and 3rd page from tablespace file and compare the space id with the space id which is stored in doublewrite buffer. 4) If it matches then we can write into the file. 5) Return space which matches the pages from the file. SysTablespace::read_lsn_and_check_flags(): Remove the retry logic for validating the first page. After restoring the first page from doublewrite buffer, assign tablespace flags by reading the first page. recv_recovery_read_max_checkpoint(): Reads the maximum checkpoint information from log file recv_recovery_from_checkpoint_start(): Avoid reading the checkpoint header information from log file Datafile::validate_first_page(): Throw error in case of first page validation fails.
-
- 14 Jan, 2024 1 commit
-
-
Tuukka Pasanen authored
Upstream Debian Sid which will become Debian Trixie (13) have dropped NCurses version 5 and changed dev package name just libncurses-dev
-
- 13 Jan, 2024 1 commit
-
-
Oleg Smirnov authored
Add INSERT ... SELECT to the list of commands that can be traced Approved by Sergei Petrunia (sergey@mariadb.com)
-
- 12 Jan, 2024 3 commits
-
-
Kristian Nielsen authored
The problem is the test is skipped after sourcing include/master-slave.inc. This leaves the slave threads running after the test is skipped, causing a following test to fail during rpl setup. Also rename have_normal_bzip.inc to the more appropriate _zlib. Signed-off-by: Kristian Nielsen <knielsen@knielsen-hq.org>
-
Anel Husakovic authored
- Closes PR #2839 - Usage of `Column_definition_fix_attributes()` suggested by Alexandar Barkov - thanks bar, that is better than hook in server code (reverted 22f3ebe4) - This method is called after parsing the data type: * in `CREATE/ALTER TABLE` * in SP: return data type, parameter data type, variable data type - We want to disallow all these use cases of MYSQL_JSON. - Reviewer: bar@mariadb.com cvicentiu@mariadb.org
-
Anel Husakovic authored
This reverts commit 22f3ebe4.
-
- 11 Jan, 2024 4 commits
-
-
Anel Husakovic authored
Closes PR #2839 Reviewer: cvicentiu@mariadb.org
-
Anel Husakovic authored
- We don't test `json` MySQL tables from `std_data` since the error `ER_TABLE_NEEDS_REBUILD ` is invoked. However MDEV-32235 will override this test after merge, but leave it to show behavior and historical changes. - Closes PR #2833 Reviewer: <cvicentiu@mariadb.org> <serg@mariadb.com>
-
Yuchen Pei authored
All Spider tables are recorded in the system table mysql.spider_tables. Deleting a spider table removes the corresponding rows from the system table, among other things. This patch makes it so that if spider could not find any record in the system table to delete for a given table, it should correctly report that no such Spider table exists.
-
Yuchen Pei authored
The field is assigned but unused, and it causes heap-use-after-free.
-
- 10 Jan, 2024 5 commits
-
-
Sergei Golubchik authored
remove thr_setconcurrency() followup for 8bbcaab1 Fix by Rainer Orth
-
Sergei Golubchik authored
mark auto-inc columns for read/write on INSERT, but only for read on UPDATE
-
Yuchen Pei authored
-
Yuchen Pei authored
When the host is not specified, it defaults to localhost.
-
Yuchen Pei authored
A new column was introduced to the show index output in 10.6 in f691d986 Thus we update the check of the number of columns to be at least 13, rather than exactly 13. Also backport an err number and format from 10.5 for better error messages when the column number is wrong.
-