mariadb/mysql-test/suite/encryption/t
Jan Lindström 283e9cf4cb MDEV-11656: 'Data structure corruption' IMPORT TABLESPACE doesn't work for encrypted InnoDB tables if space_id changed
Problem was that for encryption we use temporary scratch area for
reading and writing tablespace pages. But if page was not really
decrypted the correct updated page was not moved to scratch area
that was then written. This can happen e.g. for page 0 as it is
newer encrypted even if encryption is enabled and as we write
the contents of old page 0 to tablespace it contained naturally
incorrect space_id that is then later noted and error message
was written. Updated page with correct space_id was lost.

If tablespace is encrypted we use additional
temporary scratch area where pages are read
for decrypting readptr == crypt_io_buffer != io_buffer.

Destination for decryption is a buffer pool block
block->frame == dst == io_buffer that is updated.
Pages that did not require decryption even when
tablespace is marked as encrypted are not copied
instead block->frame is set to src == readptr.

If tablespace was encrypted we copy updated page to
writeptr != io_buffer. This fixes above bug.

For encryption we again use temporary scratch area
writeptr != io_buffer == dst
that is then written to the tablespace

(1) For normal tables src == dst ==  writeptr
ut_ad(!encrypted && !page_compressed ?
	src == dst && dst == writeptr + (i * size):1);
(2) For page compressed tables src == dst == writeptr
ut_ad(page_compressed && !encrypted ?
	src == dst && dst == writeptr + (i * size):1);
(3) For encrypted tables src != dst != writeptr
ut_ad(encrypted ?
	src != dst && dst != writeptr + (i * size):1);
