summaryrefslogtreecommitdiff
path: root/mysql-test/suite
Commit message (Collapse)AuthorAgeFilesLines
* MDEV-17320 add Feature_application_time_periods status variableNikita Malyavin2019-04-022-0/+5
| | | | Closes #1225
* MDEV-18921 Server crashes in bitmap_bits_set or bitmap_is_set upon UPDATE ↵Nikita Malyavin2019-04-022-0/+12
| | | | | | | IGNORE .. FOR PORTION with binary logging The fix is same as for MDEV-18859: initialize table->rpl_write_set in FOR PORTION OF case.
* MDEV-18859 Server crashes in bitmap_bits_set / pack_row / ↵Nikita Malyavin2019-04-021-0/+1
| | | | | | | | | THD::binlog_write_row upon DELETE .. FOR PORTION with binary logging rpl_write_set is initialized in TABLE::mark_columns_per_binlog_row_image. Since we just call use_all_columns for PORTION OF case, no need in column marking logic here. Instead, initialize table->rpl_write_set in place.
* MDEV-18852 MDEV-18853 fix `period.delete`, `period.update` tests crashes ↵Nikita Malyavin2019-04-022-2/+2
| | | | | | | | | | | | | | | | | | | | | | with ``--ps-protocol` The main problem was lack of proper QueryArena handling in `period_setup_conds`. Since mysql_prepare_update/mysql_prepare_delete are called during `PREPARE` statement, period conditions, should be allocated on statement query arena. Another problem is incorrect statement state handling in period_setup_conds, which led to unexpected mysql_update termination. * mysql_update: move period_setup_conds() to mysql_prepare_update to store conditions in statement's mem_root * mtr: add period suite to default list, since --ps-protocol is now fixed Fixes bugs: MDEV-18853 Assertion `0' failed in Protocol::end_statement upon DELETE .. FOR PORTION via prepared statement MDEV-18852 Server crashes in reinit_stmt_before_use upon UPDATE .. FOR PORTION via prepared statement
* update test resultsSergei Golubchik2019-04-021-5/+5
|
* Merge 10.3 into 10.4Marko Mäkelä2019-04-0243-440/+889
|\
| * Merge 10.2 into 10.3Marko Mäkelä2019-04-021-1/+1
| |\
| | * Merge 10.1 into 10.2Marko Mäkelä2019-04-021-1/+1
| | |\
| * | \ Merge branch '10.2' into 10.3Sergei Golubchik2019-03-296-0/+181
| |\ \ \ | | |/ /
| | * | Merge branch '10.1' into 10.2Sergei Golubchik2019-03-294-0/+100
| | |\ \ | | | |/
| | | * Revert MDEV-18464 and MDEV-12009Marko Mäkelä2019-03-283-65/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 21b2fada7ab7f35c898c02d2f918461409cc9c8e and commit 81d71ee6b21870772c336bff15b71904914f146a. The MDEV-18464 change introduces a few data race issues. Contrary to the documentation, the field trx_t::victim is not always being protected by lock_sys_t::mutex and trx_t::mutex. Most importantly, it seems that KILL QUERY could wrongly avoid acquiring both mutexes when invoking lock_trx_handle_wait_low(), in case another thread had already set trx->victim=true. We also revert MDEV-12009, because it should depend on the MDEV-18464 fix being present.
| | | * MDEV-12009: Allow to force kill user threads/query which are flagged as high ↵Jan Lindström2019-03-283-3/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | priority by Galera As noted on kill_one_thread SUPER should be able to kill even system threads i.e. threads/query flagged as high priority or wsrep applier thread. Normal user, should not able to kill threads/query flagged as high priority (BF) or wsrep applier thread.
| | | * MDEV-18466 Unsafe to log updates on tables referenced by foreign keys with ↵Sergei Golubchik2019-03-272-0/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | triggers in statement format ignore FK-prelocked tables when looking for write-prelocked tables with auto-increment to complain about "Statement is unsafe because it invokes a trigger or a stored function that inserts into an AUTO_INCREMENT column"
| | | * Merge branch '5.5' into 10.1Sergei Golubchik2019-03-272-0/+57
| | | |\
| | | | * MDEV-14784: Slave crashes in show_status_array upon running a trigger withSujatha Sivakumar2019-03-272-0/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | select from I_S Problem: ======== When applier thread tries to access 'variable_name' of INFORMATION_SCHEMA.SESSION_VARIABLES table through triggers, it results in an abnormal exit of slave server. Analysis: ======== At the time of replication of stored routines and triggers, their associated security context will be sent by the master. The applier thread on the slave server will use this information to set the required security context for the execution of stored routines and triggers. This is achieved as follows. ->The stored routine object has a member named 'm_security_ctx' which holds the security context received from master. ->The applier thread's security_ctx is stored into a 'backup' object. ->Set the applier thread's security_ctx to 'm_security_ctx'. ->Upon the completion of stored routine execution restore the original security context of applier thread from the backup. During the above process the 'm_security_ctx' object is not initialized properly. Hence the 'external_user' of 'm_security_ctx' has invalid value for this variable and accessing this variable results in abnormal exit of server. Fix: === Invoke the Security_context::init() call from the constructor of stored routine so that 'm_security_ctx' gets initialized properly.
| | * | | MDEV-13895: GTID and Master_Delay causes excessive initial delaySujatha Sivakumar2019-03-282-0/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: ======== When attempting to delay a Slave attached with GTID, there appears to be an extra delay applied initially. For example, this output reflects a Slave that is already delayed by 43200 seconds. When switching to GTID replication, replication is paused until SQL_Remaining_Delay counts down to 0: CHANGE MASTER TO master_use_gtid=current_pos; CHANGE MASTER TO MASTER_DELAY=43200; Seconds_Behind_Master: 44847 Using_Gtid: Current_Pos SQL_Delay: 43200 SQL_Remaining_Delay: 43089 Slave_SQL_Running_State: Waiting until MASTER_DELAY seconds after master executed event Analysis: ========= When slave initiates a GTID based connection request to master, the master sends two GTID_LIST events. The first one is actual GTID_LIST event and the second one is a fake GTID_LIST event. This is sent by master to provide its current binlary log file position. The fake GTID_LIST events will have their ev->when=0. 'when' (the timestamp) is set to 0 so that slave could distinguish between real and fake Rotate events. On slave side when MASTER_DELAY is configured to "X" the applier will ensure that there is a time delay of "X" seconds before the event is applied. General behaviour of MASTER_DELAY example:- Master timestamp of event e1=10 timestamp of event e2=11 On slave MASTER_DELAY=5 Event e1 will be applied at = 15 e2 will be applied at =16 In bug scenario:- On Master: With GTIDs timestamp of event e1=10 timestamp of event e2=0 On Slave: e1 will be applied at = 10 + 5 =15 For e2, since "e2->when=0" e2->when is set to current timestamp. i.e since the e2->when and current timestamp on slave is the same applier waits for additional master_delay=5 seconds. the ev->when contributes to "rli->last_master_timestamp". rli->last_master_timestamp= ev->when + (time_t) ev->exec_time; Fake events should not update the "ev->when" to "current timestamp" on slave. Fix: === Remove the assignment of current timestamp to "ev->when" when "ev->when=0".
| * | | | cleanup: move rbr-only test to rpl_row.testSergei Golubchik2019-03-294-30/+32
| | | | |
| * | | | MDEV-16252: MINIMAL binlog_row_image does not work for versioned tablesNikita Malyavin2019-03-292-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * mark columns for binlog before inserting history row Closes #822
| * | | | MDEV-15951 system versioning by trx id doesn't work with partitioningSergei Golubchik2019-03-293-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Clarify the error message, use the wording from the manual. Closes #870
| * | | | MDEV-15951 system versioning by trx id doesn't work with partitioningNikita Malyavin2019-03-295-17/+208
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix partitioning for trx_id-versioned tables. `partition by hash`, `range` and others now work. `partition by system_time` is forbidden. Currently we cannot use row_start and row_end in `partition by`, because insertion of versioned field is done by engine's handler, as well as row_start/row_end's value set up, which is a transaction id -- so it's also forbidden. The drawback is that it's now impossible to use `partition by key()` without parameters for such tables, because it references row_start and row_end implicitly. * add handler::vers_can_native() * drop Table_scope_and_contents_source_st::vers_native() * drop partition_element::find_engine_flag as unused * forbid versioning partitioning for trx_id as not supported * adopt vers tests for trx_id partitioning * forbid any row_end referencing in `partition by` clauses,   including implicit `by key()`
| * | | | Versioning tests stability improvementAleksey Midenkov2019-03-295-93/+96
| | | | | | | | | | | | | | | | | | | | Fix SELECT resultset order.
| * | | | MDEV-15412 For any non-existing transaction ID, AS OF provides the current ↵Aleksey Midenkov2019-03-292-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | table contents without a warning Fail with error on non-existing TRX_ID. Closes #832
| * | | | Merge 10.2 into 10.3Marko Mäkelä2019-03-2722-313/+355
| |\ \ \ \ | | |/ / /
| | * | | Merge 10.1 into 10.2Marko Mäkelä2019-03-2721-309/+351
| | |\ \ \ | | | |/ /
| | | * | Merge 10.0 into 10.1Marko Mäkelä2019-03-2712-267/+307
| | | |\ \
| | | | * \ Merge 5.5 into 10.0bb-10.0-mergeMarko Mäkelä2019-03-2612-267/+307
| | | | |\ \ | | | | | |/
| | | | | * Fixed ps-protocol thread_pool_server_audit failureSergey Vojtovich2019-03-261-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | By applying 7bd258c.
| | | | | * Fix tests in 2020Bernhard M. Wiedemann2019-03-262-332/+332
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | unfortunately, the year 2038 problem prevented me from pushing the deadline even further into the future.
| | | | | * Fix for MDEV-17449, typo in error message (#1146)Chris Calender2019-03-245-37/+37
| | | | | |
| | | | | * Fix for MDEV-18276, typo in error message + all other occurrences of referingChris Calender2019-03-231-1/+1
| | | | | |
| | | | | * MDEV-17119 replicate_rewrite_db does not work for single chardatabase namesachin2019-03-223-1/+39
| | | | | | | | | | | | | | | | | | | | | | | | Fixed issue in logic.
* | | | | | MDEV-18623 Assertion after DROP FULLTEXT INDEX and removing NOT NULLMarko Mäkelä2019-04-022-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | instant_alter_column_possible(): Do not support instantaneous removal of NOT NULL if the table needs to be rebuilt for removing the hidden FTS_DOC_ID column. This is not ideal and should ultimately be fixed properly in MDEV-17459.
* | | | | | MDEV-19030: Assertion failed in rec_init_offsets() after DROP COLUMNMarko Mäkelä2019-04-022-0/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This basically is a duplicate of MDEV-18219, proving that the assertion was not relaxed correctly. dict_index_t::in_instant_init: A debug flag that will only be set in btr_cur_instant_init_low() in order to suppress the assertion failure in rec_init_offsets() for that code path only.
* | | | | | Adjust tests after commit b5615eff0d00cfb4c60b9d1bf67094da7c2258a6Marko Mäkelä2019-04-028-0/+8
| | | | | |
* | | | | | MDEV-19117 Don't keep binary log index file locked during show binary logsMonty2019-04-014-0/+1087
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On some systems with 10,000+ binlogs, show binary logs could block log rotation for more than 10 seconds. This patch fixes this by first caching all binary log names and releases all mutexes while calculating the sizes of the binary logs. Other things: - Ensure that reinit_io_cache() sets end_of_file when moving to read_cache. This ensures that external changes of the underlying file is known to the cache. - get_binlog_list() is made more efficent and show_binlogs() is changed to call get_binlog_list() Reviewed by Andrei Elkin
* | | | | | Write information about restart in .resultMichael Widenius2019-04-01190-44/+440
| | | | | | | | | | | | | | | | | | | | | | | | Idea comes from MySQL which does something similar
* | | | | | MDEV-17380 innodb_flush_neighbors=ON should be ignored on SSDMarko Mäkelä2019-04-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For tablespaces that do not reside on spinning storage, it does not make sense to attempt to write nearby pages when writing out dirty pages from the InnoDB buffer pool. It is actually detrimental to performance and to the life span of flash ROM storage. With this change, MariaDB will detect whether an InnoDB file resides on solid-state storage. The detection has been implemented for Linux and Microsoft Windows. For other systems, we will err on the safe side and assume that files reside on SSD. As part of this change, we will reduce the number of fstat() calls when opening data files on POSIX systems and slightly clean up some file I/O code. FIXME: os_is_sparse_file_supported() on POSIX works in a destructive manner. Thus, we can only invoke it when creating files, not when opening them. For diagnostics, we introduce the column ON_SSD to the table INFORMATION_SCHEMA.INNODB_TABLESPACES_SCRUBBING. The table INNODB_SYS_TABLESPACES might seem more appropriate, but its purpose is to reflect the contents of the InnoDB system table SYS_TABLESPACES, which we would like to remove at some point. On Microsoft Windows, querying StorageDeviceSeekPenaltyProperty sometimes returns ERROR_GEN_FAILURE instead of ERROR_INVALID_FUNCTION or ERROR_NOT_SUPPORTED. We will silently ignore also this error, and assume that the file does not reside on SSD. On Linux, the detection will be based on the files /sys/block/*/queue/rotational and /sys/block/*/dev. Especially for USB storage, it is possible that /sys/block/*/queue/rotational will wrongly report 1 instead of 0. fil_node_t::on_ssd: Whether the InnoDB data file resides on solid-state storage. fil_system_t::ssd: Collection of Linux block devices that reside on non-rotational storage. fil_system_t::create(): Detect ssd on Linux based on the contents of /sys/block/*/queue/rotational and /sys/block/*/dev. fil_system_t::is_ssd(dev_t): Determine if a Linux block device is non-rotational. Partitions will be identified with the containing block device by assuming that the least significant 4 bits of the minor number identify a partition, and that the "partition number" of the entire device is 0.
* | | | | | MDEV-18590: galera.versioning_trx_id: Test failure: mysqltest: Result ↵Jan Lindström2019-03-292-3/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | content mismatch Add wsrep sync waits and if expected result is not reached print out current contents.
* | | | | | Make test galera_sr.GCF-1018 deterministic (#1245)Daniele Sciascia2019-03-272-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | Disabled autocommit retry (set wsrep_retry_autocommit to 0) so that BF aborted autocommit statement always results in ER_LOCK_DEADLOCK.
* | | | | | Merge 10.3 into 10.4Marko Mäkelä2019-03-264-4/+120
|\ \ \ \ \ \ | |/ / / / /
| * | | | | MDEV-18869 Assertion `!((field)->vcol_info && (field)->stored_in_db())' ↵Aleksey Midenkov2019-03-262-0/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | failed in innodb_col_no upon altering table with system versioning WITH/WITHOUT SYSTEM VERSIONING is not supported for generated columns at parser level (see definition of field_def rule).
| * | | | | Merge 10.2 into 10.3Marko Mäkelä2019-03-262-4/+25
| |\ \ \ \ \ | | |/ / / /
| | * | | | Merge 10.1 into 10.2Marko Mäkelä2019-03-262-4/+25
| | |\ \ \ \ | | | |/ / /
| | | * | | MDEV-12711 mariabackup --backup is refused for multi-file system tablespaceMarko Mäkelä2019-03-262-4/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before MDEV-12113 (MariaDB Server 10.1.25), on shutdown InnoDB would write the current LSN to the first page of each file of the system tablespace. This is incompatible with MariaDB's InnoDB table encryption, because encryption repurposed the field for an encryption key ID and checksum. buf_page_is_corrupted(): For the InnoDB system tablespace, skip FIL_PAGE_FILE_FLUSH_LSN when checking if a page is all zero, because the first page of each file in the system tablespace can contain nonzero bytes in the field.
* | | | | | Merge 10.3 into 10.4Marko Mäkelä2019-03-254-10/+10
|\ \ \ \ \ \ | |/ / / / /
| * | | | | Merge 10.2 into 10.3Marko Mäkelä2019-03-251-3/+3
| |\ \ \ \ \ | | |/ / / /
| | * | | | MDEV-19022: InnoDB fails to cleanup useless B-tree pagesMarko Mäkelä2019-03-251-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The test case for reproducing MDEV-14126 demonstrates that InnoDB can end up with an index tree where a non-leaf page has only one child page. The test case innodb.innodb_bug14676111 demonstrates that such pages are sometimes unavoidable, because InnoDB does not implement any sort of B-tree rotation. But, there is no reason to allow a root page with only one child page. btr_cur_node_ptr_delete(): Replaces btr_node_ptr_delete(). btr_page_get_father(): Declare globally. btr_discard_only_page_on_level(): Declare with ATTRIBUTE_COLD. It turns out that this function is not covered by the innodb.innodb_bug14676111 test case after all. btr_discard_page(): If the root page ends up having only one child page, shrink the tree by invoking btr_lift_page_up().
| * | | | | Merge 10.2 into 10.3Marko Mäkelä2019-03-253-7/+7
| |\ \ \ \ \ | | |/ / / /
| | * | | | Fix for MDEV-18276, typo in error message + all other occurrences of referingChris Calender2019-03-233-7/+7
| | | | | |
| | * | | | MDEV-18224 MTR's internal check of the test case 'innodb.recovery_shutdown' ↵Marko Mäkelä2019-03-221-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | failed due to extra #sql-ib*.ibd files The test innodb.recovery_shutdown would occasionally fail, because recovered incomplete transactions would be conflicting with DROP TABLE, causing the background drop table queue to be invoked. Add a slow shutdown before dropping the tables, so that the recovered transactions will be rolled back. Starting with MDEV-14705, normal shutdown would abort the rollback of recovered transactions.