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
115c62f5
Commit
115c62f5
authored
Jul 13, 2001
by
sasha@mysql.sashanet.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed coredump in mysql_reconnect()
parent
c0b4b236
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
0 deletions
+19
-0
libmysql/libmysql.c
libmysql/libmysql.c
+19
-0
No files found.
libmysql/libmysql.c
View file @
115c62f5
...
@@ -1845,6 +1845,23 @@ error:
...
@@ -1845,6 +1845,23 @@ error:
DBUG_RETURN
(
0
);
DBUG_RETURN
(
0
);
}
}
/* needed when we move MYSQL structure to a different address */
static
void
mysql_fix_pointers
(
MYSQL
*
mysql
,
MYSQL
*
old_mysql
)
{
MYSQL
*
tmp
,
*
tmp_prev
;
if
(
mysql
->
master
==
old_mysql
)
mysql
->
master
=
mysql
;
if
(
mysql
->
last_used_con
==
old_mysql
)
mysql
->
last_used_con
=
mysql
;
if
(
mysql
->
last_used_slave
==
old_mysql
)
mysql
->
last_used_slave
=
mysql
;
for
(
tmp_prev
=
mysql
,
tmp
=
mysql
->
next_slave
;
tmp
!=
old_mysql
;
tmp
=
tmp
->
next_slave
)
{
tmp_prev
=
tmp
;
}
tmp_prev
->
next_slave
=
mysql
;
}
static
my_bool
mysql_reconnect
(
MYSQL
*
mysql
)
static
my_bool
mysql_reconnect
(
MYSQL
*
mysql
)
{
{
...
@@ -1860,6 +1877,7 @@ static my_bool mysql_reconnect(MYSQL *mysql)
...
@@ -1860,6 +1877,7 @@ static my_bool mysql_reconnect(MYSQL *mysql)
}
}
mysql_init
(
&
tmp_mysql
);
mysql_init
(
&
tmp_mysql
);
tmp_mysql
.
options
=
mysql
->
options
;
tmp_mysql
.
options
=
mysql
->
options
;
tmp_mysql
.
rpl_pivot
=
mysql
->
rpl_pivot
;
if
(
!
mysql_real_connect
(
&
tmp_mysql
,
mysql
->
host
,
mysql
->
user
,
mysql
->
passwd
,
if
(
!
mysql_real_connect
(
&
tmp_mysql
,
mysql
->
host
,
mysql
->
user
,
mysql
->
passwd
,
mysql
->
db
,
mysql
->
port
,
mysql
->
unix_socket
,
mysql
->
db
,
mysql
->
port
,
mysql
->
unix_socket
,
mysql
->
client_flag
))
mysql
->
client_flag
))
...
@@ -1869,6 +1887,7 @@ static my_bool mysql_reconnect(MYSQL *mysql)
...
@@ -1869,6 +1887,7 @@ static my_bool mysql_reconnect(MYSQL *mysql)
bzero
((
char
*
)
&
mysql
->
options
,
sizeof
(
mysql
->
options
));
bzero
((
char
*
)
&
mysql
->
options
,
sizeof
(
mysql
->
options
));
mysql_close
(
mysql
);
mysql_close
(
mysql
);
*
mysql
=
tmp_mysql
;
*
mysql
=
tmp_mysql
;
mysql_fix_pointers
(
mysql
,
&
tmp_mysql
);
/* adjust connection pointers */
net_clear
(
&
mysql
->
net
);
net_clear
(
&
mysql
->
net
);
mysql
->
affected_rows
=
~
(
my_ulonglong
)
0
;
mysql
->
affected_rows
=
~
(
my_ulonglong
)
0
;
DBUG_RETURN
(
0
);
DBUG_RETURN
(
0
);
...
...
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