summaryrefslogtreecommitdiff
path: root/storage/csv
diff options
context:
space:
mode:
authorMikael Ronstrom <mikael@mysql.com>2009-02-17 13:24:09 +0100
committerMikael Ronstrom <mikael@mysql.com>2009-02-17 13:24:09 +0100
commit6db314c628b103b7c4d7fc0ba4c21eda6e6a349e (patch)
tree8414a0bf16f74515368a6a4ebc7ea528e8f982a2 /storage/csv
parent805e8ffb9ec3ae7b9353d65f33e4eb20284876ae (diff)
parent6bd93f670271eaf2bd79bd7fa538e9baaa7dcb0f (diff)
downloadmariadb-git-6db314c628b103b7c4d7fc0ba4c21eda6e6a349e.tar.gz
Merged Performance Version 0.2.1 with latest 5.1 tree (last push 11 feb 14.01.13 2009)
Diffstat (limited to 'storage/csv')
-rw-r--r--storage/csv/ha_tina.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/storage/csv/ha_tina.cc b/storage/csv/ha_tina.cc
index cc801b33955..e40c2db77db 100644
--- a/storage/csv/ha_tina.cc
+++ b/storage/csv/ha_tina.cc
@@ -1456,6 +1456,17 @@ int ha_tina::repair(THD* thd, HA_CHECK_OPT* check_opt)
a file, which descriptor is still open. EACCES will be returned
when trying to delete the "to"-file in my_rename().
*/
+ if (share->tina_write_opened)
+ {
+ /*
+ Data file might be opened twice, on table opening stage and
+ during write_row execution. We need to close both instances
+ to satisfy Win.
+ */
+ if (my_close(share->tina_write_filedes, MYF(0)))
+ DBUG_RETURN(my_errno ? my_errno : -1);
+ share->tina_write_opened= FALSE;
+ }
if (my_close(data_file,MYF(0)) || my_close(repair_file, MYF(0)) ||
my_rename(repaired_fname, share->data_file_name, MYF(0)))
DBUG_RETURN(-1);