summaryrefslogtreecommitdiff
path: root/storage/archive
diff options
context:
space:
mode:
authorVladislav Vaintroub <vvaintroub@mysql.com>2009-12-11 21:17:17 +0100
committerVladislav Vaintroub <vvaintroub@mysql.com>2009-12-11 21:17:17 +0100
commita6f6932e26f74557f674bc848271ed6a28de5bb6 (patch)
tree907faecbe376506fb024d3a5c49d8db9a6cb1737 /storage/archive
parent3a6b75949c44709fec9841a3b216dec2f46826e1 (diff)
parent376cf4275f28f6b8167eaf19b2c66dee41fbc5c5 (diff)
downloadmariadb-git-a6f6932e26f74557f674bc848271ed6a28de5bb6.tar.gz
merge
Diffstat (limited to 'storage/archive')
-rw-r--r--storage/archive/archive_reader.c3
-rw-r--r--storage/archive/ha_archive.cc26
2 files changed, 19 insertions, 10 deletions
diff --git a/storage/archive/archive_reader.c b/storage/archive/archive_reader.c
index 84d4e318b49..0d641de3e15 100644
--- a/storage/archive/archive_reader.c
+++ b/storage/archive/archive_reader.c
@@ -390,7 +390,8 @@ static void print_version(void)
static void get_options(int *argc, char ***argv)
{
- load_defaults("my", load_default_groups, argc, argv);
+ if (load_defaults("my", load_default_groups, argc, argv))
+ exit(1);
default_argv= *argv;
handle_options(argc, argv, my_long_options, get_one_option);
diff --git a/storage/archive/ha_archive.cc b/storage/archive/ha_archive.cc
index 2ff4a5daff5..30528b538d6 100644
--- a/storage/archive/ha_archive.cc
+++ b/storage/archive/ha_archive.cc
@@ -1521,21 +1521,29 @@ int ha_archive::info(uint flag)
DBUG_PRINT("ha_archive", ("Stats rows is %d\n", (int)stats.records));
/* Costs quite a bit more to get all information */
- if (flag & HA_STATUS_TIME)
+ if (flag & (HA_STATUS_TIME | HA_STATUS_CONST | HA_STATUS_VARIABLE))
{
MY_STAT file_stat; // Stat information for the data file
(void) my_stat(share->data_file_name, &file_stat, MYF(MY_WME));
- 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.mean_rec_length= stats.records ?
- stats.data_file_length / stats.records : table->s->reclength;
- stats.max_data_file_length= MAX_FILE_SIZE;
+ if (flag & HA_STATUS_TIME)
+ stats.update_time= (ulong) file_stat.st_mtime;
+ if (flag & HA_STATUS_CONST)
+ {
+ stats.max_data_file_length= share->rows_recorded * stats.mean_rec_length;
+ stats.max_data_file_length= MAX_FILE_SIZE;
+ stats.create_time= (ulong) file_stat.st_ctime;
+ }
+ if (flag & HA_STATUS_VARIABLE)
+ {
+ stats.delete_length= 0;
+ stats.data_file_length= file_stat.st_size;
+ stats.index_file_length=0;
+ stats.mean_rec_length= stats.records ?
+ stats.data_file_length / stats.records : table->s->reclength;
+ }
}
- stats.delete_length= 0;
- stats.index_file_length=0;
if (flag & HA_STATUS_AUTO)
{