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
60e1175e
Commit
60e1175e
authored
Oct 07, 2002
by
nick@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
touchup to last fix
parent
20433597
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
32 deletions
+34
-32
sql/log.cc
sql/log.cc
+34
-32
No files found.
sql/log.cc
View file @
60e1175e
...
...
@@ -513,44 +513,46 @@ bool MYSQL_LOG::is_active(const char* log_file_name)
void
MYSQL_LOG
::
new_file
(
bool
inside_mutex
)
{
if
(
!
is_open
())
return
;
if
(
!
inside_mutex
)
VOID
(
pthread_mutex_lock
(
&
LOCK_log
));
if
(
is_open
())
{
char
new_name
[
FN_REFLEN
],
*
old_name
=
name
;
char
new_name
[
FN_REFLEN
],
*
old_name
=
name
;
if
(
!
no_rotate
)
if
(
!
no_rotate
)
{
/*
only rotate open logs that are marked non-rotatable
(binlog with constant name are non-rotatable)
*/
if
(
generate_new_name
(
new_name
,
name
))
{
if
(
!
inside_mutex
)
VOID
(
pthread_mutex_unlock
(
&
LOCK_log
));
return
;
// Something went wrong
}
if
(
log_type
==
LOG_BIN
)
{
/*
only rotate open logs that are marked non-rotatabl
e
(binlog with constant name are non-rotatable)
We log the whole file name for log file as the user may decid
e
to change base names at some point.
*/
if
(
generate_new_name
(
new_name
,
name
))
{
if
(
!
inside_mutex
)
VOID
(
pthread_mutex_unlock
(
&
LOCK_log
));
return
;
// Something went wrong
}
if
(
log_type
==
LOG_BIN
)
{
/*
We log the whole file name for log file as the user may decide
to change base names at some point.
*/
Rotate_log_event
r
(
new_name
+
dirname_length
(
new_name
));
r
.
write
(
&
log_file
);
VOID
(
pthread_cond_broadcast
(
&
COND_binlog_update
));
}
Rotate_log_event
r
(
new_name
+
dirname_length
(
new_name
));
r
.
write
(
&
log_file
);
VOID
(
pthread_cond_broadcast
(
&
COND_binlog_update
));
}
else
strmov
(
new_name
,
old_name
);
// Reopen old file name
name
=
0
;
close
();
open
(
old_name
,
log_type
,
new_name
);
my_free
(
old_name
,
MYF
(
0
));
last_time
=
query_start
=
0
;
write_error
=
0
;
}
else
strmov
(
new_name
,
old_name
);
// Reopen old file name
name
=
0
;
close
();
open
(
old_name
,
log_type
,
new_name
);
my_free
(
old_name
,
MYF
(
0
));
last_time
=
query_start
=
0
;
write_error
=
0
;
if
(
!
inside_mutex
)
VOID
(
pthread_mutex_unlock
(
&
LOCK_log
));
}
...
...
@@ -564,8 +566,8 @@ bool MYSQL_LOG::write(THD *thd,enum enum_server_command command,
int
error
=
0
;
VOID
(
pthread_mutex_lock
(
&
LOCK_log
));
/* Test if someone closed
after the is_open test
*/
if
(
log_type
!=
LOG_CLOSED
)
/* Test if someone closed
between the is_open test and lock
*/
if
(
is_open
()
)
{
time_t
skr
;
ulong
id
;
...
...
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