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
a8e1eef8
Commit
a8e1eef8
authored
Mar 09, 2018
by
Oleksandr Byelkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reset connection support in mysqltest (port from mysql)
parent
bb825194
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
58 additions
and
0 deletions
+58
-0
client/mysqltest.cc
client/mysqltest.cc
+28
-0
mysql-test/r/reset_connection.result
mysql-test/r/reset_connection.result
+7
-0
mysql-test/t/reset_connection.test
mysql-test/t/reset_connection.test
+23
-0
No files found.
client/mysqltest.cc
View file @
a8e1eef8
...
...
@@ -384,6 +384,7 @@ enum enum_commands {
Q_RESULT_FORMAT_VERSION
,
Q_MOVE_FILE
,
Q_REMOVE_FILES_WILDCARD
,
Q_SEND_EVAL
,
Q_ENABLE_PREPARE_WARNINGS
,
Q_DISABLE_PREPARE_WARNINGS
,
Q_RESET_CONNECTION
,
Q_UNKNOWN
,
/* Unknown command. */
Q_COMMENT
,
/* Comments, ignored. */
Q_COMMENT_WITH_COMMAND
,
...
...
@@ -491,6 +492,7 @@ const char *command_names[]=
"send_eval"
,
"enable_prepare_warnings"
,
"disable_prepare_warnings"
,
"reset_connection"
,
0
};
...
...
@@ -6503,6 +6505,29 @@ void do_delimiter(struct st_command* command)
}
/*
do_reset_connection
DESCRIPTION
Reset the current session.
*/
static
void
do_reset_connection
()
{
MYSQL
*
mysql
=
cur_con
->
mysql
;
DBUG_ENTER
(
"do_reset_connection"
);
if
(
mysql_reset_connection
(
mysql
))
die
(
"reset connection failed: %s"
,
mysql_error
(
mysql
));
if
(
cur_con
->
stmt
)
{
mysql_stmt_close
(
cur_con
->
stmt
);
cur_con
->
stmt
=
NULL
;
}
DBUG_VOID_RETURN
;
}
my_bool
match_delimiter
(
int
c
,
const
char
*
delim
,
uint
length
)
{
uint
i
;
...
...
@@ -9543,6 +9568,9 @@ int main(int argc, char **argv)
case
Q_PING
:
handle_command_error
(
command
,
mysql_ping
(
cur_con
->
mysql
),
-
1
);
break
;
case
Q_RESET_CONNECTION
:
do_reset_connection
();
break
;
case
Q_SEND_SHUTDOWN
:
handle_command_error
(
command
,
mysql_shutdown
(
cur_con
->
mysql
,
...
...
mysql-test/r/reset_connection.result
0 → 100644
View file @
a8e1eef8
FLUSH STATUS;
SHOW local STATUS LIKE 'com_select';
Variable_name Value
Com_select 10
SHOW local STATUS LIKE 'com_select';
Variable_name Value
Com_select 0
mysql-test/t/reset_connection.test
0 → 100644
View file @
a8e1eef8
FLUSH
STATUS
;
--
disable_result_log
--
disable_query_log
let
$i
=
10
;
begin
;
while
(
$i
)
{
dec
$i
;
SELECT
1
;
}
commit
;
--
enable_query_log
--
enable_result_log
SHOW
local
STATUS
LIKE
'com_select'
;
--
reset_connection
SHOW
local
STATUS
LIKE
'com_select'
;
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