diff options
author | Ashish Agarwal <ashish.y.agarwal@oracle.com> | 2012-02-02 14:19:38 +0530 |
---|---|---|
committer | Ashish Agarwal <ashish.y.agarwal@oracle.com> | 2012-02-02 14:19:38 +0530 |
commit | adf79bc12f3c2f3be2e49aaac4252a9e33a62d2f (patch) | |
tree | 2c4c9dc2b53de47f1d2fdee10732f4d1cac2791f /storage/myisam | |
parent | 7d696c9d24b1d8aff532fd3fcc3aa668044d8679 (diff) | |
parent | bec3694b373e2df036fadd141aba8da7ce78efb6 (diff) | |
download | mariadb-git-adf79bc12f3c2f3be2e49aaac4252a9e33a62d2f.tar.gz |
BUG#11756869 - 48848: MYISAMCHK DOING SORT RECOVER IN CERTAIN
CASES RESETS DATA POINTER TO SMAL
ISSUE: Myisamchk doing sort recover
on a table reduces data_file_length.
Maximum size of data file decreases,
lesser number of rows are stored.
SOLUTION: Size of data_file_length is
fixed to the original length.
Diffstat (limited to 'storage/myisam')
-rw-r--r-- | storage/myisam/mi_check.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/storage/myisam/mi_check.c b/storage/myisam/mi_check.c index 4a0c2da5559..35d28facdd8 100644 --- a/storage/myisam/mi_check.c +++ b/storage/myisam/mi_check.c @@ -4314,13 +4314,6 @@ int recreate_table(MI_CHECK *param, MI_INFO **org_info, char *filename) u_ptr->seg=keyseg; keyseg+=u_ptr->keysegs+1; } - if (share.options & HA_OPTION_COMPRESS_RECORD) - share.base.records=max_records=info.state->records; - else if (share.base.min_pack_length) - max_records=(ha_rows) (my_seek(info.dfile,0L,MY_SEEK_END,MYF(0)) / - (ulong) share.base.min_pack_length); - else - max_records=0; unpack= (share.options & HA_OPTION_COMPRESS_RECORD) && (param->testflag & T_UNPACK); share.options&= ~HA_OPTION_TEMP_COMPRESS_RECORD; @@ -4330,10 +4323,17 @@ int recreate_table(MI_CHECK *param, MI_INFO **org_info, char *filename) set_if_bigger(file_length,param->max_data_file_length); set_if_bigger(file_length,tmp_length); set_if_bigger(file_length,(ulonglong) share.base.max_data_file_length); + + if (share.options & HA_OPTION_COMPRESS_RECORD) + share.base.records= max_records= info.state->records; + else if (!(share.options & HA_OPTION_PACK_RECORD)) + max_records= (ha_rows) (file_length / share.base.pack_reclength); + else + max_records= 0; VOID(mi_close(*org_info)); bzero((char*) &create_info,sizeof(create_info)); - create_info.max_rows=max(max_records,share.base.records); + create_info.max_rows= max_records; create_info.reloc_rows=share.base.reloc; create_info.old_options=(share.options | (unpack ? HA_OPTION_TEMP_COMPRESS_RECORD : 0)); |