2016-12-28 16:32:45 +02:00
..
aria_tiny.test MDEV-8022 Assertion `rc == 0' failed in ma_encrypt on dropping an encrypted Aria table 2015-05-13 14:27:17 +02:00
create_or_replace.opt MDEV-8391: encryption.innodb-page_encryption_compression fails 2015-06-29 08:49:58 +03:00
create_or_replace.test MDEV-8501: encryption.create_or_replace fails in buildbot on P8 builders 2015-07-21 12:51:14 +03:00
debug_key_management.opt Test debug_key_management fails sporadically in buildbot. 2015-10-29 10:35:37 +02:00
debug_key_management.test Test debug_key_management fails sporadically in buildbot. 2015-10-29 10:35:37 +02:00
encrypt_and_grep.opt MDEV-8164: Server crashes in pfs_mutex_enter_func after fil_crypt_is_closing or alike 2015-05-18 13:28:13 +03:00
encrypt_and_grep.test MDEV-8817: Failing assertion: new_state->key_version != ENCRYPTION_KEY_VERSION_INVALID 2015-09-22 15:13:48 +03:00
encryption_force.opt
encryption_force.test MDEV-8130 Wrong error code/message while encrypting a partitioned InnoDB table 2015-05-13 14:27:18 +02:00
filekeys-data.enc
filekeys-data.key
filekeys-tooshort.enc MDEV-10888: encryption.filekeys_emptyfile fails in buildbot with valgrind 2016-09-27 07:54:27 +03:00
filekeys_badtest.inc
filekeys_emptyfile.opt MDEV-9613: keyfile without any keys crashes mysqld on loading file_key_management plugin 2016-03-22 22:20:33 +02:00
filekeys_emptyfile.test MDEV-9613: keyfile without any keys crashes mysqld on loading file_key_management plugin 2016-03-22 22:20:33 +02:00
filekeys_encfile.opt
filekeys_encfile.test
filekeys_encfile_bad.opt
filekeys_encfile_bad.test
filekeys_encfile_badfile.opt
filekeys_encfile_badfile.test
filekeys_encfile_file.opt
filekeys_encfile_file.test
filekeys_encfile_no.opt
filekeys_encfile_no.test
filekeys_goodtest.inc
filekeys_nofile.test fix the encryption.filekeys_nofile test 2015-10-10 14:19:02 +02:00
filekeys_plugin.inc misc encryption tests fixes 2015-06-27 09:40:54 +02:00
filekeys_plugin.opt
filekeys_plugin_exists.inc Fix test failures seen on buildbot where file_key_management plugin 2015-09-17 16:40:31 +03:00
filekeys_syntax.opt
filekeys_syntax.test file_key_management plugin: complain if key id 1 is not found 2015-06-02 19:00:23 +02:00
filekeys_tooshort.opt MDEV-10888: encryption.filekeys_emptyfile fails in buildbot with valgrind 2016-09-27 07:54:27 +03:00
filekeys_tooshort.test MDEV-10888: encryption.filekeys_emptyfile fails in buildbot with valgrind 2016-09-27 07:54:27 +03:00
filekeys_unencfile.opt
filekeys_unencfile.test
innochecksum.test MDEV-8773: InnoDB innochecksum does not work with encrypted or page compressed tables 2015-09-19 11:31:39 +03:00
innodb-bad-key-change.test Fix test failure. Need to mask more tablespace numbers as they 2016-09-23 09:11:11 +03:00
innodb-bad-key-change2.test Fix test failures seen on buildbot where file_key_management plugin 2015-09-17 16:40:31 +03:00
innodb-bad-key-change3.test MDEV-11218: encryption.innodb_encryption_discard_import failed in buildbot 2016-12-22 14:02:51 +02:00
innodb-bad-key-change4.test Fix test failures seen on buildbot where file_key_management plugin 2015-09-17 16:40:31 +03:00
innodb-bad-key-change5.opt MDEV-8769: Server crash at file btr0btr.ic line 122 when defragmenting encrypted table using incorrect keys 2015-09-14 12:15:27 +03:00
innodb-bad-key-change5.test Fix test failures seen on buildbot where file_key_management plugin 2015-09-17 16:40:31 +03:00
innodb-bad-key-shutdown.test MDEV-8727: Server/InnoDB hangs on shutdown after trying to read an encrypted table with a wrong key 2015-10-01 08:20:27 +03:00
innodb-discard-import-change.test MDEV-11656: 'Data structure corruption' IMPORT TABLESPACE doesn't work for encrypted InnoDB tables if space_id changed 2016-12-28 16:32:45 +02:00
innodb-discard-import.test MDEV-11218: encryption.innodb_encryption_discard_import failed in buildbot 2016-12-22 14:02:51 +02:00
innodb-encr-threads.test InnoDB: check if scrubbing is enabled before scanning the tablespace 2015-05-15 18:12:02 +02:00
innodb-encryption-alter.test MDEV-8817: Failing assertion: new_state->key_version != ENCRYPTION_KEY_VERSION_INVALID 2015-09-23 10:20:05 +03:00
innodb-encryption-disable.test MDEV-9559: Server without encryption configs crashes if selecting from an implicitly encrypted table 2016-02-17 12:32:07 +02:00
innodb-log-encrypt-crash.opt MDEV-9422: Checksum errors on restart when killing busy instance that uses encrypted XtraDB tables 2016-03-18 07:58:04 +02:00
innodb-log-encrypt-crash.test MDEV-9865: Test encryption.innodb-log-encrypt-crash takes too long on debug build 2016-06-01 13:06:14 +03:00
innodb-log-encrypt.opt MDEV-9063: encryption.innodb-log-encrypt produces warnings in error logs on builds with bundled SSL 2015-11-03 16:03:25 +02:00
innodb-log-encrypt.test MDEV-9422: Checksum errors on restart when killing busy instance that uses encrypted XtraDB tables 2016-03-18 07:58:04 +02:00
innodb-missing-key.opt MDEV-11004: Unable to start (Segfault or os error 2) when encryption key missing 2016-10-29 10:09:06 +03:00
innodb-missing-key.test MDEV-11004: Unable to start (Segfault or os error 2) when encryption key missing 2016-10-29 10:09:06 +03:00
innodb-page_encryption-32k.opt
innodb-page_encryption-32k.test
innodb-page_encryption.test Add show warnings to test to find out the reason for create failure. 2015-07-01 10:21:23 +03:00
innodb-page_encryption_compression.test MDEV-10739: encryption.innodb-page_encryption_compression fails with timeout on valgrind 2016-11-29 08:35:51 +02:00
innodb-page_encryption_log_encryption.opt MDEV-8143: InnoDB: Database page corruption on disk or a failed file read 2015-05-14 11:32:24 +03:00
innodb-page_encryption_log_encryption.test Add show warnings to test to find out the reason for create failure. 2015-07-01 10:21:23 +03:00
innodb_encryption-page-compression.opt
innodb_encryption-page-compression.test Fix test failure where the environment was not fully restored. 2015-06-29 20:03:57 +03:00
innodb_encryption.opt MDEV-9010 Encryption preset file contains different configuration preset then documentation 2015-10-29 10:46:37 +01:00
innodb_encryption.test
innodb_encryption_discard_import.opt MDEV-8708: InnoDB temp file encryption 2015-09-08 08:38:12 +03:00
innodb_encryption_discard_import.test MDEV-11218: encryption.innodb_encryption_discard_import failed in buildbot 2016-12-22 14:02:51 +02:00
innodb_encryption_filekeys.opt MDEV-8832: Encryption meta data should not be stored when ENCRYPTED=DEFAULT and innodb-encrypt-tables=OFF 2015-09-23 17:34:36 +03:00
innodb_encryption_filekeys.test MDEV-8893: Test encryption.innodb_encryption_filekeys fails on buildbot 2015-10-05 09:27:33 +03:00
innodb_encryption_is.opt MDEV-9640: Add used key_id to INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION 2016-03-18 11:48:49 +02:00
innodb_encryption_is.test MDEV-9640: Add used key_id to INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION 2016-03-18 11:48:49 +02:00
innodb_encryption_row_compressed.opt MDEV-9931: InnoDB reads first page of every .ibd file at startup 2016-09-22 16:38:24 +03:00
innodb_encryption_row_compressed.test MDEV-9931: InnoDB reads first page of every .ibd file at startup 2016-09-22 16:38:24 +03:00
innodb_encryption_tables.opt
innodb_encryption_tables.test misc encryption tests fixes 2015-06-27 09:40:54 +02:00
innodb_first_page.opt
innodb_first_page.test MDEV-8495 encryption.innodb_first_page fails sporadically in buildbot 2015-07-17 19:20:50 +03:00
innodb_lotoftables.opt MDEV-9931: InnoDB reads first page of every .ibd file at startup 2016-09-22 16:38:24 +03:00
innodb_lotoftables.test MDEV-9931: InnoDB reads first page of every .ibd file at startup 2016-09-22 16:38:24 +03:00
innodb_onlinealter_encryption.opt MDEV-8708: InnoDB temp file encryption 2015-09-08 08:38:12 +03:00
innodb_onlinealter_encryption.test Fix test failures seen on buildbot where file_key_management plugin 2015-09-17 16:40:31 +03:00
innodb_page_encryption_key_change.test Add show warnings to test to find out the reason for create failure. 2015-07-01 10:21:23 +03:00
innodb_scrub.opt Fixed innodb_scrub_background test. 2015-05-27 11:00:46 +03:00
innodb_scrub.test
innodb_scrub_background.opt Fixed innodb_scrub_background test. 2015-05-27 11:00:46 +03:00
innodb_scrub_background.test Fixed innodb_scrub_background test. 2015-05-27 11:00:46 +03:00
innodb_scrub_compressed.opt Fixed innodb_scrub_background test. 2015-05-27 11:00:46 +03:00
innodb_scrub_compressed.test
tempfiles.test AES-GCM support in file_key_management plugin 2015-06-02 19:00:23 +02:00