File: service_pfs_resource_group.result

package info (click to toggle)
mysql-8.0 8.0.43-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,273,924 kB
  • sloc: cpp: 4,684,605; ansic: 412,450; pascal: 108,398; java: 83,641; perl: 30,221; cs: 27,067; sql: 26,594; sh: 24,181; python: 21,816; yacc: 17,169; php: 11,522; xml: 7,388; javascript: 7,076; makefile: 2,194; lex: 1,075; awk: 670; asm: 520; objc: 183; ruby: 97; lisp: 86
file content (63 lines) | stat: -rw-r--r-- 2,243 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63

## Test the Performance Schema Resource Group service WL#8881
##
## 1. Load component to register callbacks for each API
## 2. Create users to trigger tests within the component
## 3. Write test results to a log file
## 4. Print out log file
##
## Note: The test component sets its own resource group name, PFS_CURRENT_THREAD, for root.

## Install test component
INSTALL COMPONENT 'file://component_test_pfs_resource_group';

## Create test-specific users. The internal tests are triggered when the user connects.
CREATE USER PFS_TEST_CURRENT_THREAD;
CREATE USER PFS_TEST_VALID_GROUP_NAME;
CREATE USER PFS_TEST_INVALID_THREAD_ID;
CREATE USER PFS_TEST_INVALID_GROUP_NAME;
GRANT ALL ON *.* TO PFS_TEST_CURRENT_THREAD;
GRANT ALL ON *.* TO PFS_TEST_VALID_GROUP_NAME;
GRANT ALL ON *.* TO PFS_TEST_INVALID_THREAD_ID;
GRANT ALL ON *.* TO PFS_TEST_INVALID_GROUP_NAME;

## TEST 1. CURRENT THREAD (INSTRUMENTED)
## PFS_CURRENT_THREAD is the group name for the component connection, set during component initialization.
## This also exercises the THREADS.RESOURCE_GROUP index.

SELECT name, type, processlist_user, processlist_host, processlist_db, resource_group
FROM performance_schema.threads WHERE resource_group = 'PFS_CURRENT_THREAD';
name	type	processlist_user	processlist_host	processlist_db	resource_group
thread/sql/one_connection	FOREGROUND	root	localhost	test	PFS_CURRENT_THREAD

## TEST 2. VALID GROUP NAME
## set_resource_group() with a valid group name
## CONNECT PFS_TEST_VALID_GROUP_NAME

## TEST 3. INVALID THREAD_ID
## Test set_resource_group() with an invalid thread_id
## CONNECT PFS_TEST_INVALID_THREAD_ID

## TEST 4. INVALID GROUP NAME
## Test set_resource_group() with an invalid group name
## CONNECT PFS_TEST_INVALID_GROUP_NAME
## Disconnect PFS_TEST_VALID_GROUP_NAME
## Disconnect PFS_TEST_INVALID_THREAD_ID
## Disconnect PFS_TEST_INVALID_GROUP_NAME

## Connect default

## PRINT LOG FILE
=========================================
=========================================

## Uninstall component

UNINSTALL COMPONENT 'file://component_test_pfs_resource_group';

## Clean up

DROP USER PFS_TEST_CURRENT_THREAD;
DROP USER PFS_TEST_VALID_GROUP_NAME;
DROP USER PFS_TEST_INVALID_THREAD_ID;
DROP USER PFS_TEST_INVALID_GROUP_NAME;