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
42dd680d
Commit
42dd680d
authored
Jul 11, 2001
by
sasha@mysql.sashanet.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge work:/home/bk/mysql
into mysql.sashanet.com:/home/sasha/src/bk/mysql
parents
104cd91d
21a8aaa2
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
10 deletions
+27
-10
sql/log.cc
sql/log.cc
+13
-8
sql/mysqld.cc
sql/mysqld.cc
+7
-0
sql/slave.cc
sql/slave.cc
+5
-0
sql/sql_class.h
sql/sql_class.h
+1
-1
sql/sql_repl.cc
sql/sql_repl.cc
+1
-1
No files found.
sql/log.cc
View file @
42dd680d
...
@@ -511,17 +511,19 @@ bool MYSQL_LOG::is_active(const char* log_file_name)
...
@@ -511,17 +511,19 @@ bool MYSQL_LOG::is_active(const char* log_file_name)
return
inited
&&
!
strcmp
(
log_file_name
,
this
->
log_file_name
);
return
inited
&&
!
strcmp
(
log_file_name
,
this
->
log_file_name
);
}
}
void
MYSQL_LOG
::
new_file
()
void
MYSQL_LOG
::
new_file
(
bool
inside_mutex
)
{
{
// only rotate open logs that are marked non-rotatable
// only rotate open logs that are marked non-rotatable
// (binlog with constant name are non-rotatable)
// (binlog with constant name are non-rotatable)
if
(
is_open
()
&&
!
no_rotate
)
if
(
is_open
()
&&
!
no_rotate
)
{
{
char
new_name
[
FN_REFLEN
],
*
old_name
=
name
;
char
new_name
[
FN_REFLEN
],
*
old_name
=
name
;
VOID
(
pthread_mutex_lock
(
&
LOCK_log
));
if
(
!
inside_mutex
)
VOID
(
pthread_mutex_lock
(
&
LOCK_log
));
if
(
generate_new_name
(
new_name
,
name
))
if
(
generate_new_name
(
new_name
,
name
))
{
{
VOID
(
pthread_mutex_unlock
(
&
LOCK_log
));
if
(
!
inside_mutex
)
VOID
(
pthread_mutex_unlock
(
&
LOCK_log
));
return
;
// Something went wrong
return
;
// Something went wrong
}
}
if
(
log_type
==
LOG_BIN
)
if
(
log_type
==
LOG_BIN
)
...
@@ -540,7 +542,8 @@ void MYSQL_LOG::new_file()
...
@@ -540,7 +542,8 @@ void MYSQL_LOG::new_file()
my_free
(
old_name
,
MYF
(
0
));
my_free
(
old_name
,
MYF
(
0
));
last_time
=
query_start
=
0
;
last_time
=
query_start
=
0
;
write_error
=
0
;
write_error
=
0
;
VOID
(
pthread_mutex_unlock
(
&
LOCK_log
));
if
(
!
inside_mutex
)
VOID
(
pthread_mutex_unlock
(
&
LOCK_log
));
}
}
}
}
...
@@ -695,9 +698,9 @@ err:
...
@@ -695,9 +698,9 @@ err:
if
(
file
==
&
log_file
)
if
(
file
==
&
log_file
)
VOID
(
pthread_cond_broadcast
(
&
COND_binlog_update
));
VOID
(
pthread_cond_broadcast
(
&
COND_binlog_update
));
}
}
if
(
should_rotate
)
new_file
(
1
);
// inside mutex
VOID
(
pthread_mutex_unlock
(
&
LOCK_log
));
VOID
(
pthread_mutex_unlock
(
&
LOCK_log
));
if
(
should_rotate
)
new_file
();
return
error
;
return
error
;
}
}
...
@@ -782,11 +785,13 @@ bool MYSQL_LOG::write(Load_log_event* event_info)
...
@@ -782,11 +785,13 @@ bool MYSQL_LOG::write(Load_log_event* event_info)
VOID
(
pthread_cond_broadcast
(
&
COND_binlog_update
));
VOID
(
pthread_cond_broadcast
(
&
COND_binlog_update
));
}
}
}
}
if
(
should_rotate
)
new_file
(
1
);
// inside mutex
VOID
(
pthread_mutex_unlock
(
&
LOCK_log
));
VOID
(
pthread_mutex_unlock
(
&
LOCK_log
));
}
}
if
(
should_rotate
)
new_file
();
return
error
;
return
error
;
}
}
...
...
sql/mysqld.cc
View file @
42dd680d
...
@@ -1477,6 +1477,13 @@ static void open_log(MYSQL_LOG *log, const char *hostname,
...
@@ -1477,6 +1477,13 @@ static void open_log(MYSQL_LOG *log, const char *hostname,
strmov
(
strcend
(
tmp
,
'.'
),
extension
);
strmov
(
strcend
(
tmp
,
'.'
),
extension
);
opt_name
=
tmp
;
opt_name
=
tmp
;
}
}
// get rid of extention if the log is binary to avoid problems
if
(
type
==
LOG_BIN
)
{
char
*
p
=
strrchr
(
opt_name
,
FN_EXTCHAR
);
if
(
p
)
*
p
=
0
;
}
log
->
open
(
opt_name
,
type
);
log
->
open
(
opt_name
,
type
);
}
}
...
...
sql/slave.cc
View file @
42dd680d
...
@@ -189,6 +189,11 @@ static void free_string_array(DYNAMIC_ARRAY *a)
...
@@ -189,6 +189,11 @@ static void free_string_array(DYNAMIC_ARRAY *a)
void
end_slave
()
void
end_slave
()
{
{
pthread_mutex_lock
(
&
LOCK_slave
);
while
(
slave_running
)
pthread_cond_wait
(
&
COND_slave_stopped
,
&
LOCK_slave
);
pthread_mutex_unlock
(
&
LOCK_slave
);
end_master_info
(
&
glob_mi
);
end_master_info
(
&
glob_mi
);
if
(
do_table_inited
)
if
(
do_table_inited
)
hash_free
(
&
replicate_do_table
);
hash_free
(
&
replicate_do_table
);
...
...
sql/sql_class.h
View file @
42dd680d
...
@@ -74,7 +74,7 @@ public:
...
@@ -74,7 +74,7 @@ public:
void
init
(
enum_log_type
log_type_arg
);
void
init
(
enum_log_type
log_type_arg
);
void
open
(
const
char
*
log_name
,
enum_log_type
log_type
,
void
open
(
const
char
*
log_name
,
enum_log_type
log_type
,
const
char
*
new_name
=
0
);
const
char
*
new_name
=
0
);
void
new_file
(
void
);
void
new_file
(
bool
inside_mutex
=
0
);
bool
open_index
(
int
options
);
bool
open_index
(
int
options
);
void
close_index
();
void
close_index
();
bool
write
(
THD
*
thd
,
enum
enum_server_command
command
,
const
char
*
format
,...);
bool
write
(
THD
*
thd
,
enum
enum_server_command
command
,
const
char
*
format
,...);
...
...
sql/sql_repl.cc
View file @
42dd680d
...
@@ -274,6 +274,7 @@ void mysql_binlog_send(THD* thd, char* log_ident, ulong pos, ushort flags)
...
@@ -274,6 +274,7 @@ void mysql_binlog_send(THD* thd, char* log_ident, ulong pos, ushort flags)
int
left_events
=
max_binlog_dump_events
;
int
left_events
=
max_binlog_dump_events
;
#endif
#endif
DBUG_ENTER
(
"mysql_binlog_send"
);
DBUG_ENTER
(
"mysql_binlog_send"
);
bzero
((
char
*
)
&
log
,
sizeof
(
log
));
#ifndef DBUG_OFF
#ifndef DBUG_OFF
if
(
opt_sporadic_binlog_dump_fail
&&
(
binlog_dump_count
++
%
2
))
if
(
opt_sporadic_binlog_dump_fail
&&
(
binlog_dump_count
++
%
2
))
...
@@ -283,7 +284,6 @@ void mysql_binlog_send(THD* thd, char* log_ident, ulong pos, ushort flags)
...
@@ -283,7 +284,6 @@ void mysql_binlog_send(THD* thd, char* log_ident, ulong pos, ushort flags)
}
}
#endif
#endif
bzero
((
char
*
)
&
log
,
sizeof
(
log
));
if
(
!
mysql_bin_log
.
is_open
())
if
(
!
mysql_bin_log
.
is_open
())
{
{
...
...
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