diff options
author | unknown <ramil/ram@mysql.com/ramil.myoffice.izhnet.ru> | 2007-07-14 00:13:37 +0500 |
---|---|---|
committer | unknown <ramil/ram@mysql.com/ramil.myoffice.izhnet.ru> | 2007-07-14 00:13:37 +0500 |
commit | e4b46e7af637b6b7b2fe0573f4885904aa6b495d (patch) | |
tree | 80872a77ca2c021ab85ffc98dd27b96c1b145db2 /storage/csv/ha_tina.h | |
parent | 43d2564820b7c3c23e7aedbc59831ff37e9069ed (diff) | |
download | mariadb-git-e4b46e7af637b6b7b2fe0573f4885904aa6b495d.tar.gz |
Fix for bug #29253: csv table reportedly marked as crashed
Problem: the data file changes made during delete/update are not visible to
other threads as the file is reopened, so reading data
with old descriptors might miss the changes.
Fix: reopen the data file before reading if it was reopened during
delete/update to ensure there's no data behind.
Note: there's no simple test case.
storage/csv/ha_tina.cc:
Fix for bug #29253: csv table reportedly marked as crashed
- use the data file version technic to ensure we always see changes
made by other threads:
a) increase share->data_file_version each time we reopen the data
file, i.e. at the end of update/delete.
b) compare the local data file version with the shared one each time
we want to read data, reopen it if they differ.
storage/csv/ha_tina.h:
Fix for bug #29253: csv table reportedly marked as crashed
- use the data file version technic to ensure we always see changes
made by other threads:
a) increase share->data_file_version each time we reopen the data
file, i.e. at the end og update/delete.
b) compare the local data file version with shared one each time
we want to read data, reopen it if they differ.
Diffstat (limited to 'storage/csv/ha_tina.h')
-rw-r--r-- | storage/csv/ha_tina.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/storage/csv/ha_tina.h b/storage/csv/ha_tina.h index 2e43f1a2307..5bb3e9a79a0 100644 --- a/storage/csv/ha_tina.h +++ b/storage/csv/ha_tina.h @@ -49,6 +49,7 @@ typedef struct st_tina_share { File tina_write_filedes; /* File handler for readers */ bool crashed; /* Meta file is crashed */ ha_rows rows_recorded; /* Number of rows in tables */ + uint data_file_version; /* Version of the data file used */ } TINA_SHARE; struct tina_set { @@ -79,12 +80,14 @@ class ha_tina: public handler tina_set *chain_ptr; uchar chain_alloced; uint32 chain_size; + uint local_data_file_version; /* Saved version of the data file used */ bool records_is_known; private: bool get_write_pos(off_t *end_pos, tina_set *closest_hole); int open_update_temp_file_if_needed(); int init_tina_writer(); + int init_data_file(); public: ha_tina(handlerton *hton, TABLE_SHARE *table_arg); |