diff options
author | unknown <brian@zim.(none)> | 2006-12-02 00:30:49 -0800 |
---|---|---|
committer | unknown <brian@zim.(none)> | 2006-12-02 00:30:49 -0800 |
commit | ccf4a137bee9ba6b1ed64d91c02413412ae38fad (patch) | |
tree | f3d07edfdb01555184f11497dc90f7d3d0211043 /storage/archive/ha_archive.h | |
parent | dd7e49e0197f78051250ef1b4465c836dc068525 (diff) | |
download | mariadb-git-ccf4a137bee9ba6b1ed64d91c02413412ae38fad.tar.gz |
Formailized the row buffer structure, implemented new streaming format.
mysql-test/r/archive.result:
Added cleanup for additional tables
mysql-test/t/archive.test:
Added cleanup for additional tables.
storage/archive/ha_archive.cc:
Rows are now proceeded with length. Added new record buffer structure and methods.
storage/archive/ha_archive.h:
New structure for buffer
Diffstat (limited to 'storage/archive/ha_archive.h')
-rw-r--r-- | storage/archive/ha_archive.h | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/storage/archive/ha_archive.h b/storage/archive/ha_archive.h index 75ca29e640a..2e2e7a114f1 100644 --- a/storage/archive/ha_archive.h +++ b/storage/archive/ha_archive.h @@ -27,6 +27,12 @@ ha_example.h. */ +typedef struct st_archive_record_buffer { + byte *buffer; + int length; +} archive_record_buffer; + + typedef struct st_archive_share { char *table_name; char data_file_name[FN_REFLEN]; @@ -43,18 +49,23 @@ typedef struct st_archive_share { ulonglong forced_flushes; ulonglong mean_rec_length; char real_path[FN_REFLEN]; + uint meta_version; + uint data_version; } ARCHIVE_SHARE; /* Version for file format. - 1 - Initial Version + 1 - Initial Version (Never Released) + 2 - Stream Compression, seperate blobs, no packing + 3 - One steam (row and blobs), with packing */ -#define ARCHIVE_VERSION 2 +#define ARCHIVE_VERSION 3 class ha_archive: public handler { THR_LOCK_DATA lock; /* MySQL lock */ ARCHIVE_SHARE *share; /* Shared lock info */ + azio_stream archive; /* Archive file we are working with */ my_off_t current_position; /* The position of the row we just read */ byte byte_buffer[IO_SIZE]; /* Initial buffer for our string */ @@ -65,6 +76,10 @@ class ha_archive: public handler const byte *current_key; uint current_key_len; uint current_k_offset; + archive_record_buffer *record_buffer; + + archive_record_buffer *create_record_buffer(ulonglong length); + void destroy_record_buffer(archive_record_buffer *r); public: ha_archive(handlerton *hton, TABLE_SHARE *table_arg); @@ -105,7 +120,10 @@ public: int rnd_next(byte *buf); int rnd_pos(byte * buf, byte *pos); int get_row(azio_stream *file_to_read, byte *buf); + int get_row_version2(azio_stream *file_to_read, byte *buf); + int get_row_version3(azio_stream *file_to_read, byte *buf); int read_meta_file(File meta_file, ha_rows *rows, + uint *meta_version, ulonglong *auto_increment, ulonglong *forced_flushes, char *real_path); @@ -137,5 +155,9 @@ public: bool is_crashed() const; int check(THD* thd, HA_CHECK_OPT* check_opt); bool check_and_repair(THD *thd); + int max_row_length(const byte *buf); + bool fix_rec_buff(int length); + int unpack_row(azio_stream *file_to_read, char *record); + int pack_row(const byte *record); }; |