1# must return 0, 6 2SELECT SUM(ISNULL(ATTR_VALUE)), COUNT(*) 3FROM performance_schema.session_connect_attrs 4WHERE ATTR_NAME IN ('_os', '_client_name', '_pid', 5'_client_version', '_platform', 'program_name') 6AND PROCESSLIST_ID = CONNECTION_ID(); 7SUM(ISNULL(ATTR_VALUE)) COUNT(*) 80 6 9# must return 1 10SELECT COUNT(DISTINCT PROCESSLIST_ID) 11FROM performance_schema.session_connect_attrs; 12COUNT(DISTINCT PROCESSLIST_ID) 131 14# must return 0, 6 15SELECT SUM(ISNULL(ATTR_VALUE)), COUNT(*) 16FROM performance_schema.session_account_connect_attrs 17WHERE ATTR_NAME IN ('_os', '_client_name', '_pid', 18'_client_version', '_platform', 'program_name') 19AND PROCESSLIST_ID = CONNECTION_ID(); 20SUM(ISNULL(ATTR_VALUE)) COUNT(*) 210 6 22# must return 1 23SELECT COUNT(DISTINCT PROCESSLIST_ID) 24FROM performance_schema.session_account_connect_attrs; 25COUNT(DISTINCT PROCESSLIST_ID) 261 27CREATE USER wl5924@localhost; 28connect non_privileged_user,localhost,wl5924,,test; 29connection default; 30# must return 1 31SELECT COUNT(DISTINCT PROCESSLIST_ID) 32FROM performance_schema.session_account_connect_attrs; 33COUNT(DISTINCT PROCESSLIST_ID) 341 35# must return 2 36SELECT COUNT(DISTINCT PROCESSLIST_ID) 37FROM performance_schema.session_connect_attrs; 38COUNT(DISTINCT PROCESSLIST_ID) 392 40connection non_privileged_user; 41SELECT COUNT(DISTINCT PROCESSLIST_ID) 42FROM performance_schema.session_account_connect_attrs; 43ERROR 42000: SELECT command denied to user 'wl5924'@'localhost' for table 'session_account_connect_attrs' 44SELECT COUNT(DISTINCT PROCESSLIST_ID) 45FROM performance_schema.session_connect_attrs; 46ERROR 42000: SELECT command denied to user 'wl5924'@'localhost' for table 'session_connect_attrs' 47connection default; 48disconnect non_privileged_user; 49grant select on performance_schema.* to wl5924@localhost; 50SELECT SUM(ISNULL(ATTR_VALUE)), COUNT(*) 51FROM performance_schema.session_account_connect_attrs 52WHERE ATTR_NAME IN ('_os', '_client_name', '_pid', 53'_client_version', '_platform', 'program_name') 54AND PROCESSLIST_ID = CONNECTION_ID(); 55SUM(ISNULL(ATTR_VALUE)) COUNT(*) 560 6 57DROP USER wl5924@localhost; 58