diff options
author | Ashish Agarwal <ashish.y.agarwal@oracle.com> | 2012-02-02 14:25:43 +0530 |
---|---|---|
committer | Ashish Agarwal <ashish.y.agarwal@oracle.com> | 2012-02-02 14:25:43 +0530 |
commit | a076427ffd95d23790e07fe1ab38cbc735f8c713 (patch) | |
tree | cdbaa9d23bba63b58288f9678ad335c99c60c900 /storage/myisam | |
parent | 07c0e405bfcb6fa59ff7a0c5d3990cc346c52f6e (diff) | |
parent | 4e096d2a456a93c61ad3da3163a2386b9c1d8317 (diff) | |
download | mariadb-git-a076427ffd95d23790e07fe1ab38cbc735f8c713.tar.gz |
BUG#11756869: Merge from mysql-5.1 to mysql-5.5
Diffstat (limited to 'storage/myisam')
-rw-r--r-- | storage/myisam/mi_check.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/storage/myisam/mi_check.c b/storage/myisam/mi_check.c index d2b0c63cfe9..77cd66a4811 100644 --- a/storage/myisam/mi_check.c +++ b/storage/myisam/mi_check.c @@ -4303,14 +4303,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) (mysql_file_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; @@ -4320,10 +4312,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)); |