summaryrefslogtreecommitdiffstats
path: root/mysql-test/main/reset_connection.test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/main/reset_connection.test')
-rw-r--r--mysql-test/main/reset_connection.test45
1 files changed, 45 insertions, 0 deletions
diff --git a/mysql-test/main/reset_connection.test b/mysql-test/main/reset_connection.test
new file mode 100644
index 00000000..95dff6eb
--- /dev/null
+++ b/mysql-test/main/reset_connection.test
@@ -0,0 +1,45 @@
+--source include/not_embedded.inc
+
+FLUSH STATUS;
+
+--disable_result_log
+--disable_query_log
+--disable_service_connection
+
+--disable_ps2_protocol
+let $i = 10;
+begin;
+while ($i)
+{
+ dec $i;
+ SELECT 1;
+}
+commit;
+--enable_ps2_protocol
+
+--enable_query_log
+--enable_result_log
+
+SHOW local STATUS LIKE 'com_select';
+
+--reset_connection
+
+SHOW local STATUS LIKE 'com_select';
+
+--echo # Test if charset changes after reset (utf8)
+connect(utf8_conn,localhost,root,,,,,CHARSET=utf8);
+connection utf8_conn;
+SELECT IF(@@character_set_client='utf8mb3','OK', 'FAIL') AS RESULT;
+--reset_connection
+SELECT IF(@@character_set_client='utf8mb3','OK', 'FAIL') AS RESULT;
+disconnect utf8_conn;
+
+--echo # Test if charset changes after reset (latin1)
+connect(latin1_conn,localhost,root,,,,,CHARSET=latin1);
+connection latin1_conn;
+SELECT IF(@@character_set_client='latin1','OK', 'FAIL') AS RESULT;
+--reset_connection
+SELECT IF(@@character_set_client='latin1','OK', 'FAIL') AS RESULT;
+disconnect latin1_conn;
+
+--enable_service_connection