summaryrefslogtreecommitdiff
path: root/mysql-test
Commit message (Collapse)AuthorAgeFilesLines
* MDEV-29440 InnoDB instant ALTER TABLE recovery must use READ UNCOMMITTEDbb-10.6-MDEV-29440Marko Mäkelä2022-09-062-2/+44
| | | | | | | | | | | | | | | | | | | | | | | | In commit 8f8ba758559e473f643baa0a0601d321c42517b9 (MDEV-27234) the data dictionary recovery was changed to use READ COMMITTED so that table-rebuild operations (OPTIMIZE TABLE, TRUNCATE TABLE, some forms of ALTER TABLE) would be recovered correctly. However, for operations that avoid a table rebuild thanks to being able to instantly ADD, DROP or reorder columns, recovery must use the READ UNCOMMITTED isolation level so that changes to the hidden metadata record can be rolled back. We will detect instant operations by detecting uncommitted changes to SYS_COLUMNS in case there is no uncommitted change of SYS_TABLES.ID for the table. In any table-rebuilding DDL operation, the SYS_TABLES.ID (and likely also the table name) will be updated. As part of rolling back the instant ALTER TABLE operation, after the operation on the hidden metadata record has been rolled back, a rollback of an INSERT into SYS_COLUMNS in row_undo_ins_remove_clust_rec() will invoke trx_t::evict_table() to discard the READ UNCOMMITTED definition of the table. After that, subsequent recovery steps will load and use the correct table definition.
* MDEV-13542 fixup: Allow purge to run in a testMarko Mäkelä2022-09-061-4/+2
|
* MDEV-29425 Buffer overflow in dict_index_t::col_info::add()Thirunarayanan Balathandayuthapani2022-09-012-13/+50
| | | | | - During rollback of DDL, InnoDB should copy the collation changed column into the index heap
* MDEV-29435 CHECK TABLE forgets to release latches after reporting failureMarko Mäkelä2022-09-012-0/+6
| | | | | | btr_validate_level(): Invoke mtr.commit() after a failure. This omission was introduced in commit 0b47c126e31cddda1e94588799599e138400bcf8 (MDEV-13542).
* MDEV-29374 InnoDB recovery fails with "Data structure corruption"Marko Mäkelä2022-08-315-0/+5
| | | | | | | | | | | | | | | | | recv_sys_t::free_corrupted_page(): Identify the corrupted page in an error or warning message. buf_page_free(): Just in case, register the page as modified. This should already have been done in mtr_t::free() as part of fseg_free_page_low(). mtr_t::memo_push(): Simplify a condition, so that when invoked with MTR_MEMO_PAGE_X_MODIFY, we will do the right thing. fseg_free_page_low(): Remove an accidentally added return statement that prevented mtr_t::free() from being called. This fixes a regression that was introduced in commit 0b47c126e31cddda1e94588799599e138400bcf8 (MDEV-13542).
* Merge 10.5 into 10.6Marko Mäkelä2022-08-3010-29/+376
|\
| * Merge 10.4 into 10.5Marko Mäkelä2022-08-309-29/+313
| |\
| | * Merge 10.3 into 10.4Marko Mäkelä2022-08-307-29/+276
| | |\
| | | * MDEV-13888: innodb_fts.innodb_fts_plugin failedMarko Mäkelä2022-08-302-25/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add ORDER BY to make the test deterministic. Add FLUSH TABLES to avoid crash recovery warnings about the table mysql.plugin. This tends to occur on Valgrind, where the server shutdown could presumably time out, resulting in a forced kill.
| | | * MDEV-29409 Buffer overflow in my_wc_mb_filename() on RENAME TABLEMarko Mäkelä2022-08-302-2/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dict_table_rename_in_cache(), dict_table_get_highest_foreign_id(): Reserve sufficient space for the fkid[] buffer, and ensure that the fkid[] will be NUL-terminated. The fkid[] must accommodate both the database name (which is already encoded in my_charset_filename) and the constraint name (which must be converted to my_charset_filename) so that we can check if it is in the format databasename/tablename_ibfk_1 (all encoded in my_charset_filename).
| | | * MDEV-29258 Failing assertion for name length on RENAME TABLEMarko Mäkelä2022-08-302-2/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | trx_undo_page_report_rename(): Use the correct maximum length of a table name. Both the database name and the table name can be up to NAME_CHAR_LEN (64 characters) times 5 bytes per character in the my_charset_filename encoding. They are not encoded in UTF-8! fil_op_write_log(): Reserve the correct amount of log buffer for a rename operation. The file name will be appended by mlog_catenate_string(). rename_file_ext(): Reserve a large enough buffer for the file names.
| | | * MDEV-29403 innodb.innodb_sys_semaphore_waits fails with wrong errno 5014bb-10.3-elenstElena Stepanova2022-08-281-2/+2
| | | | | | | | | | | | | | | | take into account C/C specific CR_ERR_NET_WRITE error
| | | * MDEV-29350 Crash when IN predicand is used in eliminated GROUP BY clauseIgor Babaev2022-08-252-0/+190
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This bug affected some queries with an IN/ALL/ANY predicand or an EXISTS predicate whose subquery contained a GROUP BY clause that could be eliminated. If this clause used a IN/ALL/ANY predicand whose left operand was a single-value subquery then execution of the query caused a crash of the server after invokation of remove_redundant_subquery_clauses(). The crash was caused by an attempt to exclude the unit for the single-value subquery from the query tree for the second time by the function Item_subselect::eliminate_subselect_processor(). This bug had been masked by the bug MDEV-28617 until a fix for the latter that properly excluded units was pushed into 10.3. Approved by Oleksandr Byelkin <sanja@mariadb.com>
| | * | MDEV-18873 Server crashes in Compare_identifiers::operator or in ↵tmokmss2022-08-262-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | my_strcasecmp_utf8 upon ADD PERIOD IF NOT EXISTS with empty name empty identifier specified as `` ends up with a NULL LEX_CSTRING::str in lexer. This is not considered correct in upper layers, for example in Compare_identifiers::operator(). Empty column name is usually avoided by a check_column_name() call while parsing, and period name matches the column name completely. Hence, this fix uses the mentioned call for verification, too.
| * | | MDEV-23607 MariaBackup - align required GRANTS to cmd optionsDaniel Black2022-08-262-2/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since the 10.5 split of the privileges, the required GRANTs for various mariabackup operations has changed. In the addition of tests, a number of mappings where incorrect: The option --lock-ddl-per-table didn't require connection admin. The option --safe-slave-backup requires SLAVE MONITOR even without the --no-lock option.
* | | | Merge 10.5 into 10.6Marko Mäkelä2022-08-253-1/+139
|\ \ \ \ | |/ / /
| * | | Merge 10.4 into 10.5Marko Mäkelä2022-08-253-1/+139
| |\ \ \ | | |/ /
| | * | Merge 10.3 into 10.4Marko Mäkelä2022-08-253-1/+139
| | |\ \ | | | |/
| | | * update a global_suppressions() listSergei Golubchik2022-08-251-1/+1
| | | | | | | | | | | | | | | | followup for "remove invalid options from warning messages"
| | | * MDEV-28294: set default role bypasses Replicate_Wild_Ignore_Table: mysql.%Brandon Nesterenko2022-08-222-0/+138
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: ======== When replicating SET DEFAULT ROLE, the pre-update check (i.e. that in set_var_default_role::check()) tries to validate the existence of the given rules/user even when the targeted tables are ignored. When previously issued CREATE USER/ROLE commands are ignored by the replica because of the replication filtering rules, this results in an error because the targeted data does not exist. Solution: ======== Before checking that the given roles/user exist of a SET DEFAULT ROLE command, first ensure that the mysql.user and mysql.roles_mapping tables are not excluded by replication filters. Reviewed By: ============ Andrei Elkin <andrei.elkin@mariadb.com> Sergei Golubchik <serg@mariadb.com>
* | | | MDEV-29081 trx_t::lock.was_chosen_as_deadlock_victim race in lock_wait_end()Vlad Lesin2022-08-248-35/+179
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The issue is that trx_t::lock.was_chosen_as_deadlock_victim can be reset before the transaction check it and set trx_t::error_state. The fix is to reset trx_t::lock.was_chosen_as_deadlock_victim only in trx_t::commit_in_memory(), which is invoked on full rollback. There is also no need to have separate bit in trx_t::lock.was_chosen_as_deadlock_victim to flag transaction it was chosen as a victim of Galera conflict resolution, the same variable can be used for both cases except debug build. For debug build we need to distinguish deadlock and Galera's abort victims for debug checks. Also there is no need to check for deadlock in lock_table_enqueue_waiting() for Galera as the coresponding check presents in lock_wait(). Local variable "error_state" in lock_wait() was replaced with trx->error_state, because before the replace lock_sys_t::cancel<false>(trx, lock) and lock_sys.deadlock_check() could change trx->error_state, which then could be overwritten with the local "error_state" variable value. The lock_wait_suspend_thread_enter DEBUG_SYNC point name is misleading, because lock_wait_suspend_thread was eliminated in e71e613. It was renamed to lock_wait_start. Reviewed by: Marko Mäkelä, Jan Lindström.
* | | | MDEV-29314 Assertion `n_fields > n_cols' failed in ↵Thirunarayanan Balathandayuthapani2022-08-232-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dict_index_t::init_change_cols - Newly created InnoDB fulltext index does have only one column and doesn't associate with primary key fields during DDL. init_change_cols() has strict assertion that number of fields should be greater than number of collation change columns.
* | | | MDEV-29282 atomic.rename_trigger fails occasionallyThirunarayanan Balathandayuthapani2022-08-231-13/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts part of commit 212994f704496d01881f377e34e04bd007e5e298 (MDEV-28974) and implements a better fix that works in that special case while avoiding other failures. fil_name_process(): Do not rename the tablespace in deferred_spaces; it already contains the latest name for the space id. deferred_spaces::create(): In mariadb-backup --prepare, replace absolute data directory file path with short name relative to the backup directory and store it as filename while deferring tablespace file creation.
* | | | Merge 10.5 into 10.6Marko Mäkelä2022-08-232-0/+37
|\ \ \ \ | |/ / /
| * | | Merge 10.4 into 10.5Marko Mäkelä2022-08-222-0/+37
| |\ \ \ | | |/ /
| | * | MDEV-27101 Subquery using the ALL keyword on TIMESTAMP columns produces a ↵Alexander Barkov2022-08-222-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | wrong result TIMESTAMP columns were compared as strings in ALL/ANY comparison, which did not work well near DST time change. Changing ALL/ANY comparison to use "Native" representation to compare TIMESTAMP columns, like simple comparison does.
* | | | Merge 10.5 into 10.6Marko Mäkelä2022-08-2210-48/+95
|\ \ \ \ | |/ / /
| * | | Merge 10.4 into 10.5Marko Mäkelä2022-08-2210-48/+95
| |\ \ \ | | |/ /
| | * | Merge 10.3 into 10.4Marko Mäkelä2022-08-2210-48/+95
| | |\ \ | | | |/
| | | * MDEV-13013 fixup: Adjust a testMarko Mäkelä2022-08-221-10/+10
| | | |
| | | * MDEV-13013 InnoDB unnecessarily extends data filesThirunarayanan Balathandayuthapani2022-08-177-38/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - While creating a new InnoDB segment, allocates the extent before allocating the inode or page allocation even though the pages are present in fragment segment. This patch does reserve the extent when InnoDB ran out of fragment pages in the tablespace.
| | | * Merge branch '10.3' into bb-10.3-releaseOleksandr Byelkin2022-08-152-0/+46
| | | |\
| | | | * MDEV-27151: JSON_VALUE() does not parse NULL properties properlyRucha Deodhar2022-08-112-0/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Analysis: JSON_VALUE() returns "null" string instead of NULL pointer. Fix: When the type is JSON_VALUE_NULL (which is also a scalar) set null_value to true and return 0 instead of returning string.
| | * | | MDEV-25257 follow-up: Fix a testMarko Mäkelä2022-08-221-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ever since commit 09177eadc39ae1e777ad473970456cb9dd9c3993 the test innodb.row_format_redundant cannot work when the data file was created with innodb_checksum_algorithm=full_crc32. Backport of 10.5 commit a9d0bb12e68a11c119a3534f354c7a7ef13dd5b5
* | | | | MDEV-24626 fixup: mariabackup.compress_qpressMarko Mäkelä2022-08-191-0/+4
| | | | |
* | | | | Disabling atomic.rename_trigger test case because of frequentThirunarayanan Balathandayuthapani2022-08-161-0/+13
| | | | | | | | | | | | | | | | | | | | failures
* | | | | Merge branch '10.6' into bb-10.6-releaseOleksandr Byelkin2022-08-152-1/+27
|\ \ \ \ \
| * | | | | MDEV-29264: JSON function overflow error based on LONGTEXT fieldqggcs2022-08-132-1/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Analysis: The JSON functions(JSON_ARRAY[OBJECT|ARRAY_APPEND|ARRAY_INSERT|INSERT|SET|REPLACE]) result is truncated when the function is called based on LONGTEXT field. The overflow occurs when computing the result length due to the LONGTEXT max length is same as uint32 max length. It lead to wrong result length. Fix: Add static_cast<ulonglong> to avoid uint32 overflow and fix the arguments used.
* | | | | | Merge branch '10.5' into 10.6Oleksandr Byelkin2022-08-1010-15/+216
|\ \ \ \ \ \ | |/ / / / / |/| / / / / | |/ / / /
| * | | | Merge branch '10.4' into 10.5mariadb-10.5.17Oleksandr Byelkin2022-08-1010-15/+216
| |\ \ \ \ | | |/ / /
| | * | | Merge branch '10.3' into bb-10.4-releasemariadb-10.4.26Oleksandr Byelkin2022-08-1010-15/+216
| | |\ \ \ | | | |/ /
| | | * | my_safe_process: try to kill the process softly firstSergei Golubchik2022-08-101-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | first SIGTERM and if the process didn't die in 10 seconds, SIGKILL it. This allows various tools like `rr`, `gcov`, `gprof`, etc to flush their data to disk properly
| | | * | missing 'Sergei Golubchik2022-08-101-1/+1
| | | | |
| | | * | MDEV-23149 Server crashes in my_convert / ErrConvString::ptr / ↵Sergei Golubchik2022-08-104-10/+16
| | | | | | | | | | | | | | | | | | | | Item_char_typecast::check_truncation_with_warn
| | | * | take into account C/C specific CR_ERR_NET_WRITE errorSergei Golubchik2022-08-101-1/+1
| | | |/
| | | * Fix typos in the codebase.fluesvamp2022-08-091-1/+1
| | | |
| | | * Fixed that sp-no-valgrind.test is disabled on valgrind builds (not runs)Monty2022-08-082-1/+5
| | | |
| | | * MDEV-12325 Unexpected data type and truncation when using CTEMonty2022-08-082-0/+188
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When creating a recursive CTE, the column types are taken from the non recursive part of the CTE (this is according to the SQL standard). This patch adds code to abort the CTE if the calculated values in the recursive part does not fit in the fields in the created temporary table. The new code only affects recursive CTE, so it should not cause any notable problems for old applications. Other things: - Fixed that we get correct row numbers for warnings generated with WITH RECURSIVE Reviewer: Alexander Barkov <bar@mariadb.com>
* | | | MDEV-13542 fixup: Improve a recovery error messageMarko Mäkelä2022-08-0512-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A message used to say "failed to read or decrypt" but the "or decrypt" part was removed in commit 0b47c126e31cddda1e94588799599e138400bcf8 without adjusting rarely needed error message suppressions in some encryption tests. Let us improve the error message so that it mentions the file name, and adjust all error message suppressions in tests. Thanks to Oleksandr Byelkin for noticing one test failure.
* | | | fix testsOleksandr Byelkin2022-08-051-13/+19
| | | |