Browse Source
MDEV-9158 post-merge fixes
MDEV-9158 post-merge fixes
* format error messages (spaces, "bytes") * speed up "length too large" test from 12s to 70ms * fix it for --parallel * fix "named pipe" test to actually test a named pipe * add the standard header to tests, enable result log * fix for ASAN * read loop to workaround small (64K) pipe buffer size * clarified error message for the file too largepull/3833/head
7 changed files with 88 additions and 56 deletions
-
15mysql-test/suite/encryption/r/filekeys_length_too_large.result
-
17mysql-test/suite/encryption/r/filekeys_named_pipe.result
-
2mysql-test/suite/encryption/t/filekeys_length_too_large.opt
-
41mysql-test/suite/encryption/t/filekeys_length_too_large.test
-
2mysql-test/suite/encryption/t/filekeys_named_pipe.opt
-
32mysql-test/suite/encryption/t/filekeys_named_pipe.test
-
35plugin/file_key_management/parser.cc
@ -1,8 +1,15 @@ |
|||
# |
|||
# MDEV-9158 file_key_management should support reading from a named pipe |
|||
# |
|||
# Test checks if opening a too large key file, file key plugin will only read max key file size bytes and extra bytes will be ignored. |
|||
#Large key file will read max size bytes , which is 1MB |
|||
call mtr.add_suppression("Syntax error"); |
|||
call mtr.add_suppression("Invalid key"); |
|||
select seq,repeat(md5(seq), 200) |
|||
into outfile 'MYSQLTEST_VARDIR/tmp/filekeys-data-too-large.key' |
|||
fields terminated by ';' |
|||
from seq_1_to_1000; |
|||
#Large key file will read max size bytes, which is 1MB |
|||
call mtr.add_suppression("filekeys-data-too-large.key too large, must be less than 1048576 bytes"); |
|||
call mtr.add_suppression("Plugin 'file_key_management' init function returned error"); |
|||
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed"); |
|||
INSTALL SONAME 'file_key_management'; |
|||
FOUND 1 /read bytes: 1048576B/ in mysqld.1.err |
|||
ERROR HY000: File MYSQLTEST_VARDIR/tmp/filekeys-data-too-large.key too large, must be less than 1048576 bytes |
|||
FOUND 1 /filekeys-data-too-large.key too large, must be less than 1048576 bytes/ in mysqld.1.err |
@ -1 +1 @@ |
|||
--loose-file-key-management-filename=$MYSQL_TMP_DIR/filekeys-data-too-large.key |
|||
--loose-file-key-management-filename=$MYSQLTEST_VARDIR/tmp/filekeys-data-too-large.key |
@ -1,33 +1,28 @@ |
|||
-- source include/not_embedded.inc |
|||
--echo # |
|||
--echo # MDEV-9158 file_key_management should support reading from a named pipe |
|||
--echo # |
|||
--source include/not_embedded.inc |
|||
--source include/have_sequence.inc |
|||
|
|||
--echo # Test checks if opening a too large key file, file key plugin will only read max key file size bytes and extra bytes will be ignored. |
|||
|
|||
let $k=0; |
|||
while($k<1000){ |
|||
let $content=""; |
|||
let $i= 1; |
|||
while($i <= 100){ |
|||
let $num= `SELECT $i+$k*100`; |
|||
let $content=$content"$num;24e579b00c0f365a11761bdb9286a72a1148fa779d9c23dd55402627d0c87726"; |
|||
if($i<=99){ |
|||
let $content=$content"\n"; |
|||
} |
|||
inc $i; |
|||
} |
|||
exec echo -e $content >> $MYSQL_TMP_DIR/filekeys-data-too-large.key; |
|||
inc $k; |
|||
} |
|||
--echo #Large key file will read max size bytes , which is 1MB |
|||
let SEARCH_PATTERN=read bytes: 1048576B; |
|||
call mtr.add_suppression("Syntax error"); |
|||
call mtr.add_suppression("Invalid key"); |
|||
replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR; |
|||
eval select seq,repeat(md5(seq), 200) |
|||
into outfile '$MYSQLTEST_VARDIR/tmp/filekeys-data-too-large.key' |
|||
fields terminated by ';' |
|||
from seq_1_to_1000; |
|||
|
|||
--echo #Large key file will read max size bytes, which is 1MB |
|||
let SEARCH_PATTERN=filekeys-data-too-large.key too large, must be less than 1048576 bytes; |
|||
eval call mtr.add_suppression("$SEARCH_PATTERN"); |
|||
call mtr.add_suppression("Plugin 'file_key_management' init function returned error"); |
|||
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed"); |
|||
|
|||
--disable_result_log |
|||
replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR; |
|||
--error 2 |
|||
INSTALL SONAME 'file_key_management'; |
|||
--enable_result_log |
|||
|
|||
|
|||
--let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err |
|||
--source include/search_pattern_in_file.inc |
|||
|
|||
--remove_file $MYSQLTEST_VARDIR/tmp/filekeys-data-too-large.key |
@ -1 +1 @@ |
|||
--loose-file-key-management-filename=$MYSQL_TMP_DIR/fifo.key |
|||
--loose-file-key-management-filename=$MYSQLTEST_VARDIR/tmp/fifo.key |
Write
Preview
Loading…
Cancel
Save
Reference in new issue