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
48058cf1
Commit
48058cf1
authored
Feb 18, 2008
by
anozdrin/alik@quad
Browse files
Options
Browse Files
Download
Plain Diff
Merge quad.:/mnt/raid/alik/MySQL/devel/5.0-rt
into quad.:/mnt/raid/alik/MySQL/devel/5.1-rt-merged
parents
b25de633
23d670c3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
14 deletions
+39
-14
client/mysqlbinlog.cc
client/mysqlbinlog.cc
+31
-7
sql/slave.cc
sql/slave.cc
+6
-5
sql/slave.h
sql/slave.h
+2
-2
No files found.
client/mysqlbinlog.cc
View file @
48058cf1
...
@@ -475,6 +475,31 @@ Create_file event for file_id: %u\n",ae->file_id);
...
@@ -475,6 +475,31 @@ Create_file event for file_id: %u\n",ae->file_id);
Load_log_processor
load_processor
;
Load_log_processor
load_processor
;
/**
Replace windows-style backslashes by forward slashes so it can be
consumed by the mysql client, which requires Unix path.
@todo This is only useful under windows, so may be ifdef'ed out on
other systems. /Sven
@todo If a Create_file_log_event contains a filename with a
backslash (valid under unix), then we have problems under windows.
/Sven
@param[in,out] fname Filename to modify. The filename is modified
in-place.
*/
static
void
convert_path_to_forward_slashes
(
char
*
fname
)
{
while
(
*
fname
)
{
if
(
*
fname
==
'\\'
)
*
fname
=
'/'
;
fname
++
;
}
}
static
bool
check_database
(
const
char
*
log_dbname
)
static
bool
check_database
(
const
char
*
log_dbname
)
{
{
return
one_database
&&
return
one_database
&&
...
@@ -627,6 +652,11 @@ int process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
...
@@ -627,6 +652,11 @@ int process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
*/
*/
if
(
ce
)
if
(
ce
)
{
{
/*
We must not convert earlier, since the file is used by
my_open() in Load_log_processor::append().
*/
convert_path_to_forward_slashes
((
char
*
)
ce
->
fname
);
ce
->
print
(
result_file
,
print_event_info
,
TRUE
);
ce
->
print
(
result_file
,
print_event_info
,
TRUE
);
my_free
((
char
*
)
ce
->
fname
,
MYF
(
MY_WME
));
my_free
((
char
*
)
ce
->
fname
,
MYF
(
MY_WME
));
delete
ce
;
delete
ce
;
...
@@ -675,13 +705,7 @@ Create_file event for file_id: %u\n",exv->file_id);
...
@@ -675,13 +705,7 @@ Create_file event for file_id: %u\n",exv->file_id);
if
(
fname
)
if
(
fname
)
{
{
/*
convert_path_to_forward_slashes
(
fname
);
Fix the path so it can be consumed by mysql client (requires Unix path).
*/
int
stop
=
strlen
(
fname
);
for
(
int
i
=
0
;
i
<
stop
;
i
++
)
if
(
fname
[
i
]
==
'\\'
)
fname
[
i
]
=
'/'
;
exlq
->
print
(
result_file
,
print_event_info
,
fname
);
exlq
->
print
(
result_file
,
print_event_info
,
fname
);
my_free
(
fname
,
MYF
(
MY_WME
));
my_free
(
fname
,
MYF
(
MY_WME
));
}
}
...
...
sql/slave.cc
View file @
48058cf1
...
@@ -1337,14 +1337,15 @@ bool show_master_info(THD* thd, Master_info* mi)
...
@@ -1337,14 +1337,15 @@ bool show_master_info(THD* thd, Master_info* mi)
protocol
->
prepare_for_resend
();
protocol
->
prepare_for_resend
();
/*
/*
TODO: we read slave_running without run_lock, whereas these variables
slave_running can be accessed without run_lock but not other
are updated under run_lock and not data_lock. In 5.0 we should lock
non-volotile members like mi->io_thd, which is guarded by the mutex.
run_lock on top of data_lock (with good order).
*/
*/
pthread_mutex_lock
(
&
mi
->
run_lock
);
protocol
->
store
(
mi
->
io_thd
?
mi
->
io_thd
->
proc_info
:
""
,
&
my_charset_bin
);
pthread_mutex_unlock
(
&
mi
->
run_lock
);
pthread_mutex_lock
(
&
mi
->
data_lock
);
pthread_mutex_lock
(
&
mi
->
data_lock
);
pthread_mutex_lock
(
&
mi
->
rli
.
data_lock
);
pthread_mutex_lock
(
&
mi
->
rli
.
data_lock
);
protocol
->
store
(
mi
->
io_thd
?
mi
->
io_thd
->
proc_info
:
""
,
&
my_charset_bin
);
protocol
->
store
(
mi
->
host
,
&
my_charset_bin
);
protocol
->
store
(
mi
->
host
,
&
my_charset_bin
);
protocol
->
store
(
mi
->
user
,
&
my_charset_bin
);
protocol
->
store
(
mi
->
user
,
&
my_charset_bin
);
protocol
->
store
((
uint32
)
mi
->
port
);
protocol
->
store
((
uint32
)
mi
->
port
);
...
...
sql/slave.h
View file @
48058cf1
...
@@ -80,8 +80,8 @@ class Master_info;
...
@@ -80,8 +80,8 @@ class Master_info;
mi->rli does not either.
mi->rli does not either.
In Master_info: run_lock, data_lock
In Master_info: run_lock, data_lock
run_lock protects all information about the run state: slave_running,
and the
run_lock protects all information about the run state: slave_running,
thd
existence of the I/O thread (
to stop/start it, you need this mutex).
and the existence of the I/O thread
to stop/start it, you need this mutex).
data_lock protects some moving members of the struct: counters (log name,
data_lock protects some moving members of the struct: counters (log name,
position) and relay log (MYSQL_BIN_LOG object).
position) and relay log (MYSQL_BIN_LOG object).
...
...
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