summaryrefslogtreecommitdiff
path: root/storage/myisam
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2020-05-13 13:10:35 +0200
committerSergei Golubchik <serg@mariadb.org>2020-05-27 15:56:40 +0200
commita50e6c9eb126cbb1d46735dade6c9006f1a5a764 (patch)
treec12950c359a4915eb1149f0c1d8cf2fb3a1908f2 /storage/myisam
parent5139cfabb3bfc62be38e651ff176580e0aba09b8 (diff)
downloadmariadb-git-a50e6c9eb126cbb1d46735dade6c9006f1a5a764.tar.gz
MDEV-17153 server crash on repair table ... use_frm
data_file_length == 0 in mi_repair() is normal for REPAIR ... USE_FRM. But in-file links (for blocks and deleted chain) must be compared with the real file length to avoid spurious "link points outside datafile" warnings and arbitrary block skipping.
Diffstat (limited to 'storage/myisam')
-rw-r--r--storage/myisam/mi_check.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/storage/myisam/mi_check.c b/storage/myisam/mi_check.c
index b18ffb99a11..d9b9bb5af4a 100644
--- a/storage/myisam/mi_check.c
+++ b/storage/myisam/mi_check.c
@@ -1586,6 +1586,8 @@ int mi_repair(HA_CHECK *param, register MI_INFO *info,
sort_param.filepos=new_header_length;
param->read_cache.end_of_file=sort_info.filelength=
mysql_file_seek(info->dfile, 0L, MY_SEEK_END, MYF(0));
+ if (info->state->data_file_length == 0)
+ info->state->data_file_length= sort_info.filelength;
sort_info.dupp=0;
sort_param.fix_datafile= (my_bool) (! rep_quick);
sort_param.master=1;
@@ -2290,6 +2292,8 @@ int mi_repair_by_sort(HA_CHECK *param, register MI_INFO *info,
sort_info.buff=0;
param->read_cache.end_of_file=sort_info.filelength=
mysql_file_seek(param->read_cache.file, 0L, MY_SEEK_END, MYF(0));
+ if (info->state->data_file_length == 0)
+ info->state->data_file_length= sort_info.filelength;
sort_param.wordlist=NULL;
init_alloc_root(&sort_param.wordroot, FTPARSER_MEMROOT_ALLOC_SIZE, 0,
@@ -2757,6 +2761,8 @@ int mi_repair_parallel(HA_CHECK *param, register MI_INFO *info,
sort_info.buff=0;
param->read_cache.end_of_file=sort_info.filelength=
mysql_file_seek(param->read_cache.file, 0L, MY_SEEK_END, MYF(0));
+ if (info->state->data_file_length == 0)
+ info->state->data_file_length= sort_info.filelength;
if (share->data_file_type == DYNAMIC_RECORD)
rec_length=MY_MAX(share->base.min_pack_length+1,share->base.min_block_length);