diff options
author | unknown <serg@janus.mylan> | 2007-07-04 22:27:58 +0200 |
---|---|---|
committer | unknown <serg@janus.mylan> | 2007-07-04 22:27:58 +0200 |
commit | fcdc76c28952608524d6e5a388bc7b04ad8de09f (patch) | |
tree | e561d554668cb480f1eb87c4430151f7cce55469 /storage/csv | |
parent | 329ba0d46237d606664a0df8eb94c8d12621d237 (diff) | |
download | mariadb-git-fcdc76c28952608524d6e5a388bc7b04ad8de09f.tar.gz |
in mysql_unlock_tables(), do thr_unlock() AFTER external_unlock().
it means, {update,restore}_status() should be called in external_lock,
not in thr_unlock. Only affects storage engines that support
TL_WRITE_CONCURRENT.
Diffstat (limited to 'storage/csv')
-rw-r--r-- | storage/csv/ha_tina.cc | 12 | ||||
-rw-r--r-- | storage/csv/ha_tina.h | 4 |
2 files changed, 14 insertions, 2 deletions
diff --git a/storage/csv/ha_tina.cc b/storage/csv/ha_tina.cc index afe8e5f1b27..6dacc8f2663 100644 --- a/storage/csv/ha_tina.cc +++ b/storage/csv/ha_tina.cc @@ -441,7 +441,7 @@ ha_tina::ha_tina(handlerton *hton, TABLE_SHARE *table_arg) */ current_position(0), next_position(0), local_saved_data_file_length(0), file_buff(0), chain_alloced(0), chain_size(DEFAULT_CHAIN_LENGTH), - records_is_known(0) + records_is_known(0), curr_lock_type(F_UNLCK) { /* Set our original buffers from pre-allocated memory */ buffer.set((char*)byte_buffer, IO_SIZE, system_charset_info); @@ -1394,6 +1394,14 @@ int ha_tina::delete_all_rows() DBUG_RETURN(rc); } +int ha_tina::external_lock(THD *thd __attribute__((unused)), int lock_type) +{ + if (lock_type==F_UNLCK && curr_lock_type == F_WRLCK) + update_status(); + curr_lock_type= lock_type; + return 0; +} + /* Called by the database to lock the table. Keep in mind that this is an internal lock. @@ -1408,7 +1416,7 @@ THR_LOCK_DATA **ha_tina::store_lock(THD *thd, return to; } -/* +/* Create a table. You do not want to leave the table open after a call to this (the database will call ::open() if it needs to). */ diff --git a/storage/csv/ha_tina.h b/storage/csv/ha_tina.h index 0c667237c0f..e52e9cd28e5 100644 --- a/storage/csv/ha_tina.h +++ b/storage/csv/ha_tina.h @@ -81,6 +81,8 @@ class ha_tina: public handler bool records_is_known; private: + int curr_lock_type; + bool get_write_pos(off_t *end_pos, tina_set *closest_hole); int open_update_temp_file_if_needed(); int init_tina_writer(); @@ -153,6 +155,8 @@ public: bool check_if_incompatible_data(HA_CREATE_INFO *info, uint table_changes); + int external_lock(THD *thd, int lock_type); + THR_LOCK_DATA **store_lock(THD *thd, THR_LOCK_DATA **to, enum thr_lock_type lock_type); |