diff options
author | Oleksandr Byelkin <sanja@mariadb.com> | 2021-02-16 14:56:59 +0100 |
---|---|---|
committer | Oleksandr Byelkin <sanja@mariadb.com> | 2021-02-16 14:56:59 +0100 |
commit | e0072fadcb00edae74e748aee3148075b9cddae2 (patch) | |
tree | 625d5c0869cfbb322a2b4cdaab453e17fd5d31bf /storage/connect/filamvct.cpp | |
parent | 1146e98b3af3e2b15df0598a860f4571663a98d0 (diff) | |
parent | ae7989ca2059869f81c837509e5ff554f7f63562 (diff) | |
download | mariadb-git-10.6-halfmerge.tar.gz |
Merge branch 'bb-10.5-release' into bb-10.6-release10.6-halfmerge
Diffstat (limited to 'storage/connect/filamvct.cpp')
-rw-r--r-- | storage/connect/filamvct.cpp | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/storage/connect/filamvct.cpp b/storage/connect/filamvct.cpp index 20205e0a8cf..9b1e5d7689e 100644 --- a/storage/connect/filamvct.cpp +++ b/storage/connect/filamvct.cpp @@ -5,7 +5,7 @@ /* */ /* COPYRIGHT: */ /* ---------- */ -/* (C) Copyright to the author Olivier BERTRAND 2005-2017 */ +/* (C) Copyright to the author Olivier BERTRAND 2005-2020 */ /* */ /* WHAT THIS PROGRAM DOES: */ /* ----------------------- */ @@ -1327,7 +1327,7 @@ VCMFAM::VCMFAM(PVCMFAM txfp) : VCTFAM(txfp) bool VCMFAM::OpenTableFile(PGLOBAL g) { char filename[_MAX_PATH]; - int len; + size_t len; MODE mode = Tdbp->GetMode(); PFBLOCK fp = NULL; PDBUSER dbuserp = (PDBUSER)g->Activityp->Aptr; @@ -1421,10 +1421,14 @@ bool VCMFAM::OpenTableFile(PGLOBAL g) } // endif hFile /*******************************************************************/ - /* Get the file size (assuming file is smaller than 4 GB) */ + /* Get the file size. */ /*******************************************************************/ - len = mm.lenL; - Memory = (char *)mm.memory; + len = (size_t)mm.lenL; + + if (mm.lenH) + len += ((size_t)mm.lenH * 0x000000001LL); + + Memory = (char *)mm.memory; if (!len) { // Empty or deleted file CloseFileHandle(hFile); @@ -2762,7 +2766,7 @@ bool VMPFAM::OpenTableFile(PGLOBAL g) bool VMPFAM::MapColumnFile(PGLOBAL g, MODE mode, int i) { char filename[_MAX_PATH]; - int len; + size_t len; HANDLE hFile; MEMMAP mm; PFBLOCK fp; @@ -2816,8 +2820,12 @@ bool VMPFAM::MapColumnFile(PGLOBAL g, MODE mode, int i) /*****************************************************************/ /* Get the file size (assuming file is smaller than 4 GB) */ /*****************************************************************/ - len = mm.lenL; - Memcol[i] = (char *)mm.memory; + len = (size_t)mm.lenL; + + if (mm.lenH) + len += ((size_t)mm.lenH * 0x000000001LL); + + Memcol[i] = (char *)mm.memory; if (!len) { // Empty or deleted file CloseFileHandle(hFile); |