| 1 |
--enable_warnings |
| 2 |
# This test requires a small amount of not easily closeable InnoDB files. The |
| 3 |
# UNDO tablespaces are such not easily closeable files, so we limit runs to ones |
| 4 |
# that use the default amount of such. |
| 5 |
--source include/have_innodb_default_undo_tablespaces.inc |
| 6 |
|
| 7 |
--enable_query_log |
| 8 |
|
| 9 |
# Create some non-LRU files so there exists the limit value that can't be set. |
| 10 |
let $i = 9; |
| 11 |
while ($i >= 0) |
| 12 |
{ |
| 13 |
let $sql = CREATE UNDO TABLESPACE undo_00$i ADD DATAFILE 'undo_00$i.ibu'; |
| 14 |
--eval $sql |
| 15 |
--dec $i |
| 16 |
} |
| 17 |
|
| 18 |
|
| 19 |
SET @start_global_value = @@GLOBAL.innodb_open_files; |
| 20 |
SELECT @start_global_value; |
| 21 |
|
| 22 |
# |
| 23 |
# incorrect types |
| 24 |
# |
| 25 |
--error ER_CANT_INITIALIZE_UDF |
| 26 |
SELECT innodb_set_open_files_limit(1.1); |
| 27 |
--error ER_CANT_INITIALIZE_UDF |
| 28 |
SELECT innodb_set_open_files_limit(1e1); |
| 29 |
--error ER_CANT_INITIALIZE_UDF |
| 30 |
SELECT innodb_set_open_files_limit('AUTO'); |
| 31 |
--error ER_CANT_INITIALIZE_UDF |
| 32 |
SELECT innodb_set_open_files_limit(); |
| 33 |
--error ER_CANT_INITIALIZE_UDF |
| 34 |
SELECT innodb_set_open_files_limit(1, 2); |
| 35 |
--error ER_CANT_INITIALIZE_UDF |
| 36 |
SELECT innodb_set_open_files_limit(1, 2, 3, 4); |
| 37 |
--error ER_CANT_INITIALIZE_UDF |
| 38 |
SELECT innodb_set_open_files_limit(NULL); |
| 39 |
# Verify the value was not changed. |
| 40 |
select @@global.innodb_open_files; |
| 41 |
|
| 42 |
|
| 43 |
# |
| 44 |
# Too small values |
| 45 |
# |
| 46 |
--error ER_WRONG_ARGUMENTS |
| 47 |
SELECT innodb_set_open_files_limit(-3); |
| 48 |
--error ER_WRONG_ARGUMENTS |
| 49 |
SELECT innodb_set_open_files_limit(1); |
| 50 |
--error ER_WRONG_ARGUMENTS |
| 51 |
SELECT innodb_set_open_files_limit(3); |
| 52 |
--error ER_WRONG_ARGUMENTS |
| 53 |
SELECT innodb_set_open_files_limit(9); |
| 54 |
|
| 55 |
# |
| 56 |
# Too high values |
| 57 |
# |
| 58 |
--error ER_WRONG_ARGUMENTS |
| 59 |
SELECT innodb_set_open_files_limit(2147483648); |
| 60 |
--error ER_WRONG_ARGUMENTS |
| 61 |
SELECT innodb_set_open_files_limit(12342147483647); |
| 62 |
|
| 63 |
|
| 64 |
# |
| 65 |
# Set value on the limit. |
| 66 |
# |
| 67 |
--error ER_WRONG_ARGUMENTS |
| 68 |
SELECT innodb_set_open_files_limit(10); |
| 69 |
--error ER_WRONG_ARGUMENTS |
| 70 |
SELECT innodb_set_open_files_limit(14); |
| 71 |
|
| 72 |
# If the following (or above) query fails, check the error messages, you need |
| 73 |
# to adjust the value of 14 and 15 to match current limit. |
| 74 |
SELECT innodb_set_open_files_limit(15); |
| 75 |
--error ER_WRONG_ARGUMENTS |
| 76 |
SELECT innodb_set_open_files_limit(14); |
| 77 |
|
| 78 |
# |
| 79 |
# Set correct values. |
| 80 |
# |
| 81 |
SELECT innodb_set_open_files_limit(2147483647); |
| 82 |
SELECT innodb_set_open_files_limit(4000); |
| 83 |
SELECT innodb_set_open_files_limit(150); |
| 84 |
|
| 85 |
# |
| 86 |
# Cleanup |
| 87 |
# |
| 88 |
let $i = 9; |
| 89 |
while ($i >= 0) |
| 90 |
{ |
| 91 |
let $sql = ALTER UNDO TABLESPACE undo_00$i SET INACTIVE; |
| 92 |
--eval $sql |
| 93 |
--dec $i |
| 94 |
} |
| 95 |
|
| 96 |
let $i = 9; |
| 97 |
while ($i >= 0) |
| 98 |
{ |
| 99 |
let $inactive_undo_space = undo_00$i; |
| 100 |
source include/wait_until_undo_space_is_empty.inc; |
| 101 |
let $sql = DROP UNDO TABLESPACE undo_00$i; |
| 102 |
--eval $sql |
| 103 |
|
| 104 |
--dec $i |
| 105 |
} |
| 106 |
|
| 107 |
SELECT innodb_set_open_files_limit(@start_global_value); |
| 108 |
SELECT @@GLOBAL.innodb_open_files; |