summaryrefslogtreecommitdiff
path: root/mysql-test
Commit message (Collapse)AuthorAgeFilesLines
* MDEV-25114 Crash: WSREP: invalid state ROLLED_BACK (FATAL)bb-10.3-MDEV-25114sjaakola2021-09-178-28/+474
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch is the plan D variant for fixing potetial mutex locking order exercised by BF aborting and KILL command execution. In this approach, KILL command is replicated as TOI operation. This guarantees total isolation for the KILL command execution in the first node: there is no concurrent replication applying and no concurrent DDL executing. Therefore there is no risk of BF aborting to happen in parallel with KILL command execution either. Potential mutex deadlocks between the different mutex access paths with KILL command execution and BF aborting cannot therefore happen. TOI replication is used, in this approach, purely as means to provide isolated KILL command execution in the first node. KILL command should not (and must not) be applied in secondary nodes. In this patch, we make this sure by skipping KILL execution in secondary nodes, in applying phase, where we bail out if applier thread is trying to execute KILL command. This is effective, but skipping the applying of KILL command could happen much earlier as well. This patch also fixes mutex locking order and unprotected THD member accesses on bf aborting case. We try to hold THD::LOCK_thd_data during bf aborting. Only case where it is not possible is at wsrep_abort_transaction before call wsrep_innobase_kill_one_trx where we take InnoDB mutexes first and then THD::LOCK_thd_data. This will also fix possible race condition during close_connection and while wsrep is disconnecting connections. Added wsrep_bf_kill_debug test case Reviewed-by: Jan Lindström <jan.lindstrom@mariadb.com>
* Merge 10.2 into 10.3Marko Mäkelä2021-09-113-0/+14
|\
| * Fix an occasional timeout in innodb.alter_partitionedMarko Mäkelä2021-09-112-0/+8
| |
| * MDEV-26537 InnoDB corrupts files due to incorrect st_blksize calculationMarko Mäkelä2021-09-101-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The st_blksize returned by fstat(2) is not documented to be a power of 2, like we assumed in commit 58252fff15acfe7c7b0452a87e202e3f8e454e19 (MDEV-26040). While on Linux, the st_blksize appears to report the file system block size (which hopefully is not smaller than the sector size of the underlying block device), on FreeBSD we observed st_blksize values that might have been something similar to st_size. Also IBM AIX was affected by this. A simple test case would lead to a crash when using the minimum innodb_buffer_pool_size=5m on both FreeBSD and AIX: seq -f 'create table t%g engine=innodb select * from seq_1_to_200000;' \ 1 100|mysql test& seq -f 'create table u%g engine=innodb select * from seq_1_to_200000;' \ 1 100|mysql test& We will fix this by not trusting st_blksize at all, and assuming that the smallest allowed write size (for O_DIRECT) is 4096 bytes. We hope that no storage systems with larger block size exist. Anything larger than 4096 bytes should be unlikely, given that it is the minimum virtual memory page size of many contemporary processors. MariaDB Server on Microsoft Windows was not affected by this. While the 512-byte sector size of the venerable Seagate ST-225 is still in widespread use, the minimum innodb_page_size is 4096 bytes, and innodb_log_file_size can be set in integer multiples of 65536 bytes. The only occasion where InnoDB uses smaller data file block sizes than 4096 bytes is with ROW_FORMAT=COMPRESSED tables with KEY_BLOCK_SIZE=1 or KEY_BLOCK_SIZE=2 (or innodb_page_size=4096). For such tables, we will from now on preallocate space in integer multiples of 4096 bytes and let regular writes extend the file by 1024, 2048, or 3072 bytes. The view INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES.FS_BLOCK_SIZE should report the raw st_blksize. For page_compressed tables, the function fil_space_get_block_size() will map to 512 any st_blksize value that is larger than 4096. os_file_set_size(): Assume that the file system block size is 4096 bytes, and only support extending files to integer multiples of 4096 bytes. fil_space_extend_must_retry(): Round down the preallocation size to an integer multiple of 4096 bytes.
* | Merge branch '10.2' into 10.3Sergei Golubchik2021-09-094-54/+55
|\ \ | |/
| * fix main.truncate failures in --embeddedSergei Golubchik2021-09-094-54/+55
| |
* | Merge branch '10.2' into 10.3Vicențiu Ciorbaru2021-09-07116-1585/+3233
|\ \ | |/
| * MDEV-25325 built-in documentation for performance_schema tablesHaidong Ji2021-09-07107-1582/+3072
| | | | | | | | | | | | Improve documentation of performance_schema tables by appending COLUMN comments to tables. Additionally improve test coverage and update corresponding tests.
| * MDEV-23365: Assertion `!is_set() || (m_status == DA_OK_BULK && is_bulk_op())'bb-10.2-MDEV-23365Rucha Deodhar2021-09-062-0/+51
| | | | | | | | | | | | | | | | | | | | | | failed upon killed TRUNCATE Note: This is a backport of 1cb4caa66d5fd2a9bc095d68988324b7b358d70f from 10.3 Analysis: Assertion failure happens because less session memory is set and so table can't be reopened. So the statement can't be used. This error goes unreported. Fix: Return the error state.
| * MDEV-12055 binlog.binlog_stm_ctype_ucs postfixDaniel Black2021-09-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As highlighted in https://bugs.gentoo.org/807995, people occasionaly run tests in the 20:00->23:59:59 time range. Fixes 265e3253f1e5218c8f85f1c412575069cb15f2c0 binlog.binlog_stm_ctype_ucs 'mix' w1 [ fail ] Test ended at 2021-08-11 22:55:35 CURRENT_TEST: binlog.binlog_stm_ctype_ucs --- /var/tmp/portage/dev-db/mariadb-10.5.11/work/mysql/mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result 2021-06-18 18:19:11.000000000 +0800 +++ /var/tmp/portage/dev-db/mariadb-10.5.11/work/mysql/mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.reject 2021-08-11 22:55:34.993447479 +0800 @@ -76,21 +76,21 @@ /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; # at # -#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Start: binlog v 4, server v #.##.## created YYMMDD HH:MM:SS +#210811 22:55:34 server id # end_log_pos # CRC32 XXX Start: binlog v 4, server v #.##.## created 210811 22:55:34
| * MDEV-26518 ; Galera incorrectly handles primary or unique keys with any ↵bb-10.2-MDEV-26517Jan Lindström2021-09-024-0/+108
| | | | | | | | | | | | | | multi-byte character set We need to set temporary buffer large enough to fit also multi-byte characters.
| * MDEV-26517 : Galera test failure on galera_fk_cascade_delete_debugJan Lindström2021-09-021-1/+1
| | | | | | | | | | Move --error on --reap where it belongs and take a account that there could be different return codes.
| * MDEV-26521 Remove mdev-504.testVladislav Vaintroub2021-09-013-105/+0
| | | | | | | | | | | | | | | | This stress tests fails on not sufficiently tweaked windows boxes,due to rapid succession of connects and disconnects, making Windows run out of ephemeral ports. Approved by author of the test (the author is happy to see it removed)
* | Merge 10.2 into 10.3Marko Mäkelä2021-08-312-17/+11
|\ \ | |/
| * mtr: fix the check where a combination is pre-selectedSergei Golubchik2021-08-292-17/+11
| | | | | | | | | | | | | | | | | | if all options from a combination from the combinations file are already present in the server's list of options, then don't try to run tests in other combinations from this file. old behavior was: if at least one option from a combination is already present in the list...
* | MDEV 22785 Crash with prepared statements and NEXTVAL()Michael Widenius2021-08-262-0/+22
| | | | | | | | | | | | | | | | The problem was that a PREARE followed by a non prepared statement using DEFAULT NEXT_VALUE() could change table->next_local to point to a not persitent memory aria. The next EXECUTE would then try to use the wrong pointer, which could cause a crash. Fixed by reseting the pointer to it's old value when doing EXECUTE.
* | Fixed failing maria.repair testMichael Widenius2021-08-262-7/+2
| | | | | | | | | | | | | | Backported patch from MariaDB 10.6 The issue was that the using session_mem_used to break a test does not guarantee where the test breaks, which gives different results depending on the environment or how MariaDB is compield.
* | Merge 10.2 into 10.3Marko Mäkelä2021-08-231-0/+2
|\ \ | |/
| * Disable 2 commonly failing innodb_gis testsMarko Mäkelä2021-08-231-0/+2
| |
* | MDEV-26458 Crash on ALTER TABLE after DISCARD TABLESPACEMarko Mäkelä2021-08-232-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | ha_innobase::check_if_supported_inplace_alter(): Do not invoke innobase_table_is_empty() if the tablespace has been discarded. That is, native ALTER TABLE in InnoDB will treat an empty table in the same way as a tablespace whose tablespace has been discarded. (Note: ALTER TABLE...ALGORITHM=COPY will fail if the tablespace has been discarded.) This fixes a crash that was introduced in commit c755974775a7a7f4fc24abeacd2fc9ea7bf0c247 (MDEV-19611).
* | Merge 10.2 into 10.3Marko Mäkelä2021-08-181-0/+1
|\ \ | |/
| * MDEV-20931 fixup: innodb.import_corrupted test case cleanupMarko Mäkelä2021-08-181-0/+1
| |
* | MDEV-21555 Assertion secondary index is out of sync on delete from versioned ↵Aleksey Midenkov2021-08-182-0/+31
| | | | | | | | | | | | | | | | | | table Delete-marked record is on the secondary index and the clustered index already purged the corresponding record. We cannot detect if such record is historical and we should not: the algorithm of row_ins_check_foreign_constraint() skips such record anyway.
* | Merge 10.2 into 10.3Marko Mäkelä2021-08-1811-29/+350
|\ \ | |/ | | | | MDEV-18734 FIXME: vcol.partition triggers ASAN heap-use-after-free
| * MDEV-26131 fixup: ./mtr --embedded encryption.innodb_importMarko Mäkelä2021-08-181-0/+1
| |
| * MDEV-20931 ALTER...IMPORT can crash the serverEugene Kosov2021-08-172-0/+98
| | | | | | | | | | Main idea: don't log-and-crash but propogate error to the upper layers of stack to handle it and show to a user.
| * MDEV-26131 SEGV in ha_innobase::discard_or_import_tablespaceThirunarayanan Balathandayuthapani2021-08-165-29/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Import operation without .cfg file fails when there is mismatch of index between metadata table and .ibd file. Moreover, MDEV-19022 shows that InnoDB can end up with index tree where non-leaf page has only one child page. So it is unsafe to find the secondary index root page. This patch does the following when importing the table without .cfg file: 1) If the metadata contains more than one index then InnoDB stops the import operation and report the user to drop all secondary indexes before doing import operation. 2) When the metadata contain only clustered index then InnoDB finds the index id by reading page 0 & page 3 instead of traversing the whole tablespace.
| * MDEV-18734 ASAN heap-use-after-free upon sorting by blob column from ↵Aleksey Midenkov2021-08-054-0/+182
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | partitioned table ha_partition stores records in array of m_ordered_rec_buffer and uses it for prio queue in ordered index scan. When the records are restored from the array the blob buffers may be already freed or rewritten. The solution is to take temporary ownership of cached blob buffers via String::swap(). When the record is restored from m_ordered_rec_buffer the ownership is returned to table fields. Cleanups: init_record_priority_queue(): removed needless !m_ordered_rec_buffer check as there is same assertion few lines before. dbug_print_row() for arbitrary row pointer
* | MDEV-26206 gap lock is not set if implicit lock existsVlad Lesin2021-08-173-1/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If lock type is LOCK_GAP or LOCK_ORDINARY, and the transaction holds implicit lock for the record, then explicit gap-lock will not be set for the record, as lock_rec_convert_impl_to_expl() returns true and lock_rec_convert_impl_to_expl() bypasses lock_rec_lock() call. The fix converts explicit lock to implicit one if requested lock type is not LOCK_REC_NOT_GAP. innodb_information_schema test result is also changed as after the fix the following statements execution: SET autocommit=0; INSERT INTO t1 VALUES (5,10); SELECT * FROM t1 FOR UPDATE; leads to additional gap lock requests.
* | Merge branch '10.2' into 10.3mariadb-10.3.31Oleksandr Byelkin2021-08-027-3/+73
|\ \ | |/
| * MDEV-26220 Server crashes with indexed by prefix virtual columnmariadb-10.2.40Nikita Malyavin2021-08-023-0/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Server crashes in Field::register_field_in_read_map upon select from partitioned table with indexed by prefix virtual column. After several read-mark fixes a problem has surfaced: Since KEY (c(10),a) uses only a prefix of c, a new field is created, duplicated from table->field[3], with a new length. However, vcol_inco->expr is not copied. Therefore, (*key_info)->key_part[i].field->vcol_info->expr was left NULL in ha_partition::index_init(). Solution: copy vcol_info from table field when it's set up.
| * Revert "MDEV-26220 Server crashes with indexed by prefix virtual column"Oleksandr Byelkin2021-08-023-34/+0
| | | | | | | | This reverts commit 9b8e207ce03b2ab7a766348738055be9520561bd.
| * MDEV-23752 SHOW EXPLAIN FOR thd waits for sleepSergei Golubchik2021-07-312-19/+25
| | | | | | | | | | | | | | | | | | | | | | | | fix main.processlist_notembedded test * before EXPLAINing `select sleep` wait for select to start (fixes "Target is not running an EXPLAINable command") * after killing sleep, wait for it to die (fixes test failures on --repeat when old sleep shows on a test rerun) * unify with 10.3, copy minor changes from there (`--echo End of 5.5` vs `--echo # End of 5.5`, etc)
| * MDEV-20154 Assertion `len <= col->len | ...` failed in row_merge_buf_addNikita Malyavin2021-07-292-0/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | len was containing garbage, since vctempl->mysql_col_offset was containing old value while calling row_mysql_store_col_in_innobase_format from innobase_get_computed_value(). It was not updated after the first ALTER TABLE call, because it's INPLACE logic considered there's nothing to update, and exited immediately from ha_innobase::inplace_alter_table(). However, vcol metadata needs an update, since vcols structure is changed in mysql record. The regression was introduced by 12614af1fe. There, refcount==1 condition was removed, which turned out to be crucial, though racy. The idea was to update vc_templ after each (sequencing) ALTER TABLE. We should do the same another way, and there may be a plenty of solutions, but the simplest one is to add a following condition: if vcol structure is changed, drop vc_templ; it will be recreated on next ha_innobase::open() call. in prepare_inplace_alter_table. It is safe, since innodb inplace changes require at least HA_ALTER_INPLACE_SHARED_LOCK_AFTER_PREPARE, which guarantee MDL_EXCLUSIVE on this stage. alter_templ_needs_rebuild() also has to track the columns not indexed, to keep vc_templ correct. Note that vc_templ is always kept constructed and available after ha_innobase::open() call, even on INSERT, though no virtual columns are evaluated during that statement inside innodb. In the test case suplied, it will be recreated on the second ALTER TABLE.
| * MDEV-26220 Server crashes with indexed by prefix virtual columnNikita Malyavin2021-07-283-0/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Server crashes in Field::register_field_in_read_map upon select from partitioned table with indexed by prefix virtual column. After several read-mark fixes a problem has surfaced: Since KEY (c(10),a) uses only a prefix of c, a new field is created, duplicated from table->field[3], with a new length. However, vcol_inco->expr is not copied. Therefore, (*key_info)->key_part[i].field->vcol_info->expr was left NULL in ha_partition::index_init(). Solution: initialize vcols before key initialization Also key initialization is moved to a function.
* | fix MDEV-16026 MDEV-16481 embedded server results and restsOleksandr Byelkin2021-07-295-40/+62
| |
* | MDEV-24511 null field is created with CREATE..SELECTSergei Golubchik2021-07-292-1/+55
| | | | | | | | | | When creating fields for UNION results, Field_null is not allowed. Should create binary(0) instead.
* | MDEV-16026 MDEV-16481 refactor Sys_var_vers_asofNikita Malyavin2021-07-273-37/+183
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MDEV-16026: Forbid global system_versioning_asof in non-default time zone * store `system_versioning_asof` in unix time; * both session and global vars are processed in session timezone; * setting `default` does not copy global variable anymore. Instead, it sets system_time to SYSTEM_TIME_UNSPECIFIED, which means that no 'AS OF' time is applied and `now()` can be assumed As a regression, we cannot assign values below 1970 (UTC) anymore MDEV-16481: set global system_versioning_asof=sf() crashes in specific case * sys_vars.h: add `MYSQL_TIME` field to `set_var::save_result` * sys_vars.ic: get rid of calling `var->value->get_date()` from `Sys_var_vers_asof::update()` * versioning.sysvars: add test; remove double warning refactor Sys_var_vers_asof * inherit from sys_var rather than Sys_var_enum * remove junk "DEFAULT" keyword. There is DEFAULT in SQL grammar for it. * make all conversions in check() to avoid possible errors * avoid double var->value evaluation, which could consequence in undefined behavior
* | Merge 10.2 into 10.3Marko Mäkelä2021-07-2712-18/+147
|\ \ | |/
| * MDEV-26062 : InnoDB: WSREP: referenced FK check fail: Lock wait index ↵Jan Lindström2021-07-262-0/+92
| | | | | | | | | | | | | | | | | | `PRIMARY` table `schema`.`child_table` Problem was that not all normal error codes where not handled after wsrep_row_upd_check_foreign_constraints() call. Furhermore, debug assertion did not contain all normal error cases. Changed ib:: calls to WSREP_ calls to use wsrep instrumentation.
| * MDEV-25998 InnoDB removes the tablespace from default encrypt list earlyThirunarayanan Balathandayuthapani2021-07-261-18/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: ========= As a part of MDEV-14398 patch, InnoDB added and removed the tablespace from default encrypt list. But InnoDB removes the tablespace from the default encrypt list too early due to i) other encryption thread working on the tablespace ii) When tablespace is being flushed at the end of key rotation InnoDB fails to decrypt/encrypt the tablespace since the tablespace removed too early and it leads to test case failure. Solution: ========= Avoid the removal of tablespace from default_encrypt_list only when 1) Another active encryption thread working on tablespace 2) Eligible for tablespace key rotation 3) Tablespace is in flushing phase Removed the workaround in encryption.innodb_encryption_filekeys test case.
| * Some tests can take very long time when run with valgrindElena Stepanova2021-07-245-0/+13
| | | | | | | | | | | | | | | | | | | | Set tests to non-valgrind: oqgraph.social encryption.innodb-page_encryption binlog_encryption.encrypted_master innodb.innodb-page_compression_lz4 main.lock_multi_bug38499 main.lock_multi_bug38691
| * MDEV-26228 ASAN heap-use-after-free with ON UPDATE CASCADEMarko Mäkelä2021-07-232-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In commit 83d2e0841ee30727c609f23957cc592399a3aca4 (MDEV-24041) we failed to notice that in addition to the bug with DELETE and ON DELETE CASCADE, there is another bug with UPDATE and ON UPDATE CASCADE. row_ins_foreign_fill_virtual(): Use the correct memory heap for everything that will be reachable from the cascade->update that we return to the caller. Note: It is correct to use the shorter-lived cascade->heap for rec_get_offsets(), because that memory will be abandoned when row_ins_foreign_fill_virtual() returns.
| * MDEV-26080 fixup: fixed .result file for galera_roles test (one word must be ↵Julius Goryavsky2021-07-231-2/+2
| | | | | | | | enclosed in single quotes).
| * MDEV-26202 Unexpected failure with query using indirectly a recursive CTE twiceIgor Babaev2021-07-222-0/+36
| | | | | | | | | | This bug was fixed by the patch for bug MDEV-26025. Only a new test case is added here.
* | dissapear -> disappearSergei Golubchik2021-07-264-4/+4
| |
* | MDEV-25808 PREPARE/EXECUTE makes signed integer out of unsignedSergei Golubchik2021-07-242-0/+26
| | | | | | | | Closes #1844
* | MDEV-25484 Crash when parsing query using derived table containing TVCIgor Babaev2021-07-232-0/+60
| | | | | | | | | | | | | | | | | | | | | | This patch fixes parsing problems concerning derived tables that use table value constructors (TVC) with LIMIT and ORDER BY clauses of the form ((VALUES ... LIMIT ...) ORDER BY ...) as dt The fix has to be applied only to 10.3 as 10.4 that employs a different grammar rules has no such problems. The test cases should be merged upstream. Approved by Oleksandr Byelkin <sanja@mariadb.com>
* | MDEV-25560 Creating table with certain generated column crashes serverbb-10.3-MDEV-25560Nikita Malyavin2021-07-222-0/+34
| | | | | | | | | | Fix RPAD() handling without 3rd argument of padding, in which case default padding is used.
* | Merge 10.2 into 10.3Marko Mäkelä2021-07-226-21/+136
|\ \ | |/