summaryrefslogtreecommitdiff
path: root/sql/examples/ha_archive.h
diff options
context:
space:
mode:
authorunknown <brian@avenger.(none)>2004-12-09 01:48:07 -0800
committerunknown <brian@avenger.(none)>2004-12-09 01:48:07 -0800
commitb76b2e68a15fe8ed3ee66d56ccb2812f02c57446 (patch)
tree66f6f185076f7632561bb4c2c3857cbac4eda56c /sql/examples/ha_archive.h
parent3a994c8a731b4c1cb15226eea2702cbebc12041f (diff)
downloadmariadb-git-b76b2e68a15fe8ed3ee66d56ccb2812f02c57446.tar.gz
A few simple fixes plus the added support of being able to repair the meta data file via REPAIR TABLE. More information is now provided in SHOW TABLE STATUS.
mysql-test/r/archive.result: Added REPAIR TABLE test mysql-test/t/archive.test: Added REPAIR TABLE tests. sql/examples/ha_archive.cc: Added additional code to show more information during a SHOW TABLE STATUS. Curren size of the compressed file is now shown. Also added global "crashed" flag to mark when a table is crashed. Removed autorebuild during open table. Removed a few unneeded actions in OPTIMIZE TABLE. Fixed DBUG_ENTER for end_build_insert(). sql/examples/ha_archive.h: Added repair options
Diffstat (limited to 'sql/examples/ha_archive.h')
-rw-r--r--sql/examples/ha_archive.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/sql/examples/ha_archive.h b/sql/examples/ha_archive.h
index 809f52a883b..07bc7baa400 100644
--- a/sql/examples/ha_archive.h
+++ b/sql/examples/ha_archive.h
@@ -35,6 +35,7 @@ typedef struct st_archive_share {
File meta_file; /* Meta file we use */
gzFile archive_write; /* Archive file we are working with */
bool dirty; /* Flag for if a flush should occur */
+ bool crashed; /* Meta file is crashed */
ulonglong rows_recorded; /* Number of rows in tables */
} ARCHIVE_SHARE;
@@ -91,13 +92,14 @@ public:
int write_meta_file(File meta_file, ulonglong rows, bool dirty);
ARCHIVE_SHARE *get_share(const char *table_name, TABLE *table);
int free_share(ARCHIVE_SHARE *share);
- int rebuild_meta_file(char *table_name, File meta_file);
+ bool auto_repair() const { return 1; } // For the moment we just do this
int read_data_header(gzFile file_to_read);
int write_data_header(gzFile file_to_write);
void position(const byte *record);
void info(uint);
int create(const char *name, TABLE *form, HA_CREATE_INFO *create_info);
int optimize(THD* thd, HA_CHECK_OPT* check_opt);
+ int repair(THD* thd, HA_CHECK_OPT* check_opt);
void start_bulk_insert(ha_rows rows);
int end_bulk_insert();
THR_LOCK_DATA **store_lock(THD *thd, THR_LOCK_DATA **to,