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
5faab668
Commit
5faab668
authored
Nov 15, 2000
by
sasha@mysql.sashanet.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sql/slave.cc
fixed bug - mutex was not being released if master.info could not be read
parent
f2b9a60e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
4 deletions
+15
-4
sql/slave.cc
sql/slave.cc
+15
-4
No files found.
sql/slave.cc
View file @
5faab668
...
@@ -358,7 +358,10 @@ int init_master_info(MASTER_INFO* mi)
...
@@ -358,7 +358,10 @@ int init_master_info(MASTER_INFO* mi)
{
{
file
=
my_fopen
(
fname
,
O_CREAT
|
O_RDWR
|
O_BINARY
,
MYF
(
MY_WME
));
file
=
my_fopen
(
fname
,
O_CREAT
|
O_RDWR
|
O_BINARY
,
MYF
(
MY_WME
));
if
(
!
file
)
if
(
!
file
)
{
pthread_mutex_unlock
(
&
mi
->
lock
);
return
1
;
return
1
;
}
mi
->
log_file_name
[
0
]
=
0
;
mi
->
log_file_name
[
0
]
=
0
;
mi
->
pos
=
4
;
// skip magic number
mi
->
pos
=
4
;
// skip magic number
mi
->
file
=
file
;
mi
->
file
=
file
;
...
@@ -373,17 +376,24 @@ int init_master_info(MASTER_INFO* mi)
...
@@ -373,17 +376,24 @@ int init_master_info(MASTER_INFO* mi)
mi
->
connect_retry
=
master_connect_retry
;
mi
->
connect_retry
=
master_connect_retry
;
if
(
flush_master_info
(
mi
))
if
(
flush_master_info
(
mi
))
{
pthread_mutex_unlock
(
&
mi
->
lock
);
return
1
;
return
1
;
}
}
}
else
else
{
{
file
=
my_fopen
(
fname
,
O_RDWR
|
O_BINARY
,
MYF
(
MY_WME
));
file
=
my_fopen
(
fname
,
O_RDWR
|
O_BINARY
,
MYF
(
MY_WME
));
if
(
!
file
)
if
(
!
file
)
{
pthread_mutex_unlock
(
&
mi
->
lock
);
return
1
;
return
1
;
}
if
(
!
fgets
(
mi
->
log_file_name
,
sizeof
(
mi
->
log_file_name
),
file
))
if
(
!
fgets
(
mi
->
log_file_name
,
sizeof
(
mi
->
log_file_name
),
file
))
{
{
sql_print_error
(
"Error reading log file name from master info file "
);
sql_print_error
(
"Error reading log file name from master info file "
);
pthread_mutex_unlock
(
&
mi
->
lock
);
return
1
;
return
1
;
}
}
...
@@ -392,6 +402,7 @@ int init_master_info(MASTER_INFO* mi)
...
@@ -392,6 +402,7 @@ int init_master_info(MASTER_INFO* mi)
if
(
!
fgets
(
buf
,
sizeof
(
buf
),
file
))
if
(
!
fgets
(
buf
,
sizeof
(
buf
),
file
))
{
{
sql_print_error
(
"Error reading log file position from master info file"
);
sql_print_error
(
"Error reading log file position from master info file"
);
pthread_mutex_unlock
(
&
mi
->
lock
);
return
1
;
return
1
;
}
}
...
...
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