MDEV-18496 Crash when Aria encryption is enabled but plugin not available

fix uninitialized struct member
This commit is contained in:
Sergei Golubchik 2020-05-17 18:44:23 +02:00
parent 88cbe2f081
commit 77b7f793f9
3 changed files with 8 additions and 0 deletions

View file

@ -5,5 +5,11 @@ alter table t1 disable keys;
insert into t1 values (1,1);
alter table t1 enable keys;
ERROR HY000: Unknown key id 1. Can't continue!
repair table t1 use_frm;
Table Op Msg_type Msg_text
test.t1 repair warning Number of rows changed from 0 to 1
test.t1 repair Error Unknown key id 1. Can't continue!
test.t1 repair Error Unknown key id 1. Can't continue!
test.t1 repair status OK
drop table t1;
set global aria_encrypt_tables= default;

View file

@ -9,5 +9,6 @@ alter table t1 disable keys;
insert into t1 values (1,1);
error 192;
alter table t1 enable keys;
repair table t1 use_frm;
drop table t1;
set global aria_encrypt_tables= default;

View file

@ -3198,6 +3198,7 @@ static int write_page(MARIA_SHARE *share, File file,
args.page= buff;
args.pageno= (pgcache_page_no_t) (pos / share->block_size);
args.data= (uchar*) share;
args.crypt_buf= NULL;
(* share->kfile.pre_write_hook)(&args);
res= my_pwrite(file, args.page, block_size, pos, myf_rw);
(* share->kfile.post_write_hook)(res, &args);