summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* MDEV-30608: rpl.rpl_delayed_parallel_slave_sbm sometimes fails with ↵bb-10.3-MDEV-30608Brandon Nesterenko2023-02-083-0/+44
| | | | | | | | | | | | | | | | | | | | Seconds_Behind_Master should not have used second transaction timestamp One of the constraints added in the MDEV-29639 patch, is that only the first event after idling should update last_master_timestamp; and as long as the replica has more events to execute, the variable should not be updated. The corresponding test, rpl_delayed_parallel_slave_sbm.test, aims to verify this; however, if the IO thread takes too long to queue events, the SQL thread can appear to catch up too fast. This fix ensures that the relay log has been fully written before executing the events. Note that the underlying cause of this test failure needs to be addressed as a bug-fix, this is a temporary fix to stop test failures. To track work on the bug-fix for the underlying issue, please see MDEV-30619.
* 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>
* | MDEV-30010 post-push: fixing test results.mariadb-10.3.38Andrei2023-01-282-8/+52
|/
* MDEV-30457 Windows, signtool error "No file digest algorithm specified."Vladislav Vaintroub2023-01-241-1/+1
| | | | | Add /fd parameter. It is now mandatory for the recent versions of signtool
* MDEV-30323 Some DDLs like ANALYZE can complete on parallel slave out of orderbb-10.3-andreiAndrei2023-01-244-3/+237
| | | | | | | | | | | ANALYZE was observed to race over a preceding in binlog order DML in updating the binlog and slave gtid states. Tagging ANALYZE and other admin class commands in binlog by the fixes of MDEV-17515 left a flaw allowing such race leading to the gtid mode out-of-order error. This is fixed now to observe by ADMIN commands the ordered access to the slave gtid status variables and binlog.
* MDEV-30010 Slave (additional info): Commit failed due to failure of an ↵Andrei2023-01-242-0/+97
| | | | | | | | earlier commit on which this one depends Error_code: 1964 This commit merely adds is a Read-Committed version MDEV-30225 test solely to prove the RC isolation yields ROW binlog format as it is supposed to per docs.
* MDEV-30081 Crash with splitting from constant mergeable derived tableIgor Babaev2023-01-243-1/+108
| | | | | | | | | | This bug manifested itself in very rare situations when splitting optimization was applied to a materialized derived table with group clause by key over a constant meargeable derived table that was in inner part of an outer join. In this case the used tables for the key to access the split table incorrectly was evaluated to a not empty table map. Approved by Oleksandr Byelkin <sanja@mariadb.com>
* MDEV-29639: Seconds_Behind_Master is incorrect for Delayed, Parallel ReplicasBrandon Nesterenko2023-01-246-9/+231
| | | | | | | | | | | | | | | | | | | | | | | Problem ======== On a parallel, delayed replica, Seconds_Behind_Master will not be calculated until after MASTER_DELAY seconds have passed and the event has finished executing, resulting in potentially very large values of Seconds_Behind_Master (which could be much larger than the MASTER_DELAY parameter) for the entire duration the event is delayed. This contradicts the documented MASTER_DELAY behavior, which specifies how many seconds to withhold replicated events from execution. Solution ======== After a parallel replica idles, the first event after idling should immediately update last_master_timestamp with the time that it began execution on the primary. Reviewed By =========== Andrei Elkin <andrei.elkin@mariadb.com>
* Added comments re JOIN::all_fields, JOIN::fields_listSergei Petrunia2023-01-241-2/+20
|
* Update 10.3 HELP tablesIan Gilfillan2023-01-241-46/+46
|
* MDEV-30248 Infinite sequence of recursive calls when processing embedded CTEIgor Babaev2023-01-235-81/+311
| | | | | | | | | | | | | | | | This patch fixes the patch for bug MDEV-30248 that unsatisfactorily resolved the problem of resolution of references to CTE. In some cases when such a reference has the same table name as the name of one of CTEs containing this reference the reference could be resolved incorrectly that led to an invalid select tree where units could be mutually dependent. This in its turn could lead to an infinite sequence of recursive calls or to falls into infinite loops. The patch also removes LEX::resolve_references_to_cte_in_hanging_cte() as with the new code for resolution of CTE references the call of this function is not needed anymore. Approved by Oleksandr Byelkin <sanja@mariadb.com>
* MDEV-15178: Filesort::make_sortorder: Assertion `pos->field != __null |Sergei Petrunia2023-01-236-19/+188
| | | | | | | | | | | | | | | | | | | | (Initial patch by Varun Gupta. Amended and added comments). When the query has both 1. Aggregate functions that require sorting data by group, and 2. Window functions we need to use two temporary tables. The first temp.table will hold the join output. Then it is passed to filesort(). Reading it in sorted order allows to compute the aggregate functions. Then, we need to write their values into the second temp. table. Then, Window Function computation step can pass that to filesort() and read them in the order it needs. Failure to create the second temp. table would cause an assertion failure: window function could would not find where to get the values of the aggregate functions.
* Fix connect bson.cpp warningVicențiu Ciorbaru2023-01-201-1/+1
| | | | The ptyp variable is unused.
* Fix mroonga warning of use-after-freeVicențiu Ciorbaru2023-01-201-2/+2
|
* Minimize unsafe C functions usage - replace strcat() and strcpy() (and ↵Mikhail Chalov2023-01-2023-162/+221
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | strncat() and strncpy()) with custom safe_strcat() and safe_strcpy() functions The MariaDB code base uses strcat() and strcpy() in several places. These are known to have memory safety issues and their usage is discouraged. Common security scanners like Flawfinder flags them. In MariaDB we should start using modern and safer variants on these functions. This is similar to memory issues fixes in 19af1890b56c6c147c296479bb6a4ad00fa59dbb and 9de9f105b5cb88249acc39af73d32af337d6fd5f but now replace use of strcat() and strcpy() with safer options strncat() and strncpy(). However, add '\0' forcefully to make sure the result string is correct since for these two functions it is not guaranteed what new string will be null-terminated. Example: size_t dest_len = sizeof(g->Message); strncpy(g->Message, "Null json tree", dest_len); strncat(g->Message, ":", sizeof(g->Message) - strlen(g->Message)); size_t wrote_sz = strlen(g->Message); size_t cur_len = wrote_sz >= dest_len ? dest_len - 1 : wrote_sz; g->Message[cur_len] = '\0'; 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 -- Reviewer and co-author Vicențiu Ciorbaru <vicentiu@mariadb.org> -- Reviewer additions: * The initial function implementation was flawed. Replaced with a simpler and also correct version. * Simplified code by making use of snprintf instead of chaining strcat. * Simplified code by removing dynamic string construction in the first place and using static strings if possible. See connect storage engine changes.
* MDEV-30052 Crash with a query containing nested WINDOW clausesIgor Babaev2023-01-206-17/+130
| | | | | | | | | | Use SELECT_LEX to save lists for ORDER BY and GROUP BY before parsing WINDOW clauses / specifications. This is needed for proper parsing of a nested WINDOW clause when a WINDOW clause is used in a subquery contained in another WINDOW clause. Fix assignment of empty SQL_I_List to another one (in case of empty list next shoud point on first).
* Add my_afree after my_alloca in early return caseEric Herman2023-01-201-0/+3
| | | | | The code already had a call to `my_afree` in the normal return case, but failed to do so in the early return case.
* MDEV-23335 MariaBackup Incremental Does Not Reflect Dropped/Created DatabasesAlexander Barkov2023-01-193-1/+146
|
* MDEV-30422 Merge new release of InnoDB 5.7.41 to 10.3Marko Mäkelä2023-01-171-4/+11
| | | | | | | | | | | | | | | | | | | | MySQL 5.7.41 includes one InnoDB change mysql/mysql-server@d2d6b2dd00f709bc528386009150d4bc726e25a0 that seems to be applicable to MariaDB Server 10.3 and 10.4. Even though commit 5b9ee8d8193a8c7a8ebdd35eedcadc3ae78e7fc1 seems to have fixed sporadic failures on our CI systems, it is theoretically possible that another race condition remained. buf_flush_page_cleaner_coordinator(): In the final loop, wait also for buf_get_n_pending_read_ios() to reach 0. In this way, if a secondary index leaf page was read into the buffer pool and ibuf_merge_or_delete_for_page() modified that page or some change buffer pages, the flush loop would execute until the buffer pool really is in a clean state. This potential data corruption bug does not affect MariaDB Server 10.5 or later, thanks to commit b42294bc6409794bdbd2051b32fa079d81cea61d which removed change buffer merges that are not explicitly requested.
* New CC 3.1Oleksandr Byelkin2023-01-161-0/+0
|
* MDEV-30378 Versioned REPLACE succeeds with ON DELETE RESTRICT constraintNikita Malyavin2023-01-124-1/+89
| | | | | | | | | | | node->is_delete was incorrectly set to NO_DELETE for a set of operations. In general we shouldn't rely on sql_command and look for more abstract ways to control the behavior. trg_event_map seems to be a suitable way. To mind replica nodes, it is ORed with slave_fk_event_map, which stores trg_event_map when replica has triggers disabled.
* fix typoslilinjie2023-01-125-9/+9
| | | | Signed-off-by: lilinjie <lilinjie@uniontech.com>
* MDEV-25277: mysqlbinlog --verbose cannot read row events with compressed ↵Brandon Nesterenko2023-01-113-5/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | columns: Don't know how to handle column type: 140 Problem: ======= Mysqlbinlog cannot show the type of a compressed column when two levels of verbosity is provided. Solution: ======== Extend the log event printing logic to handle and tag compressed types. Behavioral Changes: ================== Old: When mysqlbinlog is called in verbose mode and the database uses compressed columns, an error is returned to the user. New: The output will append “ COMPRESSED” on the type of compressed columns Reviewed By =========== Andrei Elkin <andrei.elkin@mariadb.com>
* MDEV-30220: rsync SST completely ignores aria-log-dir-pathJulius Goryavsky2023-01-113-8/+83
| | | | | | | | | | | | This commit adds support for the --aria-log-dir-path option on the command line and for the aria-log-dir-path option in the configuration file to the SST scripts, since before this change these parameters were completely ignored during SST - SST scripts assumed that aria logs files are always located in the same directory as logs for innodb. Tests for this change will be added as a separate commit, along with tests for MDEV-30157 and MDEV-28669.
* MDEV-30157: Galera SST doesn't properly handle undo* files from innodbJulius Goryavsky2023-01-111-5/+30
| | | | | | This fix adds separate handling for "undo*" files that contain undo logs as part of innodb files and adds a filter for undo* to the main filter used when initially transferring files with rsync.
* pre-MDEV-30157 & pre-MDEV-28669: fixes before the main correctionsJulius Goryavsky2023-01-113-51/+118
| | | | | | | | | | | | | | | | | | | | This commit adds even more correct handling of parameters with paths when they contain leading or trailing spaces and/or slashes. Also it fixes problems that occur when the user specified explicit paths to additional directories, but these paths match the specified path of the data directory - in this case, additional subdirectories should be treated (in relation to the data directory) in the same way as if these paths were not specified or as if they are implicitly specified as "." or "./". But prior to this fix, existing code treated any values as if they were completely separate directories, whether or not they actually point to the same location to which datadir points to - and this sometimes resulted in incorrect file transfers. This fix does not contain separate tests, as tests will be part of the main commit(s). This fix has been made as a separate commit to facilitate review for major substantive fixes related to MDEV-30157 and MDEV-28669.
* MDEV-28602 Wrong result with outer join, merged derived table and viewSergei Petrunia2023-01-114-0/+263
| | | | | | | | | | | | | | | | | | (Variant 3, initial variant was by Rex Jonston) A LEFT JOIN with a constant as a column of the inner table produced wrong query result if the optimizer had to write the inner table column into a temp table. Query pattern: SELECT ... FROM (SELECT /*non-mergeable select*/ FROM t1 LEFT JOIN (SELECT 'Y' as Val) t2 ON ...) as tbl Fixed this by adding Item_direct_view_ref::save_in_field() which follows the pattern of Item_direct_view_ref's save_org_in_field(), save_in_result_field() and val_XXX() functions: * call check_null_ref() and handle NULL value * if we didn't get a NULL-complemented row, call Item_direct_ref's function.
* Remove an unused parameterMarko Mäkelä2023-01-111-5/+3
| | | | | | lock_rec_has_to_wait(): Remove the unused parameter for_locking that had been originally added in commit df4dd593f29aec8e2116aec1775ad4b8833d8c93
* clang15 warnings - unused vars and old prototypesDaniel Black2023-01-109-41/+14
| | | | | | | | | | | | | | | | | | | | | clang15 finally errors on old prototype definations. Its also a lot fussier about variables that aren't used as is the case a number of time with loop counters that aren't examined. RocksDB was complaining that its get_range function was declared without the array length in ha_rocksdb.h. While a constant is used rather than trying to import the Rdb_key_def::INDEX_NUMBER_SIZE header (was causing a lot of errors on the defination of other orders). If the constant does change can be assured that the same compile warnings will tell us of the error. The ha_rocksdb::index_read_map_impl DBUG_EXECUTE_IF was similar to the existing endless functions used in replication tests. Its rather moot point as the rocksdb.force_shutdown test that uses myrocks_busy_loop_on_row_read is currently disabled.
* MDEV-30342 Wrong "Truncated incorrect DECIMAL value" warning/errorDaniel Black2023-01-096-8/+62
| | | | | | | | | regression from MDEV-29540 / 8c389393695. INSERT SELECT errors needed to be unconditionally ignored. As this touches the CREATE .. SELECT functionality, show the equalivent test there.
* MDEV-17093: SOURCE_REVISION in log (postfix - not in help)Daniel Black2023-01-081-2/+3
| | | | Don't display the source revision in the mysqld --help output.
* MDEV-27624 Wrong result for nested left join using not_exists optimizationIgor Babaev2023-01-064-6/+171
| | | | | | | | | | | | | | | | | | | | | | | This bug affected queries with nested left joins having the same last inner table such that not_exists optimization could be applied to the most inner outer join when optimizer chose to use join buffers. The bug could lead to producing wrong a result set. If the WHERE condition a query contains a conjunctive IS NULL predicate over a non-nullable column of an inner table of a not nested outer join then not_exists optimization can be applied to tho the outer join. With this optimization when looking for matches for a certain record from the outer table of the join the records of the inner table can be ignored right after the first match satisfying the ON condition is found. In the case of nested outer joins having the same last inner table this optimization still can be applied but only if all ON conditions of the embedding outer joins are satisfied. Such check was missing in the code that tried to apply not_exists optimization when join buffers were used for outer join operations. This problem has been already fixed in the patch for bug MDEV-7992. Yet there it was resolved only for the cases when join buffers were not used for outer joins. Approved by Oleksandr Byelkin <sanja@mariadb.com>
* MDEV-17093: SOURCE_REVISION in log and handle_fatal_signalHaidong Ji2023-01-062-16/+12
| | | | | | | | | | | | | | | | | | MariaDB MDEV-12583 added `SOURCE_REVISION` variable that exposes the SHA1 of source code commit that the current running engine was built from. This info is useful for troubleshooting and debugging. This commit does the following: - addes the `SOURCE_REVISION` value into engine error log. - when a crash triggers handle_fatal_signal, the `SOURCE_REVISION` will be included in crash report. - resolves MDEV-20344: startup messages belong in stderr/error-log not stdout 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, Inc.
* fix typoslilinjie2023-01-056-7/+7
| | | | Signed-off-by: lilinjie <lilinjie@uniontech.com>
* MDEV-30329: mariadb-service-convert resets systemd service to default User=rootAndrew Hutchings2023-01-031-1/+1
| | | | | | | | | If mariadb-service-convert is run and the user variable is unset then this sets `User=` in `[Service]`, which then tries to run mariadb as root, which in-turn fails. This only happens when mysqld_safe is missing which is all the time now. So don't set `User=` if there is no user variable. Reviewer: Sergei Golubchik <serg@mariadb.org> (in PR #2382)
* MDEV-29988 group by fixSergei Golubchik2023-01-023-5/+23
|
* fixes for json.json_table and main.func_json in --psSergei Golubchik2023-01-021-1/+2
|
* MDEV-29988: (spider fix) Major performance regression with 10.6.11Oleksandr Byelkin2023-01-021-0/+6
| | | | Make Item_direct_ref_to_item transparent for Spider
* MDEV-29988: Major performance regression with 10.6.11Dmitry Shulga2023-01-026-18/+215
| | | | | | | | | | | The idea is to put Item_direct_ref_to_item as a transparent and permanent wrapper before a string which require conversion. So that Item_direct_ref_to_item would be the only place where the pointer to the string item is stored, this pointer can be changed and restored during PS execution as needed. And if any permanent (subquery) optimization would need a pointer to the item, it'll use a pointer to the Item_direct_ref_to_item - which is a permanent item and won't go away.
* MDEV-29988: (revert) Major performance regression with 10.6.11Dmitry Shulga2023-01-021-11/+2
| | | | | | Reverted changed in server code introduced by the commit bd9274faa469cc164099c7497c18a0e0a9b1184b. Tests from this commit are retained.
* MDEV-30102 file missing in development librariesSergei Golubchik2023-01-021-0/+1
| | | | | move mariadb_capi_rename.h out of private server headers, because it's included by mysql.h which is not private.
* --skip-name-resolve=0 didn't workSergei Golubchik2023-01-027-21/+12
| | | | | custom code in `case OPT_SKIP_RESOLVE` was overriding the correct value from handle_options().
* ignore changes in submodules when committing everythingSergei Golubchik2023-01-021-0/+2
| | | | | covers `git commit -a` and `git citool` (`git add`, `git status`, etc). they can still be added explicitly
* MDEV-30151 parse error 1=2 not between/inSergei Golubchik2023-01-024-6/+25
| | | | | | | | | | | | | | | | the parser couldn't parse `1=2 not between 3 and 5` after `2` it expected only NOT2_SYM, but not NOT_SYM (visible from the sql_yacc.output file), which resulted in Syntax error ... near 'not between 3 and 4' The parser was confused by a rather low NOT_SYM precedence and %prec BETWEEN_SYM didn't resolve this confusion. As a fix, let's remove any %precedence from NOT_SYM and specify %prec explicitly in the only place where it matters for NOT_SYM. In other places, such as for NOT BETWEEN, NOT_SYM won't have a precedence, so bison won't be confused about it.