Browse Source

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

fix uninitialized struct member
pull/1527/head
Sergei Golubchik 6 years ago
parent
commit
77b7f793f9
  1. 6
      mysql-test/suite/maria/encrypt-no-key.result
  2. 1
      mysql-test/suite/maria/encrypt-no-key.test
  3. 1
      storage/maria/ma_check.c

6
mysql-test/suite/maria/encrypt-no-key.result

@ -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;

1
mysql-test/suite/maria/encrypt-no-key.test

@ -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;

1
storage/maria/ma_check.c

@ -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);

Loading…
Cancel
Save