| 1 |
# Session connect attributes test |
| 2 |
|
| 3 |
# make sure we're alone |
| 4 |
let $count_sessions= 1; |
| 5 |
--source include/wait_until_count_sessions.inc |
| 6 |
|
| 7 |
# basic performance_schema.session_connect_attrs tests |
| 8 |
|
| 9 |
# check the presense of the pre-defined attributes |
| 10 |
--echo # must return 0, 6 |
| 11 |
SELECT SUM(ISNULL(ATTR_VALUE)), COUNT(*) |
| 12 |
FROM performance_schema.session_connect_attrs |
| 13 |
WHERE ATTR_NAME IN ('_os', '_client_name', '_pid', |
| 14 |
'_client_version', '_platform', 'program_name') |
| 15 |
AND PROCESSLIST_ID = CONNECTION_ID(); |
| 16 |
|
| 17 |
# check the presense of the pre-defined attributes |
| 18 |
--echo # must return 1 |
| 19 |
SELECT COUNT(DISTINCT PROCESSLIST_ID) |
| 20 |
FROM performance_schema.session_connect_attrs; |
| 21 |
|
| 22 |
|
| 23 |
# basic performance_schema.session_account_connect_attrs tests |
| 24 |
|
| 25 |
# check the presense of the pre-defined attributes |
| 26 |
--echo # must return 0, 6 |
| 27 |
SELECT SUM(ISNULL(ATTR_VALUE)), COUNT(*) |
| 28 |
FROM performance_schema.session_account_connect_attrs |
| 29 |
WHERE ATTR_NAME IN ('_os', '_client_name', '_pid', |
| 30 |
'_client_version', '_platform', 'program_name') |
| 31 |
AND PROCESSLIST_ID = CONNECTION_ID(); |
| 32 |
|
| 33 |
# check the presense of the pre-defined attributes |
| 34 |
--echo # must return 1 |
| 35 |
SELECT COUNT(DISTINCT PROCESSLIST_ID) |
| 36 |
FROM performance_schema.session_account_connect_attrs; |
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
CREATE USER wl5924@localhost; |
| 41 |
|
| 42 |
connect(non_privileged_user,localhost,wl5924,,test); |
| 43 |
connection default; |
| 44 |
|
| 45 |
--echo # must return 1 |
| 46 |
SELECT COUNT(DISTINCT PROCESSLIST_ID) |
| 47 |
FROM performance_schema.session_account_connect_attrs; |
| 48 |
|
| 49 |
--echo # must return 2 |
| 50 |
SELECT COUNT(DISTINCT PROCESSLIST_ID) |
| 51 |
FROM performance_schema.session_connect_attrs; |
| 52 |
|
| 53 |
connection non_privileged_user; |
| 54 |
--echo # must return 1 |
| 55 |
SELECT COUNT(DISTINCT PROCESSLIST_ID) |
| 56 |
FROM performance_schema.session_account_connect_attrs; |
| 57 |
|
| 58 |
--error ER_TABLEACCESS_DENIED_ERROR |
| 59 |
SELECT COUNT(DISTINCT PROCESSLIST_ID) |
| 60 |
FROM performance_schema.session_connect_attrs; |
| 61 |
|
| 62 |
connection default; |
| 63 |
disconnect non_privileged_user; |
| 64 |
|
| 65 |
DROP USER wl5924@localhost; |
| 66 |
|
| 67 |
# Wait till all disconnects are completed |
| 68 |
--source include/wait_until_count_sessions.inc |