summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMonty <monty@mariadb.org>2023-03-01 20:19:17 +0200
committerMonty <monty@mariadb.org>2023-03-02 13:11:54 +0200
commitbc3596fe129dc12977522243f92202609e06fdab (patch)
treef8af8fd7bde9b117eb18c7d7c2b2a20c07438b29
parentbd9ca2a0e3dfb00da226822cea53bb856e8393f0 (diff)
downloadmariadb-git-bc3596fe129dc12977522243f92202609e06fdab.tar.gz
MMAP does not work reliable on windows
This error was discovered while working on MDEV-30540 Wrong result with IN list length reaching IN_PREDICATE_CONVERSION_THRESHOLD Failing test: cte_recursive.test If one writes to a file, then truncates it and then call mmap() over the file_size + 7, then the file size changes to 7. (On Linux mmap() does not change file size). This caused _ma_read_rnd_dynamic_record() to believe that there are more records in the data file, which is not the case, and the table will be marked as corrupted. Fixed by disabling mmap() in Aria on Windows.
-rw-r--r--storage/maria/maria_def.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/storage/maria/maria_def.h b/storage/maria/maria_def.h
index f17edfe0657..dc164dfce14 100644
--- a/storage/maria/maria_def.h
+++ b/storage/maria/maria_def.h
@@ -43,6 +43,14 @@
C_MODE_START
+#ifdef _WIN32
+/*
+ We cannot use mmap() on Windows with Aria as mmap() can cause file
+ size to increase in _ma_dynmap_file(). The extra \0 data causes
+ the file to be regarded as corrupted.
+*/
+#undef HAVE_MMAP
+#endif
/*
Limit max keys according to HA_MAX_POSSIBLE_KEY; See myisamchk.h for details
*/