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
263f249a
Commit
263f249a
authored
Jan 06, 2005
by
guilhem@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge gbichot@bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/home/mysql_src/mysql-4.1-clean
parents
54f0a85b
60f5a691
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
6 deletions
+22
-6
sql/log.cc
sql/log.cc
+18
-4
sql/mysqld.cc
sql/mysqld.cc
+4
-2
No files found.
sql/log.cc
View file @
263f249a
...
...
@@ -255,7 +255,9 @@ bool MYSQL_LOG::open(const char *log_name, enum_log_type log_type_arg,
if
((
file
=
my_open
(
log_file_name
,
open_flags
,
MYF
(
MY_WME
|
ME_WAITTANG
)))
<
0
||
init_io_cache
(
&
log_file
,
file
,
IO_SIZE
,
io_cache_type
,
my_tell
(
file
,
MYF
(
MY_WME
)),
0
,
MYF
(
MY_WME
|
MY_NABP
)))
my_tell
(
file
,
MYF
(
MY_WME
)),
0
,
MYF
(
MY_WME
|
MY_NABP
|
((
log_type
==
LOG_BIN
)
?
MY_WAIT_IF_FULL
:
0
))))
goto
err
;
switch
(
log_type
)
{
...
...
@@ -333,6 +335,8 @@ bool MYSQL_LOG::open(const char *log_name, enum_log_type log_type_arg,
First open of this class instance
Create an index file that will hold all file names uses for logging.
Add new entries to the end of it.
Index file (and binlog) are so critical for recovery/replication
that we create them with MY_WAIT_IF_FULL.
*/
fn_format
(
index_file_name
,
index_file_name_arg
,
mysql_data_home
,
".index"
,
opt
);
...
...
@@ -343,7 +347,7 @@ bool MYSQL_LOG::open(const char *log_name, enum_log_type log_type_arg,
init_io_cache
(
&
index_file
,
index_file_nr
,
IO_SIZE
,
WRITE_CACHE
,
my_seek
(
index_file_nr
,
0L
,
MY_SEEK_END
,
MYF
(
0
)),
0
,
MYF
(
MY_WME
)))
0
,
MYF
(
MY_WME
|
MY_WAIT_IF_FULL
)))
goto
err
;
}
else
...
...
@@ -1574,6 +1578,7 @@ uint MYSQL_LOG::next_file_id()
bool
MYSQL_LOG
::
write
(
THD
*
thd
,
IO_CACHE
*
cache
,
bool
commit_or_rollback
)
{
bool
should_rotate
=
0
,
error
=
0
;
VOID
(
pthread_mutex_lock
(
&
LOCK_log
));
DBUG_ENTER
(
"MYSQL_LOG::write(cache"
);
...
...
@@ -1671,7 +1676,7 @@ bool MYSQL_LOG::write(THD *thd, IO_CACHE *cache, bool commit_or_rollback)
goto
err
;
signal_update
();
DBUG_PRINT
(
"info"
,(
"max_size: %lu"
,
max_size
));
if
(
my_b_tell
(
&
log_file
)
>=
(
my_off_t
)
max_size
)
if
(
should_rotate
=
(
my_b_tell
(
&
log_file
)
>=
(
my_off_t
)
max_size
)
)
{
pthread_mutex_lock
(
&
LOCK_index
);
new_file
(
0
);
// inside mutex
...
...
@@ -1687,7 +1692,16 @@ bool MYSQL_LOG::write(THD *thd, IO_CACHE *cache, bool commit_or_rollback)
ha_commit_complete
(
thd
);
DBUG_RETURN
(
0
);
#ifdef HAVE_REPLICATION
if
(
should_rotate
&&
expire_logs_days
)
{
long
purge_time
=
time
(
0
)
-
expire_logs_days
*
24
*
60
*
60
;
if
(
purge_time
>=
0
)
error
=
purge_logs_before_date
(
purge_time
);
}
#endif
DBUG_RETURN
(
error
);
err:
if
(
!
write_error
)
...
...
sql/mysqld.cc
View file @
263f249a
...
...
@@ -2591,8 +2591,10 @@ static int init_server_components()
if
(
opt_bin_log
)
{
open_log
(
&
mysql_bin_log
,
glob_hostname
,
opt_bin_logname
,
"-bin"
,
opt_binlog_index_name
,
LOG_BIN
,
0
,
0
,
max_binlog_size
);
/* If we fail to open binlog, it's going to hinder our recovery, so die */
if
(
open_log
(
&
mysql_bin_log
,
glob_hostname
,
opt_bin_logname
,
"-bin"
,
opt_binlog_index_name
,
LOG_BIN
,
0
,
0
,
max_binlog_size
))
unireg_abort
(
1
);
using_update_log
=
1
;
#ifdef HAVE_REPLICATION
if
(
expire_logs_days
)
...
...
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