summaryrefslogtreecommitdiff
path: root/storage/archive
diff options
context:
space:
mode:
authorSergey Vojtovich <svoj@sun.com>2009-09-09 14:42:12 +0500
committerSergey Vojtovich <svoj@sun.com>2009-09-09 14:42:12 +0500
commit04ed3c9d94de3f426c97c7f193dbcfdd73886206 (patch)
treeac719e951fcf905b13c6d1713ab90eca17efd08b /storage/archive
parentfe3b6356ca924b2d1313417bcf5a302f0ba70869 (diff)
downloadmariadb-git-04ed3c9d94de3f426c97c7f193dbcfdd73886206.tar.gz
BUG#29203 - archive tables have weird values in show table status
Archive engine returns wrong values for average record length and max data length. With this fix they're calculated as following: - max data length is 2 ^ 63 where large files are supported and INT_MAX32 where this is not supported; - average record length is data length / records in data file. mysql-test/r/archive.result: A test case for BUG#29203. mysql-test/t/archive.test: A test case for BUG#29203. storage/archive/ha_archive.cc: Better estimation for average row length and maximal data file length.
Diffstat (limited to 'storage/archive')
-rw-r--r--storage/archive/ha_archive.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/storage/archive/ha_archive.cc b/storage/archive/ha_archive.cc
index 1146b2eb73a..49bf036c5a6 100644
--- a/storage/archive/ha_archive.cc
+++ b/storage/archive/ha_archive.cc
@@ -1472,11 +1472,12 @@ int ha_archive::info(uint flag)
VOID(my_stat(share->data_file_name, &file_stat, MYF(MY_WME)));
- stats.mean_rec_length= table->s->reclength + buffer.alloced_length();
stats.data_file_length= file_stat.st_size;
stats.create_time= (ulong) file_stat.st_ctime;
stats.update_time= (ulong) file_stat.st_mtime;
- stats.max_data_file_length= share->rows_recorded * stats.mean_rec_length;
+ stats.mean_rec_length= stats.records ?
+ stats.data_file_length / stats.records : table->s->reclength;
+ stats.max_data_file_length= MAX_FILE_SIZE;
}
stats.delete_length= 0;
stats.index_file_length=0;