summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* return accidentally removed in 45d4f6b97b4811b1b7783dcd19526be1dbb196dc commentbb-10.4-MDEV-30889Oleksandr Byelkin2023-04-271-0/+6
|
* MDEV-30889: 3 - Item_in_optimizer leakOleksandr Byelkin2023-04-265-24/+33
| | | | Keep Item_in_optimizer cache always (but only once) in statement memory.
* MDEV-30889: 2 - Allocation in TABLE_SHARE::init_from_sql_statement_stringOleksandr Byelkin2023-04-261-15/+0
| | | | | Fix leack in TABLE_SHARE::init_from_sql_statement_string by removing uneeded switching arenas.
* MDEV-30889: 1 - Allocation in Item_subselect::mark_as_dependentOleksandr Byelkin2023-04-261-2/+2
| | | | | | Fix leack in Item_subselect::mark_as_dependent (allocation of temporary list in statement memory inctroduced in f4d552104364fe195237f39862d91f657c7a34cb )
* 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>
* 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
* | | MDEV-28976 fixup: A better fixMarko Mäkelä2023-04-191-1/+2
| | | | | | | | | | | | | | | | | | do_shutdown_server(): After sending SIGKILL, invoke wait_until_dead(). Thanks to Sergei Golubchik for pointing out that the previous fix does not actually work.
* | | MDEV-30076 ibuf_insert tries to insert the entry for uncommitted indexThirunarayanan Balathandayuthapani2023-04-191-0/+4
| | | | | | | | | | | | - Change buffer should not buffer the changes for uncommitted index
* | | MDEV-31025 Redundant table alter fails when fixed columnThirunarayanan Balathandayuthapani2023-04-194-6/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | stored externally row_merge_buf_add(): Has strict assert that fixed length mismatch shouldn't happen while rebuilding the redundant row format table btr_index_rec_validate(): Fixed size column can be stored externally. So sum of inline stored length and external stored length of the column should be equal to total column length
* | | MDEV-24011 InnoDB: Failing assertion: index_cache->words == NULL in ↵Thirunarayanan Balathandayuthapani2023-04-191-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fts0fts.cc line 551 This issue happens when race condition happens when DDL and fts optimize thread. DDL adds the new index to fts cache. At the same time, fts optimize thread clears the cache and reinitialize it. Take cache init lock before reinitializing the cache. fts_sync_commit() should take dict_sys mutex to avoid the deadlock with create index.
* | | MDEV-28976: mtr must wait for server to actually dieMarko Mäkelä2023-04-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | do_shutdown_server(): Call wait_until_dead() also when we are forcibly killing the process (timeout=0). We have evidence that killing the process may take some time and cause mystery failures in crash recovery tests. For InnoDB, several failures were observed between commit da094188f60bf67e3d90227304a4ea256fe2630f and commit 0ee1082bd2e7e7049c4f0e686bad53cf7ba053ab when no advisory file locking was being used by default.
* | | MDEV-30955 Explicit locks released too early in rollback pathDaniele Sciascia2023-04-185-5/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Assertion `thd->mdl_context.is_lock_owner()` fires when a client is disconnected, while transaction and and a table is opened through `HANDLER` interface. Reason for the assertion is that when a connection closes, its ongoing transaction is eventually rolled back in `Wsrep_client_state::bf_rollback()`. This method also releases explicit which are expected to survive beyond the transaction lifetime. This patch also removes calls to `mysql_ull_cleanup()`. User level locks are not supported in combination with Galera, making these calls unnecessary.
* | | MDEV-30862 Assertion `mode_ == m_high_priority' failedDaniele Sciascia2023-04-183-0/+48
| | | | | | | | | | | | | | | CREATE TABLE AS SELECT is not supported in combination with streaming replication.
* | | rocksdb: Define _GNU_SOURCE during fallocate CMake probeFlorian Weimer2023-04-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The glibc headers declare fallocate only if _GNU_SOURCE is defined. Without this change, the probe fails with C compilers which do not support implicit function declarations even if the system does in fact support the fallocate function. Upstream rocksdb does not need this because the probe is run with the C++ compiler, and current g++ versions define _GNU_SOURCE automatically.
* | | alloca() fixDaniel Black2023-04-131-2/+4
| | | | | | | | | | | | | | | Corrections from 1e58b8afc086da755cf9209ed17fc36351da5563. * Re-add #pragma alloca for AIX - now in my_alloca.h
* | | MDEV-30402: Encrypted mariabackup SST breaks on distributions with newer socatJulius Goryavsky2023-04-131-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds a new 'no-sni' option to socat which is required to properly authenticate with newer socat versions (after version 1.7.4+). This option is needed to disable the automatic use of the SNI feature (Server Name Indication) since the SST script directly specifies the commonname if necessary and automatic activation of the SNI feature is unnecessary in such scenarios.
* | | MDEV-20773 Error from UPDATE when estimating selectivity of a rangeIgor Babaev2023-04-123-0/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This bug could affect multi-update statements as well as single-table update statements processed as multi-updates when the where condition contained a range condition over a non-indexed varchar column. The optimizer calculates selectivity of such range conditions using histograms. For each range the buckets containing endpoints of the the range are determined with a procedure that stores the values of the endpoints in the space of the record buffer where values of the columns are usually stored. For a range over a varchar column the value of a endpoint may exceed the size of the buffer and in such case the value is stored with truncation. This truncations cannot affect the result of the calculation of the range selectivity as the calculation employes only the beginning of the value string. However it can trigger generation of an unexpected error on this truncation if an update statement is processed. This patch prohibits truncation messages when selectivity of a range condition is calculated for a non-indexed column. Approved by Oleksandr Byelkin <sanja@mariadb.com>
* | | MDEV-31039 mariadb-backup: remove global variables ds_data and ds_metaAlexander Barkov2023-04-129-221/+289
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a non-functional change. simplifying the code logic: - removing global variables ds_data and ds_meta - passing these variables as parameters to functions instead - adding helper classes: Datasink_free_list and Backup_datasinks - moving some function accepting a ds_ctxt parameter as methods to ds_ctxt.
* | | MDEV-26175 : Assertion `! thd->in_sub_stmt' failed in bool ↵Jan Lindström2023-04-114-1/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | trans_rollback_stmt(THD*) If we are inside stored function or trigger we should not commit or rollback current statement transaction. Signed-off-by: Julius Goryavsky <julius.goryavsky@mariadb.com>
* | | fix typolilinjie2023-04-102-2/+2
| | | | | | | | | | | | Signed-off-by: lilinjie <1136268146@qq.com>
* | | MDEV-28190 sql_mode makes MDEV-371 virtual column expressions nondeterministicAlexander Barkov2023-04-065-0/+213
| | | | | | | | | | | | | | | This problem was fixed earlier by MDEV-27653. Adding MTR tests only.
* | | MDEV-30072 Wrong ORDER BY for a partitioned prefix key + NOPADAlexander Barkov2023-04-062-0/+72
| | | | | | | | | | | | | | | This problem was earlier fixed by MDEV-30034. Adding MTR tests only.
* | | MDEV-25887 "Got notification message from PID xxxx, but reception only ↵Sergei Golubchik2023-04-051-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | permitted for main PID yyyy" in systemd during SST server has systemd support and calls sd_notify() to communicate the status to systemd. mariabackup links the whole server in, but it should not notify systemd, because it's not started or managed by systemd.
* | | MDEV-29602 : Galera debug build crashes when the spider plugin is enabledJan Lindström2023-04-041-0/+3
| | | | | | | | | | | | | | | | | | Spider system tables should be created so that wsrep_on=OFF. Signed-off-by: Julius Goryavsky <julius.goryavsky@mariadb.com>
* | | MDEV-30971 Add a new system variable aria_data_home_dirAlexander Barkov2023-04-0410-1/+203
| | |
* | | MDEV-30034 UNIQUE USING HASH accepts duplicate entries for tricky collationsAlexander Barkov2023-04-0418-237/+659
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Adding a new argument "flag" to MY_COLLATION_HANDLER::strnncollsp_nchars() and a flag MY_STRNNCOLLSP_NCHARS_EMULATE_TRIMMED_TRAILING_SPACES. The flag defines if strnncollsp_nchars() should emulate trailing spaces which were possibly trimmed earlier (e.g. in InnoDB CHAR compression). This is important for NOPAD collations. For example, with this input: - str1= 'a ' (Latin letter a followed by one space) - str2= 'a ' (Latin letter a followed by two spaces) - nchars= 3 if the flag is given, strnncollsp_nchars() will virtually restore one trailing space to str1 up to nchars (3) characters and compare two strings as equal: - str1= 'a ' (one extra trailing space emulated) - str2= 'a ' (as is) If the flag is not given, strnncollsp_nchars() does not add trailing virtual spaces, so in case of a NOPAD collation, str1 will be compared as less than str2 because it is shorter. - Field_string::cmp_prefix() now passes the new flag. Field_varstring::cmp_prefix() and Field_blob::cmp_prefix() do not pass the new flag. - The branch in cmp_whole_field() in storage/innobase/rem/rem0cmp.cc (which handles the CHAR data type) now also passed the new flag. - Fixing UCA collations to respect the new flag. Other collations are possibly also affected, however I had no success in making an SQL script demonstrating the problem. Other collations will be extended to respect this flags in a separate patch later. - Changing the meaning of the last parameter of Field::cmp_prefix() from "number of bytes" (internal length) to "number of characters" (user visible length). The code calling cmp_prefix() from handler.cc was wrong. After this change, the call in handler.cc became correct. The code calling cmp_prefix() from key_rec_cmp() in key.cc was adjusted according to this change. - Old strnncollsp_nchar() related tests in unittest/strings/strings-t.c now pass the new flag. A few new tests also were added, without the flag.
* | | Make 'move_file' command more reliable in 3 innodb testsLorna Luo2023-04-034-26/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The tests innodb.import_tablespace_race, innodn.restart, and innodb.innodb-wl5522 move the tablespace file between the data directory and the tmp directory specified by global environment variables. However this is risky because it's not unusual that the set tmp directory (often under /tmp) is mounted on another disk partition or device, and 'move_file' command may fail with "Errcode: 18 'Invalid cross-device link.'" For innodb.import_tablespace_race and innodb.innodb-wl5522, moving files across directories is not necessary. Modify the tests so they rename files under the same directory. For innodb.restart, instead of moving between datadir and MYSQL_TMPDIR, move the files under MYSQLTEST_VARDIR. 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.
* | | Make 'move_file' command more reliable in mysqltestLorna Luo2023-04-031-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The tests innodb.import_tablespace_race, innodn.restart, and innodb.innodb-wl5522 move the tablespace file between the data directory and the tmp directory specified by global environment variables. However this is risky because it's not unusual that the set tmp directory (often under /tmp) is mounted on another disk partition or device, and 'move_file' command may fail with "Errcode: 18 'Invalid cross-device link.'" To stabilize mysqltest in the described scenario, and prevent such behavior in the future, let make_file() check both from file path and to file path and make sure they are either both under MYSQLTEST_VARDIR or MYSQL_TMP_DIR. 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.