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
67bcb953
Commit
67bcb953
authored
Apr 04, 2006
by
msvensson@shellback.(none)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug#17368 General log and slow query log don't work
- Port ha_tina.cc to run on windows
parent
95242e71
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
18 deletions
+25
-18
include/my_sys.h
include/my_sys.h
+1
-0
mysys/my_mmap.c
mysys/my_mmap.c
+1
-4
storage/csv/ha_tina.cc
storage/csv/ha_tina.cc
+20
-11
storage/csv/ha_tina.h
storage/csv/ha_tina.h
+3
-3
No files found.
include/my_sys.h
View file @
67bcb953
...
@@ -850,6 +850,7 @@ my_bool my_gethwaddr(uchar *to);
...
@@ -850,6 +850,7 @@ my_bool my_gethwaddr(uchar *to);
#define PROT_WRITE 2
#define PROT_WRITE 2
#define MAP_NORESERVE 0
#define MAP_NORESERVE 0
#define MAP_SHARED 0x0001
#define MAP_SHARED 0x0001
#define MAP_PRIVATE 0x0002
#define MAP_NOSYNC 0x0800
#define MAP_NOSYNC 0x0800
#define MAP_FAILED ((void *)-1)
#define MAP_FAILED ((void *)-1)
#define MS_SYNC 0x0000
#define MS_SYNC 0x0000
...
...
mysys/my_mmap.c
View file @
67bcb953
...
@@ -43,22 +43,19 @@ int my_getpagesize(void)
...
@@ -43,22 +43,19 @@ int my_getpagesize(void)
void
*
my_mmap
(
void
*
addr
,
size_t
len
,
int
prot
,
void
*
my_mmap
(
void
*
addr
,
size_t
len
,
int
prot
,
int
flags
,
int
fd
,
my_off_t
offset
)
int
flags
,
int
fd
,
my_off_t
offset
)
{
{
DWORD
flProtect
=
0
;
HANDLE
hFileMap
;
HANDLE
hFileMap
;
LPVOID
ptr
;
LPVOID
ptr
;
HANDLE
hFile
=
(
HANDLE
)
_get_osfhandle
(
fd
);
HANDLE
hFile
=
(
HANDLE
)
_get_osfhandle
(
fd
);
if
(
hFile
==
INVALID_HANDLE_VALUE
)
if
(
hFile
==
INVALID_HANDLE_VALUE
)
return
MAP_FAILED
;
return
MAP_FAILED
;
flProtect
|=
SEC_COMMIT
;
hFileMap
=
CreateFileMapping
(
hFile
,
&
mmap_security_attributes
,
hFileMap
=
CreateFileMapping
(
hFile
,
&
mmap_security_attributes
,
PAGE_READWRITE
,
0
,
(
DWORD
)
len
,
NULL
);
PAGE_READWRITE
,
0
,
(
DWORD
)
len
,
NULL
);
if
(
hFileMap
==
0
)
if
(
hFileMap
==
0
)
return
MAP_FAILED
;
return
MAP_FAILED
;
ptr
=
MapViewOfFile
(
hFileMap
,
ptr
=
MapViewOfFile
(
hFileMap
,
flags
&
PROT_WRITE
?
FILE_MAP_WRITE
:
FILE_MAP_READ
,
prot
&
PROT_WRITE
?
FILE_MAP_WRITE
:
FILE_MAP_READ
,
(
DWORD
)(
offset
>>
32
),
(
DWORD
)
offset
,
len
);
(
DWORD
)(
offset
>>
32
),
(
DWORD
)
offset
,
len
);
/*
/*
...
...
storage/csv/ha_tina.cc
View file @
67bcb953
...
@@ -49,7 +49,6 @@
...
@@ -49,7 +49,6 @@
#include "mysql_priv.h"
#include "mysql_priv.h"
#include "ha_tina.h"
#include "ha_tina.h"
#include <sys/mman.h>
#include <mysql/plugin.h>
#include <mysql/plugin.h>
...
@@ -143,7 +142,7 @@ int get_mmap(TINA_SHARE *share, int write)
...
@@ -143,7 +142,7 @@ int get_mmap(TINA_SHARE *share, int write)
share
->
mapped_file
=
(
byte
*
)
my_mmap
(
NULL
,
share
->
file_stat
.
st_size
,
share
->
mapped_file
=
(
byte
*
)
my_mmap
(
NULL
,
share
->
file_stat
.
st_size
,
PROT_READ
,
MAP_PRIVATE
,
PROT_READ
,
MAP_PRIVATE
,
share
->
data_file
,
0
);
share
->
data_file
,
0
);
if
((
share
->
mapped_file
==
(
caddr_t
)
-
1
))
if
((
share
->
mapped_file
==
MAP_FAILED
))
{
{
/*
/*
Bad idea you think? See the problem is that nothing actually checks
Bad idea you think? See the problem is that nothing actually checks
...
@@ -331,7 +330,7 @@ ha_tina::ha_tina(TABLE_SHARE *table_arg)
...
@@ -331,7 +330,7 @@ ha_tina::ha_tina(TABLE_SHARE *table_arg)
records_is_known
(
0
)
records_is_known
(
0
)
{
{
/* Set our original buffers from pre-allocated memory */
/* Set our original buffers from pre-allocated memory */
buffer
.
set
(
byte_buffer
,
IO_SIZE
,
system_charset_info
);
buffer
.
set
(
(
char
*
)
byte_buffer
,
IO_SIZE
,
system_charset_info
);
chain
=
chain_buffer
;
chain
=
chain_buffer
;
}
}
...
@@ -688,7 +687,8 @@ int ha_tina::write_row(byte * buf)
...
@@ -688,7 +687,8 @@ int ha_tina::write_row(byte * buf)
size
=
encode_quote
(
buf
);
size
=
encode_quote
(
buf
);
if
(
my_write
(
share
->
data_file
,
buffer
.
ptr
(),
size
,
MYF
(
MY_WME
|
MY_NABP
)))
if
(
my_write
(
share
->
data_file
,
(
byte
*
)
buffer
.
ptr
(),
size
,
MYF
(
MY_WME
|
MY_NABP
)))
DBUG_RETURN
(
-
1
);
DBUG_RETURN
(
-
1
);
/*
/*
...
@@ -740,7 +740,8 @@ int ha_tina::update_row(const byte * old_data, byte * new_data)
...
@@ -740,7 +740,8 @@ int ha_tina::update_row(const byte * old_data, byte * new_data)
if
(
chain_append
())
if
(
chain_append
())
DBUG_RETURN
(
-
1
);
DBUG_RETURN
(
-
1
);
if
(
my_write
(
share
->
data_file
,
buffer
.
ptr
(),
size
,
MYF
(
MY_WME
|
MY_NABP
)))
if
(
my_write
(
share
->
data_file
,
(
byte
*
)
buffer
.
ptr
(),
size
,
MYF
(
MY_WME
|
MY_NABP
)))
DBUG_RETURN
(
-
1
);
DBUG_RETURN
(
-
1
);
/* UPDATE should never happen on the log tables */
/* UPDATE should never happen on the log tables */
...
@@ -934,7 +935,7 @@ int ha_tina::rnd_end()
...
@@ -934,7 +935,7 @@ int ha_tina::rnd_end()
if
((
chain_ptr
-
chain
)
>
0
)
if
((
chain_ptr
-
chain
)
>
0
)
{
{
tina_set
*
ptr
;
tina_set
*
ptr
;
off
_t
length
;
size
_t
length
;
/*
/*
Setting up writable map, this will contain all of the data after the
Setting up writable map, this will contain all of the data after the
...
@@ -958,15 +959,16 @@ int ha_tina::rnd_end()
...
@@ -958,15 +959,16 @@ int ha_tina::rnd_end()
length
=
length
-
(
size_t
)(
ptr
->
end
-
ptr
->
begin
);
length
=
length
-
(
size_t
)(
ptr
->
end
-
ptr
->
begin
);
}
}
/*
Truncate the file to the new size
*/
/*
Unmap the file before the new size is set
*/
if
(
my_
chsize
(
share
->
data_file
,
length
,
0
,
MYF
(
MY_WME
)
))
if
(
my_
munmap
(
share
->
mapped_file
,
share
->
file_stat
.
st_size
))
DBUG_RETURN
(
-
1
);
DBUG_RETURN
(
-
1
);
/* We set it to null so that get_mmap() won't try to unmap it */
share
->
mapped_file
=
NULL
;
if
(
my_munmap
(
share
->
mapped_file
,
length
))
/* Set the file to the new size */
if
(
my_chsize
(
share
->
data_file
,
length
,
0
,
MYF
(
MY_WME
)))
DBUG_RETURN
(
-
1
);
DBUG_RETURN
(
-
1
);
/* We set it to null so that get_mmap() won't try to unmap it */
share
->
mapped_file
=
NULL
;
if
(
get_mmap
(
share
,
0
)
>
0
)
if
(
get_mmap
(
share
,
0
)
>
0
)
DBUG_RETURN
(
-
1
);
DBUG_RETURN
(
-
1
);
}
}
...
@@ -986,6 +988,13 @@ int ha_tina::delete_all_rows()
...
@@ -986,6 +988,13 @@ int ha_tina::delete_all_rows()
if
(
!
records_is_known
)
if
(
!
records_is_known
)
return
(
my_errno
=
HA_ERR_WRONG_COMMAND
);
return
(
my_errno
=
HA_ERR_WRONG_COMMAND
);
/* Unmap the file before the new size is set */
if
(
share
->
mapped_file
&&
my_munmap
(
share
->
mapped_file
,
share
->
file_stat
.
st_size
))
DBUG_RETURN
(
-
1
);
share
->
mapped_file
=
NULL
;
/* Truncate the file to zero size */
int
rc
=
my_chsize
(
share
->
data_file
,
0
,
0
,
MYF
(
MY_WME
));
int
rc
=
my_chsize
(
share
->
data_file
,
0
,
0
,
MYF
(
MY_WME
));
if
(
get_mmap
(
share
,
0
)
>
0
)
if
(
get_mmap
(
share
,
0
)
>
0
)
...
...
storage/csv/ha_tina.h
View file @
67bcb953
...
@@ -41,9 +41,9 @@ typedef struct st_tina_share {
...
@@ -41,9 +41,9 @@ typedef struct st_tina_share {
THR_LOCK
lock
;
THR_LOCK
lock
;
}
TINA_SHARE
;
}
TINA_SHARE
;
typedef
struct
tina_set
{
struct
tina_set
{
off_t
begin
;
off_t
begin
;
off_t
end
;
off_t
end
;
};
};
class
ha_tina
:
public
handler
class
ha_tina
:
public
handler
...
...
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