summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* bump the VERSIONbb-10.6-bumpversionDaniel Bartholomew2023-05-101-1/+1
|
* MDEV-31216: Make sure that lsof does not fail on installTuukka Pasanen2023-05-091-4/+4
| | | | | | Command lsof can fail on Debian install. Revert logic more like old one to make sure that there is no failing and still does don't boundce on shellcheck.
* MDEV-30952: Reformat Debian pre- and postscripts if-clausesTuukka Pasanen2023-05-084-42/+101
| | | | | | Debian install scripts if-clauses are not formatted as they should be. This commit formats Debian Pre and Post script if-clauses.
* MDEV-30952: Fix shellcheck problems on Debian scriptsTuukka Pasanen2023-05-083-22/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | Commit fixes several ShellCheck found problems in Debian Pre- and Postscripts. Debian script mariadb-server-10.6.postrm contains shellcheck Fixed problems are: https://www.shellcheck.net/wiki/SC2166 -- Prefer [ p ] && [ q ] as [ p -a q... https://www.shellcheck.net/wiki/SC2006 -- Use $(...) notation instead of le... https://www.shellcheck.net/wiki/SC1091 -- Not following: /usr/share/debconf... Debian script mariadb-server-10.6.postinst contains shellcheck Fixed problems are: https://www.shellcheck.net/wiki/SC2129 -- Consider using { cmd1; cmd2; } >>... https://www.shellcheck.net/wiki/SC1091 -- Not following: /usr/share/debconf... https://www.shellcheck.net/wiki/SC1072 -- Expected test to end here (don't ... https://www.shellcheck.net/wiki/SC1073 -- Couldn't parse this test expressi... https://www.shellcheck.net/wiki/SC1009 -- The mentioned syntax error was in... Debian script mariadb-server-10.6.preinst contains shellcheck Fixed problems are: https://www.shellcheck.net/wiki/SC2231 -- Quote expansions in this for loop... https://www.shellcheck.net/wiki/SC2166 -- Prefer [ p ] && [ q ] as [ p -a q... https://www.shellcheck.net/wiki/SC2001 -- See if you can use ${variable//se... https://www.shellcheck.net/wiki/SC1091 -- Not following: /usr/share/debconf... https://www.shellcheck.net/wiki/SC1007 -- Remove space after = if trying to...
* MDEV-30952: Reformat Debian post and pre scriptsTuukka Pasanen2023-05-086-92/+92
| | | | | | There is several misindentation inside Debian post and pre installation scripts. False indentation with space as indent space should be 2 and indentation with tabs.
* MDEV-31162 Crash for query using ROWNUM over multi-table view with ORDER BYbb-10.6-igorIgor Babaev2023-05-026-9/+98
| | | | | | | | | | | | | | | | | | | | | This bug could cause a crash of the server when processing a query with ROWNUM() if it used in its FROM list a reference to a mergeable view defined as SELECT over more than one table that contained ORDER BY clause. When a mergeable view with ORDER BY clause and without LIMIT clause is used in the FROM list of a query that does not have ORDER BY clause the ORDER BY clause of the view is moved to the query. The code that performed this transformation forgot to delete the moved ORDER BY list from the view. If a query contains ROWNUM() and uses a mergeable multi-table view with ORDER BY then according to the current code of TABLE_LIST::init_derived() the view has to be forcibly materialized. As the query and the view shared the same items in its ORDER BY lists they could not be properly resolved either in the query or in the view. This led to a crash of the server. This patch has returned back the original signature of LEX::can_not_use_merged() to comply with 10.4 code of the condition that checks whether a megeable view has to be forcibly materialized. Approved by Oleksandr Byelkin <sanja@mariadb.com>
* MDEV-31045: Update debian/rules to be in sync to MariaDB LTS 10.6Tuukka Pasanen2023-05-021-2/+2
| | | | | | To make sure that PMEM problem does not happen again sync 10.9 and up debian/rules to make sure that they are not making anymore problems with autobake-debs.sh
* MDEV-31143 Crash for query using ROWNUM() over view with ORDER BYIgor Babaev2023-04-304-2/+44
| | | | | | | | | | | | | | | When processing a query over a mergeable view at some conditions checked at prepare stage it may be decided to materialize the view rather than to merge it. Before this patch in such case the field 'derived' of the TABLE_LIST structure created for the view remained set to 0. As a result the guard condition preventing range analysis for materialized views did not work properly. This led to a call of some handler method for the temporary table created to contain the view's records that was supposed to be used only for opened tables. However temporary tables created for materialization of derived tables or views are not opened yet when range analysis is performed. Approved by Oleksandr Byelkin <sanja@mariadb.com>
* MDEV-30812: Improve output cardinality estimates for hash joinbb-10.6-mdev30812Sergei Petrunia2023-04-2810-53/+363
| | | | | | | | | | | Introduce @@optimizer_switch flag: hash_join_cardinality When it is on, use EITS statistics to produce tighter bounds for hash join output cardinality. Amended by Monty. Reviewed by: Monty <monty@mariadb.org>
* MDEV-31073 Server crash, assertion `table != 0 && view->field_translation != ↵Oleksandr Byelkin2023-04-276-3/+95
| | | | | | | | 0' failure with ROWNUM and view Now the same rule applied to vews and derived tables. So we should allow merge of views (and derived) in queries with rownum, because it do not change results, only makes query plans better.
* Nes CC 3.3Oleksandr Byelkin2023-04-271-0/+0
|
* MDEV-29401 InnoDB history list length increased in 10.6 compared to 10.5Marko Mäkelä2023-04-275-67/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | The InnoDB buffer pool and locking were heavily refactored in MariaDB Server 10.6. Among other things, dict_sys.mutex was removed, and the contended lock_sys.mutex was replaced with a combination of lock_sys.latch and distributed latches in hash tables. Also, a default value was changed to innodb_flush_method=O_DIRECT to improve performance in write-heavy workloads. One thing where an adjustment was missing is around the parameters innodb_max_purge_lag (number of committed transactions waiting to be purged), and innodb_max_purge_lag_delay (maximum number of microseconds to delay a DML operation). purge_coordinator_state::do_purge(): Pass the history_size to trx_purge() and reset srv_dml_needed_delay if the history is empty. Keep executing the loop non-stop as long as srv_dml_needed_delay is set. trx_purge_dml_delay(): Made part of trx_purge(). Set srv_dml_needed_delay=0 when nothing can be purged (!n_pages_handled). row_mysql_delay_if_needed(): Mimic the logic of innodb_max_purge_lag_wait_update(). Reviewed by: Thirunarayanan Balathandayuthapani
* Cleanup of MDEV-14974: --port ignored for --host=localhostbb-10.6-montyMonty2023-04-2713-537/+111
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The old code added to 10.6 was inconsisting in how TCP/IP and socket connection was chosen. One got also a confusing warning in some cases. Examples: > ../client/mysql --print-defaults ../client/mysql would have been started with the following arguments: --socket=/tmp/mariadbd.sock --port=3307 --no-auto-rehash > ../client/mysql ERROR 2002 (HY000): Can't connect to local server through socket '/tmp/mariadbd.sock' (2) > ../client/mysql --print-defaults ../client/mysql would have been started with the following arguments: --socket=/tmp/mariadbd.sock --port=3307 --no-auto-rehash > ../client/mysql --port=3333 WARNING: Forcing protocol to TCP due to option specification. Please explicitly state intended protocol. ERROR 2002 (HY000): Can't connect to server on 'localhost' (111) > ../client/mysql --port=3333 --socket=sss ERROR 2002 (HY000): Can't connect to local server through socket 'sss' (2) > ../client/mysql --socket=sss --port=3333 ERROR 2002 (HY000): Can't connect to local server through socket 'sss' (2) Some notable things: - One gets a warning if one uses just --port if config file sets socket - Using port and socket gives no warning - Using socket and then port still uses socket This patch changes things the following ways: If --port= is given on the command line, the the protocol is automatically changed to "TCP/IP". - If --socket= is given on the command line, the protocol is automatically changed to "socket". - The last option wins - No warning is given if protocol changes automatically.
* Merge 10.5 into 10.6Marko Mäkelä2023-04-2726-72/+573
|\
| * Merge 10.4 into 10.5Marko Mäkelä2023-04-2724-50/+533
| |\
| | * MDEV-30218 update test resultSergei Golubchik2023-04-261-1/+1
| | | | | | | | | | | | followup for d1a46c68cd4
| | * MDEV-11356 Option skip-core-file does not workSergei Golubchik2023-04-265-14/+9
| | | | | | | | | | | | | | | remove ancient hard-coded treatment of --core-file. This enables normal my_getopt behavior for the already existing sysvar
| | * MDEV-30620 Trying to lock uninitialized LOCK_parallel_entryAndrei2023-04-251-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The error was seen by a number of mtr tests being caused by overdue initialization of rpl_parallel::LOCK_parallel_entry. Specifically, SHOW-SLAVE-STATUS might find in rpl_parallel::workers_idle() a gtid domain hash entry already inserted whose mutex had not done mysql_mutex_init(). Fixed with swapping the mutex init and the its entry's stack insertion. Tested with a generous number of `mtr --repeat` of a few of the reported to fail tests, incl rpl.parallel_backup.
| | * MDEV-31121: ANALYZE statement produces 0 for all timings in embedded serverSergei Petrunia2023-04-253-0/+31
| | | | | | | | | | | | | | | Timers require my_timer_init() call. It was made only in mysqld_main(). Call it also from init_embedded_server().
| | * MDEV-30430: Enabling system versioning on tables without primary key breaks ↵Brandon Nesterenko2023-04-243-6/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | replication When replicating MDL events for a table that uses system versioning without primary keys, ensure that for data sets with duplicate records, the updates to these records with duplicates are enacted on the correct row. That is, there was a bug (reported in MDEV-30430) such that the function to find the row to update would stop after finding the first matching record. However, in the absence of primary keys, the version of the record is needed to compare the row to ensure we are updating the correct one. The fix, therefore, updates the record comparison functionality to use system version columns when there are no primary keys on the table. Reviewed By: ============ Andrei Elkin <andrei.elkin@mariadb.com>
| | * MDEV-28798: Cosmetic Changes OnlyBrandon Nesterenko2023-04-241-7/+7
| | | | | | | | | | | | Removed trailing whitespaces
| | * MDEV-28798: Previously Binlog Encrypted Master Segfaults on Binlog Dump with ↵Brandon Nesterenko2023-04-247-5/+261
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using_Gtid=Slave_Pos Problem: ======== A master can segfault if it can't set up decryption for its binary log during a binlog dump with Using_Gtid=Slave_Pos. If slave connects using GTID mode, the master will call into log.cc::get_gtid_list_event(), which iterate through binlog events looking for a Gtid_list_log_event. On an encrypted binlog that the master cannot decrypt, the first event will be a START_ENCRYPTION_EVENT which will call into the following decryption branch if (fdle->start_decryption((Start_encryption_log_event*) ev)) errormsg= ‘Could not set up decryption for binlog.’; The event iteration however, does not stop in spite of this error. The master will try to read the next event, but segfault while trying to decrypt it because decryption failed to initialize. Solution: ======== Break the event iteration if decryption cannot be set up. Reviewed By: ============ Andrei Elkin <andrei.elkin@mariadb.com>
| | * MDEV-31102 Crash when pushing condition into view defined as unionIgor Babaev2023-04-243-2/+128
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This bug could manifest itself at the first execution of prepared statement created for queries using a materialized view defined as union. A crash could happen for sure if the query contained a condition pushable into the view and this condition was over the column defined via a complex string expression requiring implicit conversion from one charset to another for some of its sub-expressions. The bug could cause crashes when executing PS for some other queries whose optimization needed building clones for such expressions. This bug was introduced in the patch for MDEV-29988 where the class Item_direct_ref_to_item was added. The implementations of the virtual methods get_copy() and build_clone() were invalid for the class and this could cause crashes after the method build_clone() was called for expressions containing objects of the Item_direct_ref_to_item type. Approved by Sergei Golubchik <serg@mariadb.com>
| * | MDEV-29644 post-merge fixupYuchen Pei2023-04-273-24/+42
| | | | | | | | | | | | | | | Applying b98375f instead of 9b32e4b for version 10.5-10.8. Applying 5075f4e instead of 9b32e4b for version 10.9+.
* | | MDEV-30837: Remove usage of AWK in autobake-debs.shTuukka Pasanen2023-04-271-1/+5
| | | | | | | | | | | | | | | | | | | | | AWK is used in autobake-debs.sh for printing information about created DEB packages. This can be rewrite with bash inner commands read and echo.
* | | MDEV-30837: Remove usage of AWK from Debian init and postinst scriptsTuukka Pasanen2023-04-272-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | AWK in used in Debian SysV-init and postinst scripts to determine is there enough space starting MariaDB database or create new database to target destination. These AWK scripts can be rewrited to use pure SH or help using Coreutils which is mandatory for usage of MariaDB currently. Reasoning behind this is to get rid of one very less used dependency
* | | MDEV-31132 Deadlock between DDL and purge of InnoDB historyMarko Mäkelä2023-04-269-35/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | log_free_check(): Assert that the caller must not hold exclusive lock_sys.latch. This was the case for calls from ibuf_delete_for_discarded_space(). This caused a deadlock with another thread that would be holding a latch on a dirty page that would need to be written so that the checkpoint would advance and log_free_check() could return. That other thread was waiting for a shared lock_sys.latch. fil_delete_tablespace(): Do not invoke ibuf_delete_for_discarded_space() because in DDL operations, we will be holding exclusive lock_sys.latch. trx_t::commit(std::vector<pfs_os_file_t>&), innodb_drop_database(), row_purge_remove_clust_if_poss_low(), row_undo_ins_remove_clust_rec(), row_discard_tablespace_for_mysql(): Invoke ibuf_delete_for_discarded_space() on the deleted tablespaces after releasing all latches.
* | | MDEV-26055: Correct the formula for adaptive flushingMarko Mäkelä2023-04-261-13/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | page_cleaner_flush_pages_recommendation(): If dirty_pct is between innodb_max_dirty_pages_pct_lwm and innodb_max_dirty_pages_pct, scale the effort relative to how close we are to innodb_max_dirty_pages_pct. The previous formula was missing a multiplication by 100. Tested by: Axel Schwenke
* | | MDEV-30804 addendum for 10.6+ branchesJulius Goryavsky2023-04-252-7/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | This addition to MDEV-30804 is relevant for 10.6+, it excludes the mixed transaction section using both innodb and aria storage engines from the galera_var_replicate_aria_off test, since such transactions cannot be executed unless aria supports two-phase transaction commit. No additional tests are required as this commit fixes the mtr test itself.
* | | MDEV-26827 fixup: Prevent a hang in LRU evictionMarko Mäkelä2023-04-251-0/+5
| | | | | | | | | | | | | | | | | | buf_pool_t::page_cleaner_wakeup(): If for_LRU=true, wake up the page cleaner immediately, also when it is in a timed wait. This avoids an unnecessary delay of up to 1 second.
* | | Merge 10.5 into 10.6Marko Mäkelä2023-04-2583-624/+2326
|\ \ \ | |/ /
| * | MDEV-31124 Innodb_data_written miscounts doublewritesMarko Mäkelä2023-04-253-9/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When commit a5a2ef079cec378340d8b575aef05974b0b3442e implemented asynchronous doublewrite, the writes via the doublewrite buffer started to be counted incorrectly, without multiplying them by innodb_page_size. srv_export_innodb_status(): Correctly count the Innodb_data_written. buf_dblwr_t: Remove submitted(), because it is close to written() and only Innodb_data_written was interested in it. According to its name, it should count completed and not submitted writes. Tested by: Axel Schwenke
| * | MDEV-31038: Parallel Replication Breaks if XA PREPARE Fails Updating Slave ↵Brandon Nesterenko2023-04-245-22/+208
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GTID State If a replica failed to update the GTID slave state when committing an XA PREPARE, the replica would retry the transaction and get an out-of-order GTID error. This is because the commit phase of an XA PREPARE is bifurcated. That is, first, the prepare is handled by the relevant storage engines. Then second, the GTID slave state is updated as a separate autocommit transaction. If the second phase fails, and the transaction is retried, then the same transaction is attempted to be committed again, resulting in a GTID out-of-order error. This patch fixes this error by immediately stopping the slave and reporting the appropriate error. That is, there was logic to bypass the error when updating the GTID slave state table if the underlying error is allowed for retry on a parallel slave. This patch adds a parameter to disallow the error bypass, thereby forcing the error state to still happen. Reviewed By ============ Andrei Elkin <andrei.elkin@mariadb.com>
| * | Merge branch '10.4' into 10.5Oleksandr Byelkin2023-04-2479-594/+2124
| |\ \ | | |/
| | * A cleanup for MDEV-30968 mariadb-backup does not copy Aria logs if ↵Alexander Barkov2023-04-241-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | aria_log_dir_path is used Fixing buildbot failures on mariabackup.aria_log_dir_path_rel. The problem was that directory_exists() was called with the relative aria_log_dir_path value, while the current directory in mariadb-backup is not necessarily equal to datadir when MTR is running. Fix: - Moving building the absolute path un level upper: from the function copy_back_aria_logs() to the function copy_back(). - Passing the built absolute path to both directory_exists() and copy_back_aria_logs() as a parameter.
| | * MDEV-31085 Crash when processing multi-update using view with optimizer_trace onIgor Babaev2023-04-223-2/+377
| | | | | | | | | | | | | | | | | | | | | | | | | | | This bug caused server crash when processing a multi-update statement that used views if optimizer tracing was enabled. The bug was introduced in the patch for MDEV-30539 that could incorrectly detect the most top level selects of queries if views were used in them. Approved by Oleksandr Byelkin <sanja@mariadb.com>
| | * MDEV-30968 mariadb-backup does not copy Aria logs if aria_log_dir_path is usedAlexander Barkov2023-04-219-8/+281
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - `mariadb-backup --backup` was fixed to fetch the value of the @@aria_log_dir_path server variable and copy aria_log* files from @@aria_log_dir_path directory to the backup directory. Absolute and relative (to --datadir) paths are supported. Before this change aria_log* files were copied to the backup only if they were in the default location in @@datadir. - `mariadb-backup --copy-back` now understands a new my.cnf and command line parameter --aria-log-dir-path. `mariadb-backup --copy-back` in the main loop in copy_back() (when copying back from the backup directory to --datadir) was fixed to ignore all aria_log* files. A new function copy_back_aria_logs() was added. It consists of a separate loop copying back aria_log* files from the backup directory to the directory specified in --aria-log-dir-path. Absolute and relative (to --datadir) paths are supported. If --aria-log-dir-path is not specified, aria_log* files are copied to --datadir by default. - The function is_absolute_path() was fixed to understand MTR style paths on Windows with forward slashes, e.g. --aria-log-dir-path=D:/Buildbot/amd64-windows/build/mysql-test/var/...
| | * MDEV-30713 field length handling for CONNECT engineDaniel Black2023-04-215-12/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fp->field_length was unsigned and therefore the negative condition around it. Backport of cc182aca9352 fixes it, however to correct the consistent use of types pcf->Length needs to be unsigned too. At one point pcf->Precision is assigned from pcf->Length so that's also unsigned. GetTypeSize is assigned to length and has a length argument. A -1 default value seemed dangerious to case, so at least 0 should assert if every hit.
| | * Merge branch '10.3' into 10.4Oleksandr Byelkin2023-04-2117-179/+413
| | |\
| | | * MDEV-30818 invalid ssl prevents bootstrapSergei Golubchik2023-03-093-1/+12
| | | | | | | | | | | | | | | | | | | | in bootstrap the server reads stdin and does not listen to network. it won't use ssl anyway
| | | * main.bootstrap test cleanupSergei Golubchik2023-03-092-55/+89
| | | |
| | | * bump the VERSIONSergei Golubchik2023-03-091-1/+1
| | | |
| | | * Merge branch '10.3' into bb-10.3-releaseOleksandr Byelkin2023-02-0614-122/+313
| | | |\
| | | | * MDEV-29644 a potential bug of null pointer dereference in ↵bb-10.3-mdev-29644Nayuta Yanagisawa2023-02-035-56/+136
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | spider_db_mbase::print_warnings() The function spider_db_mbase::print_warnings() can potentially result in a null pointer dereference. Remove the null pointer dereference by cleaning up the function. Some small changes to the original commit 422fb63a9bbee35c50b6c7be19d199afe0bc98fa. Co-Authored-By: Yuchen Pei <yuchen.pei@mariadb.com>
| | | | * MDEV-30509: mariadb-plugin-connect: introduce curl as recommendsSalman Mohammadi2023-01-311-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | in order to be able to retrieve files using REST queries. Otherwise, `ERROR 1105 (HY000): Curl not installed.` will be thrown.
| | | | * MDEV-30475 Windows, mtr - Remove outdated instructions on how to install ↵Vladislav Vaintroub2023-01-261-30/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | post-mortem debugger Also, use standard C:\symbols location for OS debugging symbols cache, rather than own invention C:\cdb_symbols.
| | | | * MDEV-30151 parse error 1=2 not between/inbb-10.3-bar-MDEV-30151Alexander Barkov2023-01-264-30/+130
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes the problem by adding a new rule booleat_test. This makes the grammar clearer and less conflicting. Additionally, fixing %prec in this grammar branch: - | boolean_test IS NULL_SYM %prec PREC_BELOW_NOT + | boolean_test IS NULL_SYM %prec IS to have consistently "%prec IS" in all grammar branches starting with "boolean_test IS ...". It's not clear why these three rules needed different %prec before the fix: - boolean_test IS TRUE - boolean_test IS UNKNOWN - boolean_test IS NULL
| | | | * Revert "MDEV-30151 parse error 1=2 not between/in"Alexander Barkov2023-01-264-25/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit eba099184e1f6704894694ea41f97f216eae5f21. A different patch with less shift-reduce conflicts is coming.
| | | | * MDEV-28616 Crash when using derived table over union with order by clausebb-10.3-igorIgor Babaev2023-01-253-0/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This bug manifested itself when the server processed a query containing a derived table over union whose ORDER BY clause included a subquery with unresolvable column reference. For such a query the server crashed when trying to resolve column references in the ORDER BY clause used by union. For any union with ORDER BY clause an extra SELECT_LEX structure is created and it is attached to SELECT_LEX_UNIT structure of the union via the field fake_select_lex. The outer context for fake_select_lex must be the same as for other selects of the union. If the union is used in the FROM list of a derived table then the outer context for fake_select_lex must be set to NULL in line with other selects of the union. It was not done and it caused a crash when searching for possible resolution of an unresolvable column reference occurred in a subquery used in the ORDER BY clause. Approved by Oleksandr Byelkin <sanja@mariadb.com>
| | * | | Minimize unsafe C functions usage - replace strcat() and strcpy()Mikhail Chalov2023-04-207-148/+178
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Similar to 567b6812 continue to replace use of strcat() and strcpy() with safer options strncat() and strncpy(). 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