| 1 |
# Test for access on status vars registered by components in sessions. |
| 2 |
--source include/count_sessions.inc |
| 3 |
|
| 4 |
--source ../include/have_component_test_status_var_service.inc |
| 5 |
|
| 6 |
--enable_connect_log |
| 7 |
|
| 8 |
SET @start_value= @@global.wait_timeout; |
| 9 |
SET @@global.wait_timeout= 2; |
| 10 |
|
| 11 |
CREATE USER 'testuser'@'localhost' IDENTIFIED BY 'pw'; |
| 12 |
#GRANT SELECT ON perf_schema.* TO 'testuser'@'localhost'; |
| 13 |
|
| 14 |
INSTALL COMPONENT "file://component_test_status_var_service"; |
| 15 |
send SHOW STATUS WHERE VARIABLE_NAME LIKE 'test_component.int_variable'; |
| 16 |
|
| 17 |
connect(con1,localhost,root,,); |
| 18 |
send SHOW STATUS WHERE VARIABLE_NAME LIKE '%component%'; |
| 19 |
|
| 20 |
connect(con2,localhost,testuser,'pw',); |
| 21 |
send SHOW STATUS WHERE VARIABLE_NAME LIKE '%component%'; |
| 22 |
|
| 23 |
connection default; |
| 24 |
reap; |
| 25 |
#UNINSTALL COMPONENT "file://component_test_status_var_service_int"; |
| 26 |
#INSTALL COMPONENT "file://component_test_status_var_service_int"; |
| 27 |
|
| 28 |
connection con1; |
| 29 |
reap; |
| 30 |
#UNINSTALL COMPONENT "file://component_test_status_var_service_int"; |
| 31 |
#INSTALL COMPONENT "file://component_test_status_var_service_int"; |
| 32 |
|
| 33 |
connection con2; |
| 34 |
reap; |
| 35 |
|
| 36 |
connection default; |
| 37 |
disconnect con1; |
| 38 |
disconnect con2; |
| 39 |
UNINSTALL COMPONENT "file://component_test_status_var_service"; |
| 40 |
DROP USER 'testuser'@'localhost'; |
| 41 |
|
| 42 |
SET @@global.wait_timeout= @start_value; |
| 43 |
|
| 44 |
--disable_connect_log |
| 45 |
|
| 46 |
--echo ########## test_component_status_var_service.log: |
| 47 |
let $MYSQLD_DATADIR= `select @@datadir`; |
| 48 |
cat_file $MYSQLD_DATADIR/test_component_status_var_service.log; |
| 49 |
remove_file $MYSQLD_DATADIR/test_component_status_var_service.log; |
| 50 |
|
| 51 |
# Wait till all disconnects are completed |
| 52 |
--source include/wait_until_count_sessions.inc |