summaryrefslogtreecommitdiff
path: root/mysql-test/suite
Commit message (Collapse)AuthorAgeFilesLines
* MDEV-21069 Crash on DROP TABLE if the data file is corruptedMarko Mäkelä2019-11-191-1/+25
| | | | | | | | | | | | | | | | | | | | | buf_read_ibuf_merge_pages(): Discard any page numbers that are outside the current bounds of the tablespace, by invoking the function ibuf_delete_recs() that was introduced in MDEV-20934. This could avoid an infinite change buffer merge loop on innodb_fast_shutdown=0, because normally the change buffer merge would only be attempted if a page was successfully loaded into the buffer pool. dict_drop_index_tree(): Add the parameter trx_t*. To prevent the DROP TABLE crash, do not invoke btr_free_if_exists() if the entire .ibd file will be dropped. Thus, we will avoid a crash if the BTR_SEG_LEAF or BTR_SEG_TOP of the index is corrupted, and we will also avoid unnecessarily accessing the to-be-dropped tablespace via the buffer pool. In MariaDB 10.2, we disable the DROP TABLE fix if innodb_safe_truncate=0, because the backup-unsafe MySQL 5.7 WL#6501 form of TRUNCATE TABLE requires that the individual pages be freed inside the tablespace.
* MDEV-20949 Stop issuing 'row size' error on DMLEugene Kosov2019-11-135-2/+6
| | | | | | | | | | | | | | | | | | | | | Move row size check to early CREATE/ALTER TABLE phase. Stop checking on table open. dict_index_add_to_cache(): remove parameter 'strict', stop checking row size dict_index_t::record_size_info_t: this is a result of row size check operation create_table_info_t::row_size_is_acceptable(): performs row size check. Issues error or warning. Writes first overflow field to InnoDB log. create_table_info_t::create_table(): add row size check dict_index_t::record_size_info(): this is a refactored version of dict_index_t::rec_potentially_too_big(). New version doesn't change global state of a program but return all interesting info. And it's callers who decide how to handle row size overflow. dict_index_t::rec_potentially_too_big(): removed
* Merge 10.1 into 10.2Marko Mäkelä2019-11-122-4/+4
|\
| * MDEV-20953: binlog_encryption.rpl_corruption failed in buildbot due to wrong ↵Sujatha2019-11-122-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | error code Problem: ======== CURRENT_TEST: binlog_encryption.rpl_corruption mysqltest: In included file "./include/wait_for_slave_io_error.inc": ... At line 72: Slave stopped with wrong error code **** Slave stopped with wrong error code: 1743 (expected 1595,1913) **** Analysis: ======== The test emulates the corruption at the various stages of replication for example in binlog file, in network and in relay log etc. It verifies that all corruption cases are handled through appropriate error messages. The test cases which emulate network failure expect following errors. --ER_SLAVE_RELAY_LOG_WRITE_FAILURE (1595) --ER_NETWORK_READ_EVENT_CHECKSUM_FAILURE (1743) Ideally test should expect error codes as 1595 and 1743. But the test actually waits on incorrect error code 1595,1913 Fix: === Added appropriate error code for 'ER_NETWORK_READ_EVENT_CHECKSUM_FAILURE'. Replaced 1913 with 1743.
* | rpl_semi_sync_gtid_reconnect results mergeAndrei Elkin2019-11-111-0/+12
| |
* | manual merge 10.1->10.2Andrei Elkin2019-11-112-0/+103
|\ \ | |/
| * MDEV-19376 Repl_semi_sync_master::commit_trx assertion failure: ... || ↵Andrei Elkin2019-11-102-0/+103
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | !m_active_tranxs->is_tranx_end_pos(trx_wait_binlog_name, trx_wait_binlog_pos) The assert indicates that the current transaction got caught uncleaned from the semisync master's cache when it is signaled to proceed upon its ack receive. The reason of missed cleanup turns out to be a flaw in the gtid connect mode. A submitted by connecting slave value of its last received event's binlog file *name* was adopted into {{Repl_semi_sync_master::m_reply_file_name}} as a part of semisync initialization. Notice that the initialization still refines the position part of the submitted last received event's binlog coordinates. The master side binlog filename:pos refinement is specific to the gtid connect mode for purpose of computing the latest binlog file to resume slave feeding from. Effectively in the gtid connect mode the computed resumption filename:pos may appear smaller in which case a new post-connect time committing transaction may be logged with its filename:pos also less than the submitted coordinates and that triggers the assert. Fixed with making the semisync initialization to use the refined filename:pos. It is guaranteed to be less than any new generated transaction's binlog:pos.
* | Merge 10.1 to 10.2Marko Mäkelä2019-11-064-30/+79
|\ \ | |/
| * MDEV-20987 InnoDB fails to start when fts table has FK relationThirunarayanan Balathandayuthapani2019-11-062-30/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | InnoDB: Assertion failure in file .../dict/dict0dict.cc line ... InnoDB: Failing assertion: table->can_be_evicted This fixes a regression that was caused by the fix of MDEV-20621 (commit a41d429765c7ddb528b9b438c68b25ff55d3bd55). MySQL 5.6 (and MariaDB 10.0) introduced eviction of tables from the InnoDB data dictionary cache. Tables that are connected to FOREIGN KEY constraints or FULLTEXT INDEX are exempt of the eviction. With the problematic change, a table that would already be exempt from eviction due to FOREIGN KEY would cause the problem if there also was a FULLTEXT INDEX defined on it. dict_load_table(): Only prevent eviction if table->can_be_evicted holds.
| * MDEV-17896 Assertion `pfs->get_refcount() > 0' failedRobert Bindar2019-11-012-0/+64
| | | | | | | | | | | | Unfortunate DROP TEMPORARY..IF EXISTS on a regular table may allow subsequent CREATE TABLE statements to steal away the PFS_table_share instance from the dropped table.
* | MDEV-20934 Infinite loop on innodb_fast_shutdown=0 with inconsistent change ↵Marko Mäkelä2019-11-062-1/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | buffer Due to a data corruption bug that may have occurred a long time earlier (possibly involving physical backup and MySQL Bug #69122, which was addressed in commit f166ec71b78fdf7a08ba413509cf00ad9e003b3c) it seems possible that the InnoDB change buffer might end up containing entries, while no buffered changes exist according to the change buffer bitmap pages in the .ibd files. ibuf_delete_recs(): New function, to be invoked on slow shutdown only. Remove all buffered changes for a specific page. ibuf_merge_or_delete_for_page(): If the change buffer bitmap is clean and a slow shutdown is in progress, invoke ibuf_delete_recs(). We do not want to do that during normal operation, due to the additional overhead that is involved. The bitmap page should be consistent with the change buffer in the first place.
* | Merge branch 'github/10.1' into 10.2Sergei Golubchik2019-10-302-0/+32
|\ \ | |/
| * MDEV-20354 All but last insert ignored in InnoDB tables when table lockedSergei Golubchik2019-10-302-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mysql_insert() first opens all affected tables (which implicitly starts a transaction in InnoDB), then stat tables. A failure to open a stat table caused open_tables() to abort the current stmt transaction (trans_rollback_stmt()). So, from the server point of view the following ha_write_row()-s happened outside of a transactions, and the server didn't bother to commit them. The server has a mechanism to prevent a transaction being unexpectedly committed or rolled back in the middle of a statement - if an operation takes place _in a sub-statement_ it cannot change the transaction state. Operations on stat tables are exactly that - they are not allowed to change a transaction state. Put them in a sub-statement to make sure they don't.
* | Merge branch '10.1' into 10.2Oleksandr Byelkin2019-10-304-15/+15
|\ \ | |/
| * XtraDB 5.6.45-86.1Marko Mäkelä2019-10-302-2/+2
| |
| * MDEV-20927 Duplicate key with auto incrementMarko Mäkelä2019-10-303-16/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Apply the changes to InnoDB and XtraDB that had been inadvertently skipped in the merge commit ae476868a5394041a00e75a29c7d45917e8dfae8 That merge failure sabotaged part of MDEV-20127: >Revert a problematic auto_increment_increment 'fix' from 2014. >This involves replacing the MDEV-8827 fix and in 10.1, >removing some WSREP instrumentation. The code changes were re-merged manually by executing the following: # Get the parent of the problematic merge. git checkout ae476868a5394041a00e75a29c7d45917e8dfae8^ # Perform the merge again. git merge ae476868a5394041a00e75a29c7d45917e8dfae8^2 # Get the conflict resolution from that merge. git checkout ae476868a5394041a00e75a29c7d45917e8dfae8 . # Note: Any changes to these files were removed (empty diff)! git diff HEAD storage/{innobase,xtradb}/handler/ha_innodb.cc # Apply the code changes: git diff cf40393471b10ca68cc1d2804c22ab9203900978^2..MERGE_HEAD \ storage/{innobase,xtradb}/handler/ha_innodb.cc| patch -p1
* | Fix test cases that use debug galera library.Jan Lindström2019-10-305-11/+97
| | | | | | | | | | | | | | | | | | Changes to be committed: modified: mysql-test/suite/galera/r/MW-369.result modified: mysql-test/suite/galera/r/MW-402.result modified: mysql-test/suite/galera/r/galera#500.result modified: mysql-test/suite/galera/r/galera_gcs_fragment.result modified: mysql-test/suite/galera/r/mysql-wsrep#332.result
* | MDEV-20799 DROP Virtual Column crashes MariaDBSergei Golubchik2019-10-283-0/+34
| | | | | | | | | | use the correct table for evaluating virtual columns in the InnoDB ALTER TABLE.
* | MDEV-20549 SQL SECURITY DEFINER does not work for INFORMATION_SCHEMA tablesSergei Golubchik2019-10-285-3/+652
| | | | | | | | switch to definer privileges when populating I_S tables
* | Merge 10.1 to 10.2Marko Mäkelä2019-10-252-0/+99
|\ \ | |/
| * MDEV-19073 FTS row mismatch after crash recoveryThirunarayanan Balathandayuthapani2019-10-252-0/+91
| | | | | | | | | | | | | | InnoDB stores synced_doc_id + 1 value in FTS_CONFIG table. But while reading the synced doc id from FTS_CONFIG table after restart, InnoDB should read synced_doc_id - 1 to get the actual synced doc id value.
* | Clean up innodb.innodb_stats_persistentMarko Mäkelä2019-10-242-38/+21
| | | | | | | | | | | | The test was marked big for no apparent reason. Usw wait_all_purged.inc in the canonical way, and make use of the sequence engine.
* | MDEV-20864 Introduce debug option innodb_change_buffer_dumpMarko Mäkelä2019-10-192-1/+13
| | | | | | | | | | | | | | To diagnose a hang in slow shutdown (innodb_fast_shutdown=0), let us introduce a Boolean startup option in debug builds that will cause the contents of the InnoDB change buffer to be dumped to the server error log at startup.
* | MDEV-20850 Merge new release of InnoDB 5.7.28 to 10.2Marko Mäkelä2019-10-171-5/+0
| |
* | Fixed bug in lock tables + alter table with Aria tables.Monty2019-10-162-0/+50
| | | | | | | | | | | | | | | | | | MDEV-18451 Server crashes in maria_create_trn_for_mysql upon ALTER TABLE Problem was that when table was locked many times, not all instances where removed from the transaction by _ma_remove_table_from_trnman()
* | MDEV-10748 Server crashes in ha_maria::implicit_commitMonty2019-10-152-0/+29
| | | | | | | | | | | | | | | | | | | | | | Problem was in a combination of LOCK TABLES on several Aria tables followed by an ALTER TABLE. After the ALTER TABLE there was a force close + reopen of the alter table. The close failed because the table was still part of a transaction. Fixed by calling extra(HA_EXTRA_PREPARE_FOR_FORCED_CLOSE) as part of closing the table, which ensures that the table is not anymore part of the current transaction.
* | Merge 10.1 into 10.2Marko Mäkelä2019-10-1114-258/+270
|\ \ | |/
| * Merge 5.5 into 10.1Marko Mäkelä2019-10-1114-258/+270
| |\
| | * MDEV-19455: Avoid SET DEBUG_DBUG='-d,...' constructMarko Mäkelä2019-10-1113-202/+213
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Apply the correct pattern for debug instrumentation: SET @save_dbug=@@debug_dbug; SET debug_dbug='+d,...'; ... SET debug_dbug=@save_dbug; Numerous tests use statements of the form SET debug_dbug='-d,...'; which will inadvertently enable all DBUG tracing output, causing unnecessary waste of resources.
* | | Fix CMAKE_BUILD_TYPE=DebugMarko Mäkelä2019-10-111-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | Remove unused variables and type mismatch that was introduced in commit b393e2cb0c079b30563dcc87a62002c9c778643c Also, fix a typo in the documentation of the parameter, and update the test.
* | | MDEV-18546 ASAN heap-use-after-free in innobase_get_computed_value / row_purgeNikita Malyavin2019-10-112-0/+109
| | | | | | | | | | | | the bug was already fixed in MDEV-17005, so now only test is added
* | | Fixed feedback_plugin_load to work with staticly loaded pluginMichael Widenius2019-10-101-1/+5
| | |
* | | MDEV-20574 Position of events reported by mysqlbinlog is wrong with ↵Sachin Setiya2019-10-085-0/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | encrypted binlogs, SHOW BINLOG EVENTS reports the correct one. Analysis Mysqlbinlog output for encrypted binary log #Q> insert into tab1 values (3,'row 003') #190912 17:36:35 server id 10221 end_log_pos 980 CRC32 0x53bcb3d3 Table_map: `test`.`tab1` mapped to number 19 # at 940 #190912 17:36:35 server id 10221 end_log_pos 1026 CRC32 0xf2ae5136 Write_rows: table id 19 flags: STMT_END_F Here we can see Table_map_log_event ends at 980 but Next event starts at 940. And the reason for that is we do not send START_ENCRYPTION_EVENT to the slave Solution:- Send Start_encryption_log_event as Ignorable_log_event to slave(mysqlbinlog), So that mysqlbinlog can update its log_pos. Since Slave can request multiple FORMAT_DESCRIPTION_EVENT while master does not have so We only update slave master pos when master actually have the FORMAT_DESCRIPTION_EVENT. Similar logic should be applied for START_ENCRYPTION_EVENT. Also added the test case when new server reads the data from old server which does not send START_ENCRYPTION_EVENT to slave. Master Slave Upgrade Scenario. When Slave is updated first, Slave will have extra logic of handling START_ENCRYPTION_EVENT But master willnot be sending START_ENCRYPTION_EVENT. So there will be no issue. When Master is updated first, It will send START_ENCRYPTION_EVENT to slave , But slave will ignore this event in queue_event.
* | | MDEV-20703: mariabackup creates binlog files in server binlog directory on ↵Vlad Lesin2019-10-011-2/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | --prepare --export step When "--export" mariabackup option is used, mariabackup starts the server in bootstrap mode to generate *.cfg files for the certain innodb tables. The started instance of the server reads options from the file, pointed out in "--defaults-file" mariabackup option. If the server uses the same config file as mariabackup, and binlog is switched on in that config file, then "mariabackup --prepare --export" will create binary log files in the server's binary log directory, what can cause issues. The fix is to add "--skip-log-bin" in mysld options when the server is started to generate *.cfg files.
* | | Merge remote-tracking branch 'origin/10.1' into 10.2Alexander Barkov2019-10-015-0/+214
|\ \ \ | |/ /
| * | MDEV-20645: Replication consistency is broken as workers miss the error ↵Sujatha2019-09-305-0/+228
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | notification from an earlier failed group. Analysis: ======== In general if there are three groups. 1 - Inserts 32 which fails due to local entry '32' on slave. 2 - Inserts 33 3 - Inserts 34 Each group considers itself as a waiter and it waits for prior group 'waitee'. This is done in 'register_wait_for_prior_event_group_commit'. If there is no other parallel group being scheduled then no waitee will be there. Let us assume 3 groups are being scheduled in parallel. 3-> waits for 2-> waits for->1 '1' upon completion it checks is there any registered subsequent waiter. If so it wakes up the subsequent waiter with its execution status. This execution status is stored in wakeup_error. If '1' failed then it sends corresponding wakeup_error to 2. Then '2' aborts and it propagates error to '3'. So all further commits are aborted. This mechanism works only when all transactions reach a stage where they are waiting for their prior commit to complete. In case of optimistic following scenario occurs. 1,2,3 are scheduled in parallel. 3 - Reaches group_commit_code waits for 2 to complete. 1 - errors out sets stop_on_error_sub_id=1. When a group execution results in error its corresponding sub_id is set to 'stop_on_error_sub_id'. Any new groups queued for execution will check if their sub_id is > stop_on_error_sub_id. If it is true their execution will be skipped as prior group execution failed. 'skip_event_group=1' will be set. Since the execution of SQL thread is about to stop we just skip execution of all the following event groups. We still do all the normal waiting and wakeup processing between the event groups as a simple way to ensure that everything is stopped and cleaned up correctly. Upon error '1' transaction checks for registered waiters. Since no one is there it simply goes away. 2 - Starts the execution. It checks do I have a waitee. Since wait_commit_sub_id == entry->last_committed_sub_id no waitee is set. Secondly: 'entry->stop_on_error_sub_id' is set by '1'st execution. Now 'handle_parallel_thread' code checks if the current group 'sub_id' is greater than the 'sub_id' set within 'stop_on_error_sub_id'. Since the above is true 'skip_event_group=true' is set. Simply call 'wait_for_prior_commit' to wakeup all waiters. Group '2' didn't had any waitee and its execution is skipped. Hence its wakeup_error=0.It sends a positive wakeup signal to '3'. Which commits. This results in a missed transaction. i.e 33 is missed and 34 is committed. Fix: === When a worker learns that an earlier transaction execution has failed, and it should not proceed for further execution, it should mark its own execution status as failed so that it alerts its followers to abort as well.
* | | MDEV-20688 Recovery crashes after unnecessarily reading a corrupted pageThirunarayanan Balathandayuthapani2019-09-272-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The test encryption.innodb-redo-badkey was accidentally disabled until commit 23657a21018d0b3d0464bbd55236113ebcd3d4b7 enabled it recently. Once it was enabled, it started failing randomly. recv_recover_corrupt_page(): Do not assume that any redo log exists for the page. A page may be unnecessarily read by read-ahead. When noting the corruption, reset recv_addr->state to RECV_PROCESSED, so that even if the same page is re-read again, we will only decrement recv_sys->n_addrs once.
* | | Remove a useless large test, and add a debug assertionMarko Mäkelä2019-09-272-68/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | The test innodb_fts.fulltext_table_evict was only creating 1000 tables with fulltext indexes, only to check that no tables with fulltext indexes are being evicted. The reason why tables containing fulltext indexes cannot be evicted is that fts_optimize_init() invokes dict_table_prevent_eviction().
* | | MDEV-19514 preparation: Extend innodb.innodb-change-buffer-recoveryMarko Mäkelä2019-09-263-32/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | Test innodb_read_only startup (which will be refused after a crash), and test also innodb_force_recovery=5, and extract some change buffer merge statistics. Omit any statistics about delete (purge) buffering, because purge could happen at any time. Use the sequence storage engine for populating the table.
* | | MDEV-20675 Crash in SHOW ENGINE INNODB STATUS with innodb_force_recovery=5Marko Mäkelä2019-09-261-0/+5
| | | | | | | | | | | | Add a test case. MariaDB Server 10.2 is not affected.
* | | Merge 10.1 into 10.2Marko Mäkelä2019-09-231-1/+1
|\ \ \ | |/ /
| * | MDEV-18094: Query with order by limit picking index scan over filesortVarun Gupta2019-09-211-1/+1
| | | | | | | | | | | | | | | | | | In the function test_if_cheaper_ordering we make a decision if using an index is better than using filesort for ordering. If we chose to do range access then in test_quick_select we should make sure that cost for table scan is set to DBL_MAX so that it is not picked.
* | | MDEV-19679 - CREATE SERVER needs tweaks for compatibility with CONNECT engineAnel Husakovic2019-09-204-11/+11
| | |
* | | MDEV-16222: Move the test to gcol.innodb_virtual_debug_purgeMarko Mäkelä2019-09-206-98/+89
| | |
* | | MDEV-18438 Don't stream xtrabackup_info of extra-lsndirSimon Lipp2019-09-194-0/+21
| | |
* | | Enable galera.MW-286 test case.Stepan Patryshev2019-09-181-2/+1
| | |
* | | Merge 10.1 into 10.2Marko Mäkelä2019-09-185-7/+70
|\ \ \ | |/ /
| * | MDEV-19529 InnoDB hang on DROP FULLTEXT INDEXThirunarayanan Balathandayuthapani2019-09-182-0/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: ======= During dropping of fts index, InnoDB waits for fts_optimize_remove_table() and it holds dict_sys->mutex and dict_operaiton_lock even though the table id is not present in the queue. But fts_optimize_thread does wait for dict_sys->mutex to process the unrelated table id from the slot. Solution: ======== Whenever table is added to fts_optimize_wq, update the fts_status of in-memory fts subsystem to TABLE_IN_QUEUE. Whenever drop index wants to remove table from the queue, it can check the fts_status to decide whether it should send the MSG_DELETE_TABLE to the queue. Removed the following functions because these are all deadcode. dict_table_wait_for_bg_threads_to_exit(), fts_wait_for_background_thread_to_start(),fts_start_shutdown(), fts_shudown().
| * | MDEV-19647 Server hangs after dropping full text indexes and restartThirunarayanan Balathandayuthapani2019-09-172-6/+15
| | | | | | | | | | | | | | | - There is no need to add the table in fts_optimize_wq if there is no fts indexes associated with it.
* | | MDEV-20485: Disable galera.galera_var_node_addressMarko Mäkelä2019-09-181-1/+2
| | |