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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
a804f28c
Commit
a804f28c
authored
Mar 28, 2013
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Fixing Linux index compile errors
modified: storage/connect/xindex.cpp
parent
0dc6f5aa
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
10 deletions
+9
-10
storage/connect/xindex.cpp
storage/connect/xindex.cpp
+9
-10
No files found.
storage/connect/xindex.cpp
View file @
a804f28c
...
@@ -2389,7 +2389,6 @@ void *XFILE::FileView(PGLOBAL g, char *fn, int loff, int hoff, int size)
...
@@ -2389,7 +2389,6 @@ void *XFILE::FileView(PGLOBAL g, char *fn, int loff, int hoff, int size)
/***********************************************************************/
/***********************************************************************/
bool
XHUGE
::
Open
(
PGLOBAL
g
,
char
*
filename
,
int
id
,
MODE
mode
)
bool
XHUGE
::
Open
(
PGLOBAL
g
,
char
*
filename
,
int
id
,
MODE
mode
)
{
{
DWORD
drc
,
rc
;
IOFF
noff
[
MAX_INDX
];
IOFF
noff
[
MAX_INDX
];
if
(
Hfile
!=
INVALID_HANDLE_VALUE
)
{
if
(
Hfile
!=
INVALID_HANDLE_VALUE
)
{
...
@@ -2403,7 +2402,7 @@ bool XHUGE::Open(PGLOBAL g, char *filename, int id, MODE mode)
...
@@ -2403,7 +2402,7 @@ bool XHUGE::Open(PGLOBAL g, char *filename, int id, MODE mode)
#if defined(WIN32)
#if defined(WIN32)
LONG
high
=
0
;
LONG
high
=
0
;
DWORD
access
,
share
,
creation
;
DWORD
rc
,
drc
,
access
,
share
,
creation
;
/*********************************************************************/
/*********************************************************************/
/* Create the file object according to access mode */
/* Create the file object according to access mode */
...
@@ -2534,7 +2533,7 @@ bool XHUGE::Open(PGLOBAL g, char *filename, int id, MODE mode)
...
@@ -2534,7 +2533,7 @@ bool XHUGE::Open(PGLOBAL g, char *filename, int id, MODE mode)
/*******************************************************************/
/*******************************************************************/
/* Position the cursor at end of file so ftell returns file size. */
/* Position the cursor at end of file so ftell returns file size. */
/*******************************************************************/
/*******************************************************************/
if
(
!
(
Offset
.
Val
=
(
longlong
)
lseek64
(
Hfile
,
0LL
,
SEEK_END
)))
{
if
(
!
(
NewOff
.
Val
=
(
longlong
)
lseek64
(
Hfile
,
0LL
,
SEEK_END
)))
{
sprintf
(
g
->
Message
,
MSG
(
FUNC_ERRNO
),
errno
,
"Seek"
);
sprintf
(
g
->
Message
,
MSG
(
FUNC_ERRNO
),
errno
,
"Seek"
);
return
true
;
return
true
;
}
// endif
}
// endif
...
@@ -2543,8 +2542,7 @@ bool XHUGE::Open(PGLOBAL g, char *filename, int id, MODE mode)
...
@@ -2543,8 +2542,7 @@ bool XHUGE::Open(PGLOBAL g, char *filename, int id, MODE mode)
if
(
id
>=
0
)
{
if
(
id
>=
0
)
{
// New not sep index file. Write the header.
// New not sep index file. Write the header.
memset
(
noff
,
0
,
sizeof
(
noff
));
memset
(
noff
,
0
,
sizeof
(
noff
));
Write
(
g
,
noff
,
sizeof
(
IOFF
),
MAX_INDX
,
rc
);
NewOff
.
Low
=
write
(
Hfile
,
&
noff
,
sizeof
(
noff
));
Offset
.
Val
=
(
longlong
)(
sizeof
(
IOFF
)
*
MAX_INDX
);
}
// endif id
}
// endif id
}
else
if
(
mode
==
MODE_READ
&&
id
>=
0
)
{
}
else
if
(
mode
==
MODE_READ
&&
id
>=
0
)
{
...
@@ -2733,21 +2731,22 @@ void XHUGE::Close(char *fn, int id)
...
@@ -2733,21 +2731,22 @@ void XHUGE::Close(char *fn, int id)
CloseFileHandle
(
Hfile
);
CloseFileHandle
(
Hfile
);
Hfile
=
CreateFile
(
fn
,
GENERIC_READ
|
GENERIC_WRITE
,
0
,
NULL
,
Hfile
=
CreateFile
(
fn
,
GENERIC_READ
|
GENERIC_WRITE
,
0
,
NULL
,
OPEN_EXISTING
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
OPEN_EXISTING
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
if
(
Hfile
!=
INVALID_HANDLE_VALUE
)
if
(
Hfile
!=
INVALID_HANDLE_VALUE
)
if
(
SetFilePointer
(
Hfile
,
id
*
sizeof
(
IOFF
),
NULL
,
FILE_BEGIN
)
if
(
SetFilePointer
(
Hfile
,
id
*
sizeof
(
IOFF
),
NULL
,
FILE_BEGIN
)
!=
INVALID_SET_FILE_POINTER
)
{
!=
INVALID_SET_FILE_POINTER
)
{
DWORD
nbw
;
DWORD
nbw
;
WriteFile
(
Hfile
,
&
NewOff
,
sizeof
(
longlong
),
&
nbw
,
NULL
);
WriteFile
(
Hfile
,
&
NewOff
,
sizeof
(
IOFF
),
&
nbw
,
NULL
);
// WriteFile(Hfile, &Newhigh, sizeof(int), &nbw, NULL);
}
// endif SetFilePointer
}
// endif SetFilePointer
}
// endif id
}
// endif id
#else // !WIN32
#else // !WIN32
if
(
id
>=
0
&&
fn
)
{
if
(
id
>=
0
&&
fn
)
{
fnctl
(
Hfile
,
F_SETFD
,
O_WRONLY
);
fcntl
(
Hfile
,
F_SETFD
,
O_WRONLY
);
if
(
lseek
(
Hfile
,
id
*
sizeof
(
IOFF
),
SEEK_SET
))
if
(
lseek
(
Hfile
,
id
*
sizeof
(
IOFF
),
SEEK_SET
))
write
(
Hfile
,
&
noff
[
id
]
,
sizeof
(
IOFF
));
write
(
Hfile
,
&
NewOff
,
sizeof
(
IOFF
));
}
// endif id
}
// endif id
#endif // !WIN32
#endif // !WIN32
...
...
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