mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
- Fix a test failure. Due to mmap on void file being accepted on Windows
while returning an error on Linux. Now accepted on linux. modified: storage/connect/maputil.cpp - Fix a BUG in the XHUGE class. lseek64 was wrongly regarded as in error when returning 0 instead of -1. This produced wrong index files. modified: storage/connect/filamfix.cpp storage/connect/maputil.cpp storage/connect/xindex.cpp - Fix length mismatch (tab instead of blanks?) modified: storage/connect/mysql-test/connect/r/updelx.result
This commit is contained in:
@@ -154,7 +154,7 @@ HANDLE CreateFileMap(PGLOBAL g, LPCSTR fileName,
|
||||
} // endswitch
|
||||
|
||||
// Try to open the addressed file.
|
||||
fd= global_open(g, MSGID_NONE, fileName, openMode);
|
||||
fd= global_open(g, MSGID_NONE, fileName, openMode);
|
||||
|
||||
if (fd != INVALID_HANDLE_VALUE && mode != MODE_INSERT) {
|
||||
/* We must know about the size of the file. */
|
||||
@@ -164,17 +164,19 @@ HANDLE CreateFileMap(PGLOBAL g, LPCSTR fileName,
|
||||
return INVALID_HANDLE_VALUE;
|
||||
} // endif fstat
|
||||
|
||||
filesize = st.st_size;
|
||||
|
||||
// Now we are ready to load the file. If mmap() is available we try
|
||||
// this first. If not available or it failed we try to load it.
|
||||
mm->memory = mmap(NULL, filesize, protmode, MAP_SHARED, fd, 0);
|
||||
if ((filesize = st.st_size))
|
||||
// Now we are ready to load the file. If mmap() is available we try
|
||||
// this first. If not available or it failed we try to load it.
|
||||
mm->memory = mmap(NULL, filesize, protmode, MAP_SHARED, fd, 0);
|
||||
else
|
||||
mm->memory = 0;
|
||||
|
||||
if (mm->memory != MAP_FAILED) {
|
||||
mm->lenL = (mm->memory != 0) ? filesize : 0;
|
||||
mm->lenH = 0;
|
||||
} else {
|
||||
strcpy(g->Message, "Memory mapping failed");
|
||||
close(fd);
|
||||
return INVALID_HANDLE_VALUE;
|
||||
} // endif memory
|
||||
|
||||
|
Reference in New Issue
Block a user