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; 41# must return 1 42SELECT COUNT(DISTINCT PROCESSLIST_ID) 43FROM performance_schema.session_account_connect_attrs; 44COUNT(DISTINCT PROCESSLIST_ID) 451 46SELECT COUNT(DISTINCT PROCESSLIST_ID) 47FROM performance_schema.session_connect_attrs; 48ERROR 42000: SELECT command denied to user 'wl5924'@'localhost' for table 'session_connect_attrs' 49connection default; 50disconnect non_privileged_user; 51grant select on performance_schema.* to wl5924@localhost; 52SELECT SUM(ISNULL(ATTR_VALUE)), COUNT(*) 53FROM performance_schema.session_account_connect_attrs 54WHERE ATTR_NAME IN ('_os', '_client_name', '_pid', 55'_client_version', '_platform', 'program_name') 56AND PROCESSLIST_ID = CONNECTION_ID(); 57SUM(ISNULL(ATTR_VALUE)) COUNT(*) 580 6 59DROP USER wl5924@localhost; 60