From 77b7f793f9e7504b39194f530edc0e314569ea1c Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sun, 17 May 2020 18:44:23 +0200 Subject: [PATCH] MDEV-18496 Crash when Aria encryption is enabled but plugin not available fix uninitialized struct member --- mysql-test/suite/maria/encrypt-no-key.result | 6 ++++++ mysql-test/suite/maria/encrypt-no-key.test | 1 + storage/maria/ma_check.c | 1 + 3 files changed, 8 insertions(+) diff --git a/mysql-test/suite/maria/encrypt-no-key.result b/mysql-test/suite/maria/encrypt-no-key.result index 4d15725648f..6745670dfac 100644 --- a/mysql-test/suite/maria/encrypt-no-key.result +++ b/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; diff --git a/mysql-test/suite/maria/encrypt-no-key.test b/mysql-test/suite/maria/encrypt-no-key.test index ff2190f5a6e..2d586c50695 100644 --- a/mysql-test/suite/maria/encrypt-no-key.test +++ b/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; diff --git a/storage/maria/ma_check.c b/storage/maria/ma_check.c index 789a4d0d5b6..8231cd47913 100644 --- a/storage/maria/ma_check.c +++ b/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);