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
1f1c4477
Commit
1f1c4477
authored
Apr 04, 2005
by
jimw@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql.com:/home/jimw/my/mysql-4.1-8866
into mysql.com:/home/jimw/my/mysql-4.1-clean
parents
fc3c7d5f
9c86b351
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
52 additions
and
5 deletions
+52
-5
client/mysqltest.c
client/mysqltest.c
+9
-0
mysql-test/r/kill.result
mysql-test/r/kill.result
+8
-0
mysql-test/t/kill.test
mysql-test/t/kill.test
+8
-5
sql-common/client.c
sql-common/client.c
+27
-0
No files found.
client/mysqltest.c
View file @
1f1c4477
...
...
@@ -280,6 +280,7 @@ Q_DISPLAY_VERTICAL_RESULTS, Q_DISPLAY_HORIZONTAL_RESULTS,
Q_QUERY_VERTICAL
,
Q_QUERY_HORIZONTAL
,
Q_START_TIMER
,
Q_END_TIMER
,
Q_CHARACTER_SET
,
Q_DISABLE_PS_PROTOCOL
,
Q_ENABLE_PS_PROTOCOL
,
Q_DISABLE_RECONNECT
,
Q_ENABLE_RECONNECT
,
Q_UNKNOWN
,
/* Unknown command. */
Q_COMMENT
,
/* Comments, ignored. */
...
...
@@ -365,6 +366,8 @@ const char *command_names[]=
"character_set"
,
"disable_ps_protocol"
,
"enable_ps_protocol"
,
"disable_reconnect"
,
"enable_reconnect"
,
0
};
...
...
@@ -3624,6 +3627,12 @@ int main(int argc, char **argv)
case
Q_ENABLE_PS_PROTOCOL
:
ps_protocol_enabled
=
ps_protocol
;
break
;
case
Q_DISABLE_RECONNECT
:
cur_con
->
mysql
.
reconnect
=
0
;
break
;
case
Q_ENABLE_RECONNECT
:
cur_con
->
mysql
.
reconnect
=
1
;
break
;
default:
processed
=
0
;
break
;
}
...
...
mysql-test/r/kill.result
View file @
1f1c4477
...
...
@@ -5,6 +5,14 @@ select ((@id := kill_id) - kill_id) from t1;
((@id := kill_id) - kill_id)
0
kill @id;
select 1;
ERROR HY000: MySQL server has gone away
select ((@id := kill_id) - kill_id) from t1;
((@id := kill_id) - kill_id)
0
select @id != connection_id();
@id != connection_id()
1
select 4;
4
4
...
...
mysql-test/t/kill.test
View file @
1f1c4477
...
...
@@ -23,12 +23,15 @@ connection con2;
select
((
@
id
:=
kill_id
)
-
kill_id
)
from
t1
;
kill
@
id
;
# Wait for thread to do.
--
sleep
5
# verify that con1 is doning a reconnect
connection
con1
;
ping
ping
--
disable_reconnect
# this statement should fail
--
error
2006
select
1
;
--
enable_reconnect
# this should work, and we should have a new connection_id()
select
((
@
id
:=
kill_id
)
-
kill_id
)
from
t1
;
select
@
id
!=
connection_id
();
#make sure the server is still alive
...
...
sql-common/client.c
View file @
1f1c4477
...
...
@@ -2190,6 +2190,29 @@ my_bool mysql_reconnect(MYSQL *mysql)
DBUG_RETURN
(
1
);
}
tmp_mysql
.
free_me
=
mysql
->
free_me
;
/*
For each stmt in mysql->stmts, move it to tmp_mysql if it is
in state MYSQL_STMT_INIT_DONE, otherwise close it.
*/
{
LIST
*
element
=
mysql
->
stmts
;
for
(;
element
;
element
=
element
->
next
)
{
MYSQL_STMT
*
stmt
=
(
MYSQL_STMT
*
)
element
->
data
;
if
(
stmt
->
state
!=
MYSQL_STMT_INIT_DONE
)
{
stmt
->
mysql
=
0
;
}
else
{
tmp_mysql
.
stmts
=
list_add
(
tmp_mysql
.
stmts
,
&
stmt
->
list
);
}
/* No need to call list_delete for statement here */
}
mysql
->
stmts
=
NULL
;
}
/* Don't free options as these are now used in tmp_mysql */
bzero
((
char
*
)
&
mysql
->
options
,
sizeof
(
mysql
->
options
));
mysql
->
free_me
=
0
;
...
...
@@ -2278,6 +2301,10 @@ static void mysql_close_free(MYSQL *mysql)
SYNOPSYS
mysql_detach_stmt_list()
stmt_list pointer to mysql->stmts
NOTE
There is similar code in mysql_reconnect(), so changes here
should also be reflected there.
*/
void
mysql_detach_stmt_list
(
LIST
**
stmt_list
__attribute__
((
unused
)))
...
...
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