Commit 14a5f5dd authored by brian@avenger.(none)'s avatar brian@avenger.(none)

Clean up from code review.

parent 3cf8548c
...@@ -799,7 +799,7 @@ int ha_archive::optimize(THD* thd, HA_CHECK_OPT* check_opt) ...@@ -799,7 +799,7 @@ int ha_archive::optimize(THD* thd, HA_CHECK_OPT* check_opt)
char block[IO_SIZE]; char block[IO_SIZE];
char writer_filename[FN_REFLEN]; char writer_filename[FN_REFLEN];
/* Closing will cause all data waiting to be flushed, to be flushed */ /* Closing will cause all data waiting to be flushed */
gzclose(share->archive_write); gzclose(share->archive_write);
share->archive_write= NULL; share->archive_write= NULL;
...@@ -889,24 +889,15 @@ void ha_archive::info(uint flag) ...@@ -889,24 +889,15 @@ void ha_archive::info(uint flag)
/* Costs quite a bit more to get all information */ /* Costs quite a bit more to get all information */
if (flag & HA_STATUS_TIME) if (flag & HA_STATUS_TIME)
{ {
uint32 alloced_length_mean= 0;
uint number_of_blobs= 0;
MY_STAT file_stat; // Stat information for the data file MY_STAT file_stat; // Stat information for the data file
VOID(my_stat(share->data_file_name, &file_stat, MYF(MY_WME))); VOID(my_stat(share->data_file_name, &file_stat, MYF(MY_WME)));
for (Field_blob **field=table->blob_field ; *field ; field++) mean_rec_length= table->reclength + buffer.alloced_length();
number_of_blobs++; data_file_length= file_stat.st_size;
if (number_of_blobs)
alloced_length_mean= buffer.alloced_length()/number_of_blobs;
mean_rec_length= table->reclength + alloced_length_mean;
data_file_length= file_stat.st_size; // Its not worth calling stat to find out
create_time= file_stat.st_ctime; create_time= file_stat.st_ctime;
update_time= file_stat.st_mtime; update_time= file_stat.st_mtime;
max_data_file_length= share->rows_recorded * (table->reclength + alloced_length_mean); max_data_file_length= share->rows_recorded * mean_rec_length;
} }
delete_length= 0; delete_length= 0;
index_file_length=0; index_file_length=0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment