summaryrefslogtreecommitdiff
path: root/storage/myisam
diff options
context:
space:
mode:
authorSergey Vojtovich <svoj@sun.com>2010-02-12 16:30:04 +0400
committerSergey Vojtovich <svoj@sun.com>2010-02-12 16:30:04 +0400
commit55a3e3a0b0fb37db51bad838e9cdf6f4c6b86bb4 (patch)
treec16a358b03804d186cdff33a61f4155821eee96d /storage/myisam
parenta26ab94eb27827b3961464b97b50e63d98135c1e (diff)
downloadmariadb-git-55a3e3a0b0fb37db51bad838e9cdf6f4c6b86bb4.tar.gz
BUG#49628 - corrupt table after legal SQL, LONGTEXT column
Bulk REPLACE or bulk INSERT ... ON DUPLICATE KEY UPDATE may break dynamic record MyISAM table. The problem is limited to bulk REPLACE and INSERT ... ON DUPLICATE KEY UPDATE, because only these operations may be done via UPDATE internally and may request write cache. When flushing write cache, MyISAM may write remaining cached data at wrong position. Fixed by requesting write cache to seek to a correct position.
Diffstat (limited to 'storage/myisam')
-rw-r--r--storage/myisam/mi_dynrec.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/storage/myisam/mi_dynrec.c b/storage/myisam/mi_dynrec.c
index 696b9ff93df..6518d874f4f 100644
--- a/storage/myisam/mi_dynrec.c
+++ b/storage/myisam/mi_dynrec.c
@@ -933,8 +933,16 @@ static int update_dynamic_record(MI_INFO *info, my_off_t filepos, uchar *record,
}
if (block_info.next_filepos != HA_OFFSET_ERROR)
+ {
+ /*
+ delete_dynamic_record() may change data file position.
+ IO cache must be notified as it may still have cached
+ data, which has to be flushed later.
+ */
+ info->rec_cache.seek_not_done= 1;
if (delete_dynamic_record(info,block_info.next_filepos,1))
goto err;
+ }
DBUG_RETURN(0);
err:
DBUG_RETURN(1);