This repository has been archived by the owner on Aug 28, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 224
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Manually merge PR #63, contribution by Daniël van Eeden for a new vie…
…w for session SSL status. Made a few changes from the original, such as a rename of the sessions view to session, and the contributed view to session_ssl_status.
- Loading branch information
Showing
10 changed files
with
184 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
DESC sys.session; | ||
Field Type Null Key Default Extra | ||
thd_id bigint(20) unsigned NO NULL | ||
conn_id bigint(20) unsigned YES NULL | ||
user varchar(128) YES NULL | ||
db varchar(64) YES NULL | ||
command varchar(16) YES NULL | ||
state varchar(64) YES NULL | ||
time bigint(20) YES NULL | ||
current_statement longtext YES NULL | ||
statement_latency text YES NULL | ||
progress decimal(26,2) YES NULL | ||
lock_latency text YES NULL | ||
rows_examined bigint(20) unsigned YES NULL | ||
rows_sent bigint(20) unsigned YES NULL | ||
rows_affected bigint(20) unsigned YES NULL | ||
tmp_tables bigint(20) unsigned YES NULL | ||
tmp_disk_tables bigint(20) unsigned YES NULL | ||
full_scan varchar(3) NO | ||
last_statement longtext YES NULL | ||
last_statement_latency text YES NULL | ||
current_memory text YES NULL | ||
last_wait varchar(128) YES NULL | ||
last_wait_latency text YES NULL | ||
source varchar(64) YES NULL | ||
pid varchar(1024) YES NULL | ||
program_name varchar(1024) YES NULL | ||
SELECT * FROM sys.session; | ||
DESC sys.x$session; | ||
Field Type Null Key Default Extra | ||
thd_id bigint(20) unsigned NO NULL | ||
conn_id bigint(20) unsigned YES NULL | ||
user varchar(128) YES NULL | ||
db varchar(64) YES NULL | ||
command varchar(16) YES NULL | ||
state varchar(64) YES NULL | ||
time bigint(20) YES NULL | ||
current_statement longtext YES NULL | ||
statement_latency bigint(20) unsigned YES NULL | ||
progress decimal(26,2) YES NULL | ||
lock_latency bigint(20) unsigned YES NULL | ||
rows_examined bigint(20) unsigned YES NULL | ||
rows_sent bigint(20) unsigned YES NULL | ||
rows_affected bigint(20) unsigned YES NULL | ||
tmp_tables bigint(20) unsigned YES NULL | ||
tmp_disk_tables bigint(20) unsigned YES NULL | ||
full_scan varchar(3) NO | ||
last_statement longtext YES NULL | ||
last_statement_latency bigint(20) unsigned YES NULL | ||
current_memory decimal(41,0) YES NULL | ||
last_wait varchar(128) YES NULL | ||
last_wait_latency varchar(20) YES NULL | ||
source varchar(64) YES NULL | ||
pid varchar(1024) YES NULL | ||
program_name varchar(1024) YES NULL | ||
SELECT * FROM sys.x$session; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
DESC sys.session_ssl_status; | ||
Field Type Null Key Default Extra | ||
thread_id bigint(20) unsigned NO NULL | ||
ssl_version varchar(1024) YES NULL | ||
ssl_cipher varchar(1024) YES NULL | ||
ssl_sessions_reused varchar(1024) YES NULL | ||
SELECT * FROM sys.session_ssl_status; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
-- source include/not_embedded.inc | ||
# Tests for sys schema | ||
# Verify the sys.session view | ||
|
||
# Ensure structure changes don't slip in | ||
DESC sys.session; | ||
|
||
# Make sure view select does not error, but ignore results | ||
--disable_result_log | ||
SELECT * FROM sys.session; | ||
--enable_result_log | ||
|
||
|
||
# Ensure structure changes don't slip in | ||
DESC sys.x$session; | ||
|
||
# Make sure view select does not error, but ignore results | ||
--disable_result_log | ||
SELECT * FROM sys.x$session; | ||
--enable_result_log | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
-- source include/not_embedded.inc | ||
# Tests for sys schema | ||
# Verify the sys.session_ssl_status view | ||
|
||
# Ensure structure changes don't slip in | ||
DESC sys.session_ssl_status; | ||
|
||
# Make sure view select does not error, but ignore results | ||
--disable_result_log | ||
SELECT * FROM sys.session_ssl_status; | ||
--enable_result_log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
-- | ||
-- View: session_ssl_status | ||
-- | ||
-- Shows SSL version, cipher and the count of re-used SSL sessions per connection | ||
-- | ||
-- mysql> select * from session_ssl_status; | ||
-- +-----------+-------------+--------------------+---------------------+ | ||
-- | thread_id | ssl_version | ssl_cipher | ssl_sessions_reused | | ||
-- +-----------+-------------+--------------------+---------------------+ | ||
-- | 26 | TLSv1 | DHE-RSA-AES256-SHA | 0 | | ||
-- | 27 | TLSv1 | DHE-RSA-AES256-SHA | 0 | | ||
-- | 28 | TLSv1 | DHE-RSA-AES256-SHA | 0 | | ||
-- +-----------+-------------+--------------------+---------------------+ | ||
-- 3 rows in set (0.00 sec) | ||
-- | ||
|
||
CREATE | ||
ALGORITHM = MERGE | ||
DEFINER = 'root'@'localhost' | ||
SQL SECURITY INVOKER | ||
VIEW session_ssl_status ( | ||
thread_id, | ||
ssl_version, | ||
ssl_cipher, | ||
ssl_sessions_reused | ||
) AS | ||
SELECT sslver.thread_id, | ||
sslver.variable_value ssl_version, | ||
sslcip.variable_value ssl_cipher, | ||
sslreuse.variable_value ssl_sessions_reused | ||
FROM performance_schema.status_by_thread sslver | ||
LEFT JOIN performance_schema.status_by_thread sslcip | ||
ON (sslcip.thread_id=sslver.thread_id and sslcip.variable_name='Ssl_cipher') | ||
LEFT JOIN performance_schema.status_by_thread sslreuse | ||
ON (sslreuse.thread_id=sslver.thread_id and sslreuse.variable_name='Ssl_sessions_reused') | ||
WHERE sslver.variable_name='Ssl_version'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters