| 1 |
# |
| 2 |
# Prepare the server for redo log archiving. |
| 3 |
# |
| 4 |
SET @@global.innodb_redo_log_archive_dirs = 'label1:IRLA_DIRECTORY_1;label2:IRLA_DIRECTORY_2;:IRLA_DIRECTORY_3;'; |
| 5 |
|
| 6 |
# |
| 7 |
# Start and stop redo log archiving. Using SELECT. |
| 8 |
# |
| 9 |
SELECT innodb_redo_log_archive_start('label1'); |
| 10 |
innodb_redo_log_archive_start('label1') |
| 11 |
0 |
| 12 |
SELECT innodb_redo_log_archive_stop(); |
| 13 |
innodb_redo_log_archive_stop() |
| 14 |
0 |
| 15 |
# |
| 16 |
# Remove the redo log archive file. |
| 17 |
# |
| 18 |
|
| 19 |
# |
| 20 |
# Start and stop redo log archiving. Using DO. Result is constant anyway. |
| 21 |
# |
| 22 |
DO innodb_redo_log_archive_start('label1'); |
| 23 |
DO innodb_redo_log_archive_stop(); |
| 24 |
# |
| 25 |
# Remove the redo log archive file. |
| 26 |
# |
| 27 |
|
| 28 |
# |
| 29 |
# Start and stop redo log archiving. With NULL subdir. |
| 30 |
# |
| 31 |
DO innodb_redo_log_archive_start('label1', NULL); |
| 32 |
DO innodb_redo_log_archive_stop(); |
| 33 |
# |
| 34 |
# Remove the redo log archive file. |
| 35 |
# |
| 36 |
|
| 37 |
# |
| 38 |
# Start and stop redo log archiving. With empty subdir. |
| 39 |
# |
| 40 |
DO innodb_redo_log_archive_start('label1', ''); |
| 41 |
DO innodb_redo_log_archive_stop(); |
| 42 |
# |
| 43 |
# Remove the redo log archive file. |
| 44 |
# |
| 45 |
|
| 46 |
# |
| 47 |
# Start and stop redo log archiving. With subdir. |
| 48 |
# |
| 49 |
DO innodb_redo_log_archive_start('label2', 'subdir_2'); |
| 50 |
DO innodb_redo_log_archive_stop(); |
| 51 |
# |
| 52 |
# Remove the redo log archive file. |
| 53 |
# |
| 54 |
|
| 55 |
# |
| 56 |
# Start redo log archiving. With empty label |
| 57 |
# |
| 58 |
DO innodb_redo_log_archive_start('', 'subdir_3'); |
| 59 |
|
| 60 |
# |
| 61 |
# Create a lot of InnoDB redo log. |
| 62 |
# |
| 63 |
DROP DATABASE IF EXISTS db1; |
| 64 |
CREATE DATABASE db1; |
| 65 |
CREATE TABLE db1.t1(id int, b longblob) ENGINE=InnoDB; |
| 66 |
INSERT INTO db1.t1 VALUES(1, repeat(1, 22*1024*1024)); |
| 67 |
DELETE FROM db1.t1; |
| 68 |
DROP TABLE db1.t1; |
| 69 |
DROP DATABASE db1; |
| 70 |
|
| 71 |
# |
| 72 |
# Stop redo log archiving. |
| 73 |
# |
| 74 |
DO innodb_redo_log_archive_stop(); |
| 75 |
|
| 76 |
# |
| 77 |
# Check the minimum size of the redo log archive file. |
| 78 |
# |
| 79 |
|
| 80 |
# |
| 81 |
# Remove the redo log archive file. |
| 82 |
# |
| 83 |
|
| 84 |
# |
| 85 |
# Privileged user can start and stop redo log archiving. |
| 86 |
# |
| 87 |
CREATE USER mysqltest_u1@localhost; |
| 88 |
GRANT INNODB_REDO_LOG_ARCHIVE ON *.* TO mysqltest_u1@localhost; |
| 89 |
[connection u1] |
| 90 |
DO innodb_redo_log_archive_start('label1'); |
| 91 |
DO innodb_redo_log_archive_stop(); |
| 92 |
# |
| 93 |
# Remove the redo log archive file. |
| 94 |
# |
| 95 |
[connection default] |
| 96 |
|
| 97 |
# |
| 98 |
# Restart server |
| 99 |
# |
| 100 |
SET @@global.innodb_redo_log_archive_dirs = 'label1:IRLA_DIRECTORY_1'; |
| 101 |
# |
| 102 |
# Verify that the user does still have the INNODB_REDO_LOG_ARCHIVE privilege. |
| 103 |
# |
| 104 |
SHOW GRANTS FOR mysqltest_u1@localhost; |
| 105 |
Grants for mysqltest_u1@localhost |
| 106 |
GRANT USAGE ON *.* TO `mysqltest_u1`@`localhost` |
| 107 |
GRANT INNODB_REDO_LOG_ARCHIVE ON *.* TO `mysqltest_u1`@`localhost` |
| 108 |
# |
| 109 |
# Verify that the user can still start and stop redo log archiving. |
| 110 |
# |
| 111 |
[connection u1] |
| 112 |
DO innodb_redo_log_archive_start('label1'); |
| 113 |
DO innodb_redo_log_archive_stop(); |
| 114 |
# |
| 115 |
# Remove the redo log archive file. |
| 116 |
# |
| 117 |
[connection default] |
| 118 |
DROP USER mysqltest_u1@localhost; |
| 119 |
|
| 120 |
# |
| 121 |
# Cleanup |
| 122 |
# |
| 123 |
SET @@global.innodb_redo_log_archive_dirs = ''; |