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
7826fce2
Commit
7826fce2
authored
Sep 25, 2003
by
dlenev@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed BUG#1357 MySQL too eagerly cleanups temporary files for LOAD DATA (SQL_LOAD-...)
parent
b038a7c4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
7 deletions
+19
-7
sql/log_event.cc
sql/log_event.cc
+19
-7
No files found.
sql/log_event.cc
View file @
7826fce2
...
...
@@ -140,11 +140,6 @@ Log_event::Log_event()
/*
Delete all temporary files used for SQL_LOAD.
TODO
- When we get a 'server start' event, we should only remove
the files associated with the server id that just started.
Easily fixable by adding server_id as a prefix to the log files.
*/
static
void
cleanup_load_tmpdir
()
...
...
@@ -152,13 +147,30 @@ static void cleanup_load_tmpdir()
MY_DIR
*
dirp
;
FILEINFO
*
file
;
uint
i
;
char
fname
[
FN_REFLEN
];
char
prefbuf
[
31
];
char
*
p
;
if
(
!
(
dirp
=
my_dir
(
slave_load_tmpdir
,
MYF
(
MY_WME
))))
return
;
char
fname
[
FN_REFLEN
];
/*
When we are deleting temporary files, we should only remove
the files associated with the server id of our server.
We don't use event_server_id here because since we've disabled
direct binlogging of Create_file/Append_file/Exec_load events
we cannot meet Start_log event in the middle of events from one
LOAD DATA.
*/
p
=
strmake
(
prefbuf
,
"SQL_LOAD-"
,
9
);
p
=
int10_to_str
(
::
server_id
,
p
,
10
);
*
(
p
++
)
=
'-'
;
*
p
=
0
;
for
(
i
=
0
;
i
<
(
uint
)
dirp
->
number_off_files
;
i
++
)
{
file
=
dirp
->
dir_entry
+
i
;
if
(
is_prefix
(
file
->
name
,
"SQL_LOAD-"
))
if
(
is_prefix
(
file
->
name
,
prefbuf
))
{
fn_format
(
fname
,
file
->
name
,
slave_load_tmpdir
,
""
,
MY_UNPACK_FILENAME
);
my_delete
(
fname
,
MYF
(
0
));
...
...
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