Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
78ccc605
Commit
78ccc605
authored
Nov 03, 2020
by
Olivier Bertrand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix compile error on LINUX (LARGE_INTEGER)
parent
28af4212
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
39 additions
and
17 deletions
+39
-17
storage/connect/filamap.cpp
storage/connect/filamap.cpp
+6
-2
storage/connect/filamvct.cpp
storage/connect/filamvct.cpp
+13
-5
storage/connect/jsonudf.cpp
storage/connect/jsonudf.cpp
+14
-5
storage/connect/maputil.cpp
storage/connect/maputil.cpp
+2
-2
storage/connect/maputil.h
storage/connect/maputil.h
+2
-1
storage/connect/xindex.cpp
storage/connect/xindex.cpp
+2
-2
No files found.
storage/connect/filamap.cpp
View file @
78ccc605
...
...
@@ -5,7 +5,7 @@
/* */
/* COPYRIGHT: */
/* ---------- */
/* (C) Copyright to the author Olivier BERTRAND 2005-20
17
*/
/* (C) Copyright to the author Olivier BERTRAND 2005-20
20
*/
/* */
/* WHAT THIS PROGRAM DOES: */
/* ----------------------- */
...
...
@@ -176,7 +176,11 @@ bool MAPFAM::OpenTableFile(PGLOBAL g)
/*******************************************************************/
/* Get the file size. */
/*******************************************************************/
len
=
(
size_t
)
mm
.
sz
.
QuadPart
;
len
=
(
size_t
)
mm
.
lenL
;
if
(
mm
.
lenH
)
len
+=
((
size_t
)
mm
.
lenH
*
0x000000001LL
);
Memory
=
(
char
*
)
mm
.
memory
;
if
(
!
len
)
{
// Empty or deleted file
...
...
storage/connect/filamvct.cpp
View file @
78ccc605
...
...
@@ -5,7 +5,7 @@
/* */
/* COPYRIGHT: */
/* ---------- */
/* (C) Copyright to the author Olivier BERTRAND 2005-20
17
*/
/* (C) Copyright to the author Olivier BERTRAND 2005-20
20
*/
/* */
/* WHAT THIS PROGRAM DOES: */
/* ----------------------- */
...
...
@@ -1423,8 +1423,12 @@ bool VCMFAM::OpenTableFile(PGLOBAL g)
/*******************************************************************/
/* Get the file size. */
/*******************************************************************/
len
=
(
size_t
)
mm
.
sz
.
QuadPart
;
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
);
...
...
@@ -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
=
(
size_t
)
mm
.
sz
.
QuadPart
;
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
);
...
...
storage/connect/jsonudf.cpp
View file @
78ccc605
...
...
@@ -1768,9 +1768,13 @@ static PJSON ParseJsonFile(PGLOBAL g, char *fn, int *pretty, size_t& len)
}
// endif hFile
/*******************************************************************************/
/* Get the file size
(assuming file is smaller than 4 GB)
*/
/* Get the file size
.
*/
/*******************************************************************************/
len
=
(
size_t
)
mm
.
sz
.
QuadPart
;
len
=
(
size_t
)
mm
.
lenL
;
if
(
mm
.
lenH
)
len
+=
((
size_t
)
mm
.
lenH
*
0x000000001LL
);
memory
=
(
char
*
)
mm
.
memory
;
if
(
!
len
)
{
// Empty or deleted file
...
...
@@ -6041,11 +6045,16 @@ char* JUP::UnprettyJsonFile(PGLOBAL g, char *fn, char *outfn, int lrecl) {
/*******************************************************************************/
/* Get the file size (assuming file is smaller than 4 GB) */
/*******************************************************************************/
if
(
!
mm
.
sz
.
QuadPart
)
{
// Empty or deleted file
if
(
!
mm
.
lenL
&&
!
mm
.
lenH
)
{
// Empty or deleted file
CloseFileHandle
(
hFile
);
return
NULL
;
}
else
len
=
(
size_t
)
mm
.
sz
.
QuadPart
;
}
else
{
len
=
(
size_t
)
mm
.
lenL
;
if
(
mm
.
lenH
)
len
+=
((
size_t
)
mm
.
lenH
*
0x000000001LL
);
}
// endif size
if
(
!
mm
.
memory
)
{
CloseFileHandle
(
hFile
);
...
...
storage/connect/maputil.cpp
View file @
78ccc605
...
...
@@ -90,8 +90,8 @@ HANDLE CreateFileMap(PGLOBAL g, LPCSTR filename,
return
INVALID_HANDLE_VALUE
;
}
// endif memory
//
HighPart
is the high-order word of the file size
mm
->
sz
.
LowPart
=
GetFileSize
(
hFile
,
(
LPDWORD
)
&
mm
->
sz
.
HighPart
);
//
lenH
is the high-order word of the file size
mm
->
lenL
=
GetFileSize
(
hFile
,
&
mm
->
lenH
);
CloseHandle
(
hFileMap
);
// Not used anymore
}
else
// MODE_INSERT
/*****************************************************************/
...
...
storage/connect/maputil.h
View file @
78ccc605
...
...
@@ -7,7 +7,8 @@ extern "C" {
typedef
struct
{
void
*
memory
;
LARGE_INTEGER
sz
;
DWORD
lenL
;
DWORD
lenH
;
}
MEMMAP
;
DllExport
HANDLE
CreateFileMap
(
PGLOBAL
,
LPCSTR
,
MEMMAP
*
,
MODE
,
bool
);
...
...
storage/connect/xindex.cpp
View file @
78ccc605
...
...
@@ -2471,7 +2471,7 @@ void XFILE::Close(void)
}
// endif Xfile
#if defined(XMAP)
if
(
Mmp
&&
CloseMemMap
(
Mmp
->
memory
,
(
size_t
)
Mmp
->
sz
.
QuadPart
))
if
(
Mmp
&&
CloseMemMap
(
Mmp
->
memory
,
Mmp
->
lenL
))
printf
(
"Error closing mapped index
\n
"
);
#endif // XMAP
}
// end of Close
...
...
@@ -2487,7 +2487,7 @@ void *XFILE::FileView(PGLOBAL g, char *fn)
Mmp
=
(
MMP
)
PlugSubAlloc
(
g
,
NULL
,
sizeof
(
MEMMAP
));
h
=
CreateFileMap
(
g
,
fn
,
Mmp
,
MODE_READ
,
false
);
if
(
h
==
INVALID_HANDLE_VALUE
||
(
!
Mmp
->
sz
.
QuadPart
))
{
if
(
h
==
INVALID_HANDLE_VALUE
||
(
!
Mmp
->
lenH
&&
!
Mmp
->
lenL
))
{
if
(
!
(
*
g
->
Message
))
strcpy
(
g
->
Message
,
MSG
(
FILE_MAP_ERR
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment