summaryrefslogtreecommitdiff
path: root/mysql-test/suite/binlog_encryption
Commit message (Collapse)AuthorAgeFilesLines
* UUID() function should return UUID, not VARCHAR(36)Sergei Golubchik2021-10-291-27/+27
|
* Merge branch '10.5' into 10.6Oleksandr Byelkin2021-08-021-0/+3
|\
| * Merge branch '10.4' into 10.5Oleksandr Byelkin2021-07-311-0/+3
| |\
| | * Merge branch '10.3' into 10.4Oleksandr Byelkin2021-07-311-0/+3
| | |\
| | | * Merge 10.2 into 10.3Marko Mäkelä2021-07-271-0/+3
| | | |\
| | | | * Some tests can take very long time when run with valgrindElena Stepanova2021-07-241-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | | Merge 10.5 into 10.6Marko Mäkelä2021-06-091-1/+1
|\ \ \ \ \ | |/ / / /
| * | | | Merge 10.4 into 10.5Marko Mäkelä2021-06-081-1/+1
| |\ \ \ \ | | |/ / /
| | * | | Fix mtr tests with file_key_managment extension for WindowsAnel Husakovic2021-06-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit b5615eff0d00 introduced comment in result file during shutdown. In case of Windows for the tests involving `file_key_managment.so` as plugin-load-add the tests will be overwritten with .dll extension. The same happens with environment variable `$FILE_KEY_MANAGMENT_SO`. So the patch is removing the extension to be extension agnostic. Reviewed by: wlad@mariadb.com
* | | | | MDEV-22189: Change error messages inside code to have mariadb instead ofRucha Deodhar2021-05-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mysql Fix: Changed error messages, rerecorded results and changed other relevant files.
* | | | | MDEV-23842 Atomic RENAME TABLEMonty2021-05-191-25/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Major rewrite of ddl_log.cc and ddl_log.h - ddl_log.cc described in the beginning how the recovery works. - ddl_log.log has unique signature and is dynamic. It's easy to add more information to the header and other ddl blocks while still being able to execute old ddl entries. - IO_SIZE for ddl blocks is now dynamic. Can be changed without affecting recovery of old logs. - Code is more modular and is now usable outside of partition handling. - Renamed log file to dll_recovery.log and added option --log-ddl-recovery to allow one to specify the path & filename. - Added ddl_log_entry_phase[], number of phases for each DDL action, which allowed me to greatly simply set_global_from_ddl_log_entry() - Changed how strings are stored in log entries, which allows us to store much more information in a log entry. - ddl log is now always created at start and deleted on normal shutdown. This simplices things notable. - Added probes debug_crash_here() and debug_simulate_error() to simply crash testing and allow crash after a given number of times a probe is executed. See comments in debug_sync.cc and rename_table.test for how this can be used. - Reverting failed table and view renames is done trough the ddl log. This ensures that the ddl log is tested also outside of recovery. - Added helper function 'handler::needs_lower_case_filenames()' - Extend binary log with Q_XID events. ddl log handling is using this to check if a ddl log entry was logged to the binary log (if yes, it will be deleted from the log during ddl_log_close_binlogged_events() - If a DDL entry fails 3 time, disable it. This is to ensure that if we have a crash in ddl recovery code the server will not get stuck in a forever crash-restart-crash loop. mysqltest.cc changes: - --die will now replace $variables with their values - $error will contain the error of the last failed statement storage engine changes: - maria_rename() was changed to be more robust against crashes during rename.
* | | | | Merge 10.5 into 10.6Marko Mäkelä2021-04-212-8/+8
|\ \ \ \ \ | |/ / / /
* | | | | MDEV-16437: merge 5.7 P_S replication instrumentation and tablesSujatha2021-04-161-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Merge 'replication_applier_status_by_coordinator' table. This table captures SQL_THREAD status in case of both single threaded and multi threaded slave configuration. When multi_source replication is enabled this table will display each source specific SQL_THREAD status. Added new columns for: - LAST_SEEN_TRANSACTION - LAST_TRANS_RETRY_COUNT
* | | | | Merge 10.5 into 10.6Marko Mäkelä2021-03-112-20/+7
|\ \ \ \ \ | |/ / / /
| * | | | Merge 10.4 into 10.5Marko Mäkelä2021-03-112-20/+7
| |\ \ \ \ | | |/ / /
| | * | | MDEV-24668 debug assert on SET PASSWORD when binlog failsSergei Golubchik2021-03-081-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | don't use `result` both for an error status and to remember if the mutex was locked
| | * | | cleanup: renames, no need to create a new .inc fileSergei Golubchik2021-03-082-20/+1
| | | | | | | | | | | | | | | | | | | | if it's the whole content of a test anyway.
* | | | | Merge 10.5 into 10.6Marko Mäkelä2021-02-243-20/+1
|\ \ \ \ \ | |/ / / /
| * | | | Merge branch '10.4' into 10.5Sergei Golubchik2021-02-233-20/+1
| |\ \ \ \ | | |/ / /
| | * | | Merge branch '10.3' into 10.4Sergei Golubchik2021-02-233-20/+1
| | |\ \ \ | | | |/ /
| | | * | Merge branch '10.2' into 10.3Sergei Golubchik2021-02-223-20/+1
| | | |\ \ | | | | |/
| | | | * fix binlog_xa_recover testSergei Golubchik2021-02-221-18/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. wait for the binlog thread to reach the certain state, don't use a debug_sync that's incorrectly placed to detect the state 2. no need to do a (non-deterministic) `show binlog events` to verify what is guaranteed by the directly preceding line
| | | | * cleanup: renames, no need to create a new .inc fileSergei Golubchik2021-02-222-2/+1
| | | | | | | | | | | | | | | | | | | | if it's the whole content of a test anyway.
* | | | | Merge 10.5 into 10.6Marko Mäkelä2021-02-171-1/+1
|\ \ \ \ \ | |/ / / /
| * | | | Merge branch 'bb-10.4-release' into bb-10.5-releaseSergei Golubchik2021-02-151-1/+1
| |\ \ \ \ | | |/ / /
| | * | | Merge branch 'bb-10.3-release' into bb-10.4-releaseSergei Golubchik2021-02-121-1/+1
| | |\ \ \ | | | |/ / | | | | | | | | | | | | | | | Note, the fix for "MDEV-23328 Server hang due to Galera lock conflict resolution" was null-merged. 10.4 version of the fix is coming up separately
| | | * | Merge branch '10.2' into 10.3Sergei Golubchik2021-02-011-1/+1
| | | |\ \ | | | | |/
| | | | * MDEV-12908 binlog_encryption.binlog_xa_recover, binlog.binlog_xa_recover ↵Alice Sherepa2021-01-141-1/+1
| | | | | | | | | | | | | | | | | | | | failed in bb with extra checkpoint
* | | | | MDEV-515 Reduce InnoDB undo logging for insert into empty tableMarko Mäkelä2021-01-254-0/+23
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We implement an idea that was suggested by Michael 'Monty' Widenius in October 2017: When InnoDB is inserting into an empty table or partition, we can write a single undo log record TRX_UNDO_EMPTY, which will cause ROLLBACK to clear the table. For this to work, the insert into an empty table or partition must be covered by an exclusive table lock that will be held until the transaction has been committed or rolled back, or the INSERT operation has been rolled back (and the table is empty again), in lock_table_x_unlock(). Clustered index records that are covered by the TRX_UNDO_EMPTY record will carry DB_TRX_ID=0 and DB_ROLL_PTR=1<<55, and thus they cannot be distinguished from what MDEV-12288 leaves behind after purging the history of row-logged operations. Concurrent non-locking reads must be adjusted: If the read view was created before the INSERT into an empty table, then we must continue to imagine that the table is empty, and not try to read any records. If the read view was created after the INSERT was committed, then all records must be visible normally. To implement this, we introduce the field dict_table_t::bulk_trx_id. This special handling only applies to the very first INSERT statement of a transaction for the empty table or partition. If a subsequent statement in the transaction is modifying the initially empty table again, we must enable row-level undo logging, so that we will be able to roll back to the start of the statement in case of an error (such as duplicate key). INSERT IGNORE will continue to use row-level logging and locking, because implementing it would require the ability to roll back the latest row. Since the undo log that we write only allows us to roll back the entire statement, we cannot support INSERT IGNORE. We will introduce a handler::extra() parameter HA_EXTRA_IGNORE_INSERT to indicate to storage engines that INSERT IGNORE is being executed. In many test cases, we add an extra record to the table, so that during the 'interesting' part of the test, row-level locking and logging will be used. Replicas will continue to use row-level logging and locking until MDEV-24622 has been addressed. Likewise, this optimization will be disabled in Galera cluster until MDEV-24623 enables it. dict_table_t::bulk_trx_id: The latest active or committed transaction that initiated an insert into an empty table or partition. Protected by exclusive table lock and a clustered index leaf page latch. ins_node_t::bulk_insert: Whether bulk insert was initiated. trx_t::mod_tables: Use C++11 style accessors (emplace instead of insert). Unlike earlier, this collection will cover also temporary tables. trx_mod_table_time_t: Add start_bulk_insert(), end_bulk_insert(), is_bulk_insert(), was_bulk_insert(). trx_undo_report_row_operation(): Before accessing any undo log pages, invoke trx->mod_tables.emplace() in order to determine whether undo logging was disabled, or whether this is the first INSERT and we are supposed to write a TRX_UNDO_EMPTY record. row_ins_clust_index_entry_low(): If we are inserting into an empty clustered index leaf page, set the ins_node_t::bulk_insert flag for the subsequent trx_undo_report_row_operation() call. lock_rec_insert_check_and_lock(), lock_prdt_insert_check_and_lock(): Remove the redundant parameter 'flags' that can be checked in the caller. btr_cur_ins_lock_and_undo(): Simplify the logic. Correctly write DB_TRX_ID,DB_ROLL_PTR after invoking trx_undo_report_row_operation(). trx_mark_sql_stat_end(), ha_innobase::extra(HA_EXTRA_IGNORE_INSERT), ha_innobase::external_lock(): Invoke trx_t::end_bulk_insert() so that the next statement will not be covered by table-level undo logging. ReadView::changes_visible(trx_id_t) const: New accessor for the case where the trx_id_t is not read from a potentially corrupted index page but directly from the memory. In this case, we can skip a sanity check. row_sel(), row_sel_try_search_shortcut(), row_search_mvcc(): row_sel_try_search_shortcut_for_mysql(), row_merge_read_clustered_index(): Check dict_table_t::bulk_trx_id. row_sel_clust_sees(): Replaces lock_clust_rec_cons_read_sees(). lock_sec_rec_cons_read_sees(): Replaced with lower-level code. btr_root_page_init(): Refactored from btr_create(). dict_index_t::clear(), dict_table_t::clear(): Empty an index or table, for the ROLLBACK of an INSERT operation. ROW_T_EMPTY, ROW_OP_EMPTY: Note a concurrent ROLLBACK of an INSERT into an empty table. This is joint work with Thirunarayanan Balathandayuthapani, who created a working prototype. Thanks to Matthias Leich for extensive testing.
* | | | Merge commit '10.4' into 10.5Oleksandr Byelkin2021-01-061-15/+4
|\ \ \ \ | |/ / /
| * | | Merge branch '10.3' into 10.4bb-10.4-MDEV-23468Oleksandr Byelkin2020-12-251-15/+4
| |\ \ \ | | |/ /
| | * | Merge branch '10.2' into 10.3Oleksandr Byelkin2020-12-231-15/+4
| | |\ \ | | | |/
| | | * MDEV-22008 rpl.rpl_semi_sync fails in bb, MDEV-24418 reenable ↵Alice Sherepa2020-12-181-18/+4
| | | | | | | | | | | | | | | | binlog_truncate_innodb and binlog_spurious_ddl_errors, rpl_parallel_retry fails in bb
| | | * MDEV-16372 ER_BASE64_DECODE_ERROR upon replaying binary log via mysqlbinlog ↵Andrei Elkin2020-08-311-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | --verbose (This commit is exclusively for 10.2 branch. Do not merge it to 10.3) In case of a pattern of non-STMT_END-marked Rows-log-event (A) followed by a STMT_END marked one (B) mysqlbinlog mixes up the base64 encoded rows events with their pseudo sql representation produced by the verbose option: BINLOG ' base64 encoded data for A ### verbose section for A base64 encoded data for B ### verbose section for B '/*!*/; In effect the produced BINLOG '...' query is not valid and is rejected with the error. Examples of this way malformed BINLOG could have been found in binlog_row_annotate.result that gets corrected with the patch. The issue is fixed with introduction an auxiliary IO_CACHE to hold on the verbose comments until the terminal STMT_END event is found. The new cache is emptied out after two pre-existing ones are done at that time. The correctly produced output now for the above case is as the following: BINLOG ' base64 encoded data for A base64 encoded data for B '/*!*/; ### verbose section for A ### verbose section for B Thanks to Alexey Midenkov for the problem recognition and attempt to tackle, and to Venkatesh Duggirala who produced a patch for the upstream whose idea is exploited here, as well as to MDEV-23077 reporter LukeXwang who also contributed a piece of a patch aiming at this issue.
* | | | Merge 10.4 into 10.5Marko Mäkelä2020-09-041-1/+0
|\ \ \ \ | |/ / /
| * | | Merge 10.3 into 10.4Marko Mäkelä2020-09-031-1/+0
| |\ \ \ | | |/ /
| | * | MDEV-16372 ER_BASE64_DECODE_ERROR upon replaying binary log via mysqlbinlog ↵Andrei Elkin2020-08-311-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | --verbose (This commit is for 10.3 and upper branches) In case of a pattern of non-STMT_END-marked Rows-log-event (A) followed by a STMT_END marked one (B) mysqlbinlog mixes up the base64 encoded rows events with their pseudo sql representation produced by the verbose option: BINLOG ' base64 encoded data for A ### verbose section for A base64 encoded data for B ### verbose section for B '/*!*/; In effect the produced BINLOG '...' query is not valid and is rejected with the error. Examples of this way malformed BINLOG could have been found in binlog_row_annotate.result that gets corrected with the patch. The issue is fixed with introduction an auxiliary IO_CACHE to hold on the verbose comments until the terminal STMT_END event is found. The new cache is emptied out after two pre-existing ones are done at that time. The correctly produced output now for the above case is as the following: BINLOG ' base64 encoded data for A base64 encoded data for B '/*!*/; ### verbose section for A ### verbose section for B Thanks to Alexey Midenkov for the problem recognition and attempt to tackle, and to Venkatesh Duggirala who produced a patch for the upstream whose idea is exploited here, as well as to MDEV-23077 reporter LukeXwang who also contributed a piece of a patch aiming at this issue.
* | | | Merge 10.4 into 10.5Marko Mäkelä2020-08-211-1/+1
|\ \ \ \ | |/ / /
| * | | Merge 10.3 into 10.4Marko Mäkelä2020-08-211-1/+1
| |\ \ \ | | |/ /
| | * | Merge 10.2 into 10.3Marko Mäkelä2020-08-211-1/+1
| | |\ \ | | | |/
| | | * MDEV-23511 shutdown_server 10 times out, causing server kill at shutdownAndrei Elkin2020-08-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Shutdown of mtr tests may be too impatient, esp on CI environment where 10 seconds of `arg` of `shutdown_server arg` may not be enough for the clean shutdown to complete. This is fixed to remove explicit non-zero timeout argument to `shutdown_server` from all mtr tests. mysqltest computes 60 seconds default value for the timeout for the argless `shutdown_server` command. This policy is additionally ensured with a compile time assert.
* | | | Merge 10.4 into 10.5Marko Mäkelä2020-08-011-18/+18
|\ \ \ \ | |/ / /
| * | | Merge 10.3 into 10.4Marko Mäkelä2020-07-311-18/+18
| |\ \ \ | | |/ /
| | * | MDEV-23108: Point in time recovery of binary log fails when sql_mode=ORACLESujatha2020-07-221-18/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: ======== During point in time recovery of binary log syntax error is reported for BEGIN statement and recovery fails. Analysis: ========= In MariaDB 10.3 and later, setting the sql_mode system variable to Oracle allows the server to understand a subset of Oracle's PL/SQL language. When sql_mode=ORACLE is set, it switches the parser from the MariaDB parser to Oracle compatible parser. With this change 'BEGIN' is not considered as 'START TRANSACTION'. Hence the syntax error is reported. Fix: === At preset 'BEGIN' query is generated from 'Gtid_log_event::print'. The current session specific 'sql_mode' information is not present as part of 'Gtid_log_event'. If it was available then, mysqlbinlog tool can make use of 'sql_mode == ORACLE' and can output "START TRANSACTION" in this particular mode and for other sql_modes it will write "BEGIN" as part of output. Since it is not available 'mysqlbinlog' tool will output all 'BEGIN' statements as 'START TRANSACTION' irrespective of 'sql_mode'.
* | | | Merge branch '10.4' into 10.5Sujatha2020-05-201-0/+1
|\ \ \ \ | |/ / /
| * | | MDEV-22451: SIGSEGV in __memmove_avx_unaligned_erms/memcpy from _my_b_write ↵Sujatha2020-05-201-0/+1
| |\ \ \ | | |/ / | | | | | | | | | | | | | | | | on CREATE after RESET MASTER Merge branch '10.3' into 10.4
| | * | MDEV-22451: SIGSEGV in __memmove_avx_unaligned_erms/memcpy from _my_b_write ↵Sujatha2020-05-201-0/+1
| | |\ \ | | | |/ | | | | | | | | | | | | | | | | on CREATE after RESET MASTER Merge branch '10.2' into 10.3
| | | * MDEV-22451: SIGSEGV in __memmove_avx_unaligned_erms/memcpy from _my_b_write ↵Sujatha2020-05-201-0/+1
| | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | on CREATE after RESET MASTER Merge branch '10.1' into 10.2
| | | | * MDEV-22451: SIGSEGV in __memmove_avx_unaligned_erms/memcpy from _my_b_write ↵Sujatha2020-05-201-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | on CREATE after RESET MASTER Analysis: ======== RESET MASTER TO # command deletes all binary log files listed in the index file, resets the binary log index file to be empty, and creates a new binary log with number #. When the user provided binary log number is greater than the max allowed value '2147483647' server fails to generate a new binary log. The RESET MASTER statement marks the binlog closure status as 'LOG_CLOSE_TO_BE_OPENED' and exits. Statements which follow RESET MASTER try to write to binary log they find the log_state != LOG_CLOSED and proceed to write to binary log cache and it results in crash. Fix: === During MYSQL_BIN_LOG open, if generation of new binary log name fails then the "log_state" needs to be marked as "LOG_CLOSED". With this further statements will find binary log as closed and they will skip writing to the binary log.
* | | | | Merge 10.4 into 10.5Marko Mäkelä2020-03-302-50/+44
|\ \ \ \ \ | |/ / / /