fix the encryption.filekeys_nofile test
and move the error reporting where it belongs
This commit is contained in:
parent
affff1aefc
commit
c4e336e01e
@ -1,7 +1,7 @@
|
|||||||
call mtr.add_suppression("File '' not found");
|
call mtr.add_suppression("file-key-management-filename is not set");
|
||||||
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
|
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
|
||||||
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
|
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
|
||||||
FOUND /File '' not found/ in mysqld.1.err
|
FOUND /file-key-management-filename is not set/ in mysqld.1.err
|
||||||
create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes encryption_key_id=1;
|
create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes encryption_key_id=1;
|
||||||
ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
|
ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
|
||||||
select plugin_status from information_schema.plugins
|
select plugin_status from information_schema.plugins
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
let SEARCH_PATTERN=File '' not found;
|
let SEARCH_PATTERN=file-key-management-filename is not set;
|
||||||
source filekeys_badtest.inc;
|
source filekeys_badtest.inc;
|
||||||
|
@ -16,7 +16,6 @@
|
|||||||
|
|
||||||
#include "parser.h"
|
#include "parser.h"
|
||||||
#include <mysql/plugin_encryption.h>
|
#include <mysql/plugin_encryption.h>
|
||||||
#include <mysqld_error.h>
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
static char* filename;
|
static char* filename;
|
||||||
@ -166,13 +165,6 @@ struct st_mariadb_encryption file_key_management_plugin= {
|
|||||||
|
|
||||||
static int file_key_management_plugin_init(void *p)
|
static int file_key_management_plugin_init(void *p)
|
||||||
{
|
{
|
||||||
if (!filename || !filename[0])
|
|
||||||
{
|
|
||||||
my_printf_error(ER_CANT_INITIALIZE_UDF,
|
|
||||||
"file_key_management-filename is not set", MYF(0));
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
Parser parser(filename, filekey);
|
Parser parser(filename, filekey);
|
||||||
return parser.parse(&keys);
|
return parser.parse(&keys);
|
||||||
}
|
}
|
||||||
|
@ -298,8 +298,16 @@ int Parser::parse_line(char **line_ptr, keyentry *key)
|
|||||||
|
|
||||||
char* Parser::read_and_decrypt_file(const char *secret)
|
char* Parser::read_and_decrypt_file(const char *secret)
|
||||||
{
|
{
|
||||||
int f= my_open(filename, O_RDONLY, MYF(MY_WME));
|
if (!filename || !filename[0])
|
||||||
if (f < 0)
|
{
|
||||||
|
my_printf_error(EE_CANT_OPEN_STREAM,
|
||||||
|
"file-key-management-filename is not set",
|
||||||
|
MYF(ME_NOREFRESH));
|
||||||
|
goto err0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int f;
|
||||||
|
if ((f= my_open(filename, O_RDONLY, MYF(MY_WME))) < 0)
|
||||||
goto err0;
|
goto err0;
|
||||||
|
|
||||||
my_off_t file_size;
|
my_off_t file_size;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user