mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
perfschema compilation, test and misc fixes
This commit is contained in:
@@ -8,66 +8,73 @@ insert into performance_schema.setup_actors
|
||||
values ('localhost', 'user2', '%', 'NO', 'NO');
|
||||
set @orig_sql_mode= @@sql_mode;
|
||||
set sql_mode= (select replace(@@sql_mode,'NO_AUTO_CREATE_USER',''));
|
||||
Warnings:
|
||||
Warning 3090 Changing sql mode 'NO_AUTO_CREATE_USER' is deprecated. It will be removed in a future release.
|
||||
grant ALL on *.* to user1@localhost;
|
||||
Warnings:
|
||||
Warning 1287 Using GRANT for creating new user is deprecated and will be removed in future release. Create new user with CREATE USER statement.
|
||||
grant ALL on *.* to user2@localhost;
|
||||
Warnings:
|
||||
Warning 1287 Using GRANT for creating new user is deprecated and will be removed in future release. Create new user with CREATE USER statement.
|
||||
set sql_mode= @orig_sql_mode;
|
||||
Warnings:
|
||||
Warning 3090 Changing sql mode 'NO_AUTO_CREATE_USER' is deprecated. It will be removed in a future release.
|
||||
flush privileges;
|
||||
# Switch to (con1, localhost, user1, , )
|
||||
connect con1, localhost, user1, , ;
|
||||
select NAME, TYPE, INSTRUMENTED, PROCESSLIST_USER, PROCESSLIST_HOST
|
||||
from performance_schema.threads
|
||||
where PROCESSLIST_ID = connection_id();
|
||||
NAME TYPE INSTRUMENTED PROCESSLIST_USER PROCESSLIST_HOST
|
||||
thread/sql/one_connection FOREGROUND YES user1 localhost
|
||||
# Switch to (con2, localhost, user2, , )
|
||||
connect con2, localhost, user2, , ;
|
||||
select NAME, TYPE, INSTRUMENTED, PROCESSLIST_USER, PROCESSLIST_HOST
|
||||
from performance_schema.threads
|
||||
where PROCESSLIST_ID = connection_id();
|
||||
NAME TYPE INSTRUMENTED PROCESSLIST_USER PROCESSLIST_HOST
|
||||
thread/sql/one_connection FOREGROUND NO user2 localhost
|
||||
# Switch to connection default
|
||||
connection default;
|
||||
update performance_schema.setup_actors set ENABLED='NO' where USER='user1';
|
||||
update performance_schema.setup_actors set ENABLED='YES' where USER='user2';
|
||||
# Switch to connection con1
|
||||
connection con1;
|
||||
select NAME, TYPE, INSTRUMENTED, PROCESSLIST_USER, PROCESSLIST_HOST
|
||||
from performance_schema.threads
|
||||
where PROCESSLIST_ID = connection_id();
|
||||
NAME TYPE INSTRUMENTED PROCESSLIST_USER PROCESSLIST_HOST
|
||||
thread/sql/one_connection FOREGROUND YES user1 localhost
|
||||
# Switch to connection con2
|
||||
connection con2;
|
||||
select NAME, TYPE, INSTRUMENTED, PROCESSLIST_USER, PROCESSLIST_HOST
|
||||
from performance_schema.threads
|
||||
where PROCESSLIST_ID = connection_id();
|
||||
NAME TYPE INSTRUMENTED PROCESSLIST_USER PROCESSLIST_HOST
|
||||
thread/sql/one_connection FOREGROUND NO user2 localhost
|
||||
# Disconnect con1 and con2
|
||||
disconnect con1;
|
||||
disconnect con2;
|
||||
# Switch to (con1, localhost, user1, , )
|
||||
connect con1, localhost, user1, , ;
|
||||
select NAME, TYPE, INSTRUMENTED, PROCESSLIST_USER, PROCESSLIST_HOST
|
||||
from performance_schema.threads
|
||||
where PROCESSLIST_ID = connection_id();
|
||||
NAME TYPE INSTRUMENTED PROCESSLIST_USER PROCESSLIST_HOST
|
||||
thread/sql/one_connection FOREGROUND NO user1 localhost
|
||||
# Switch to (con2 localhost, user2, , )
|
||||
connect con2, localhost, user2, , ;
|
||||
select NAME, TYPE, INSTRUMENTED, PROCESSLIST_USER, PROCESSLIST_HOST
|
||||
from performance_schema.threads
|
||||
where PROCESSLIST_ID = connection_id();
|
||||
NAME TYPE INSTRUMENTED PROCESSLIST_USER PROCESSLIST_HOST
|
||||
thread/sql/one_connection FOREGROUND YES user2 localhost
|
||||
# Disconnect con1 and con2
|
||||
disconnect con1;
|
||||
disconnect con2;
|
||||
# Switch to connection default
|
||||
connection default;
|
||||
revoke update on *.* from 'user2'@'localhost';
|
||||
flush privileges;
|
||||
# Switch to (con2 localhost, user2, , )
|
||||
connect con2, localhost, user2, , ;
|
||||
update performance_schema.setup_actors
|
||||
set ENABLED='NO';
|
||||
ERROR 42000: UPDATE command denied to user 'user2'@'localhost' for table 'setup_actors'
|
||||
disconnect con2;
|
||||
connection default;
|
||||
insert into performance_schema.setup_actors
|
||||
values ('%', 'user1', '%', 'YES', 'YES');
|
||||
insert into performance_schema.setup_actors
|
||||
@@ -75,35 +82,47 @@ values ('localhost', '%', '%', 'NO', 'NO');
|
||||
insert into performance_schema.setup_actors
|
||||
values ('%', '%', '%', 'YES', 'YES');
|
||||
# Switch to (con1, localhost, user1, , )
|
||||
connect con1, localhost, user1, , ;
|
||||
select NAME, TYPE, INSTRUMENTED, PROCESSLIST_USER, PROCESSLIST_HOST
|
||||
from performance_schema.threads
|
||||
where PROCESSLIST_ID = connection_id();
|
||||
NAME TYPE INSTRUMENTED PROCESSLIST_USER PROCESSLIST_HOST
|
||||
thread/sql/one_connection FOREGROUND NO user1 localhost
|
||||
disconnect con1;
|
||||
connection default;
|
||||
delete from performance_schema.setup_actors where
|
||||
HOST='localhost' and USER='user1';
|
||||
# Switch to (con1, localhost, user1, , )
|
||||
connect con1, localhost, user1, , ;
|
||||
select NAME, TYPE, INSTRUMENTED, PROCESSLIST_USER, PROCESSLIST_HOST
|
||||
from performance_schema.threads
|
||||
where PROCESSLIST_ID = connection_id();
|
||||
NAME TYPE INSTRUMENTED PROCESSLIST_USER PROCESSLIST_HOST
|
||||
thread/sql/one_connection FOREGROUND YES user1 localhost
|
||||
disconnect con1;
|
||||
connection default;
|
||||
delete from performance_schema.setup_actors where
|
||||
HOST='%' and USER='user1';
|
||||
# Switch to (con1, localhost, user1, , )
|
||||
connect con1, localhost, user1, , ;
|
||||
select NAME, TYPE, INSTRUMENTED, PROCESSLIST_USER, PROCESSLIST_HOST
|
||||
from performance_schema.threads
|
||||
where PROCESSLIST_ID = connection_id();
|
||||
NAME TYPE INSTRUMENTED PROCESSLIST_USER PROCESSLIST_HOST
|
||||
thread/sql/one_connection FOREGROUND NO user1 localhost
|
||||
disconnect con1;
|
||||
connection default;
|
||||
delete from performance_schema.setup_actors where
|
||||
HOST='localhost' and USER='%';
|
||||
# Switch to (con1, localhost, user1, , )
|
||||
connect con1, localhost, user1, , ;
|
||||
select NAME, TYPE, INSTRUMENTED, PROCESSLIST_USER, PROCESSLIST_HOST
|
||||
from performance_schema.threads
|
||||
where PROCESSLIST_ID = connection_id();
|
||||
NAME TYPE INSTRUMENTED PROCESSLIST_USER PROCESSLIST_HOST
|
||||
thread/sql/one_connection FOREGROUND YES user1 localhost
|
||||
disconnect con1;
|
||||
connection default;
|
||||
revoke all privileges, grant option from user1@localhost;
|
||||
revoke all privileges, grant option from user2@localhost;
|
||||
drop user user1@localhost;
|
||||
|
Reference in New Issue
Block a user