mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
MDEV-6720 - enable connection log in mysqltest by default
This commit is contained in:
@ -24,6 +24,7 @@ show grants for test_noprivs@localhost;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT, INSERT ON `priv_db`.* TO 'test_noprivs'@'localhost'
|
||||
connect yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
|
||||
|
||||
no trigger privilege on db level for create:
|
||||
--------------------------------------------
|
||||
@ -31,11 +32,13 @@ use priv_db;
|
||||
create trigger trg1_1 before INSERT on t1 for each row
|
||||
set new.f1 = 'trig 1_1-no';
|
||||
ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't1'
|
||||
connect no_privs,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
|
||||
use priv_db;
|
||||
insert into t1 (f1) values ('insert-yes');
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert-yes
|
||||
connection default;
|
||||
select current_user;
|
||||
current_user
|
||||
root@localhost
|
||||
@ -47,12 +50,14 @@ GRANT SELECT, TRIGGER ON `priv_db`.* TO 'test_yesprivs'@'localhost'
|
||||
|
||||
trigger privilege on db level for create:
|
||||
-----------------------------------------
|
||||
connection yes_privs;
|
||||
select current_user;
|
||||
current_user
|
||||
test_yesprivs@localhost
|
||||
use priv_db;
|
||||
create trigger trg1_2 before INSERT on t1 for each row
|
||||
set new.f1 = 'trig 1_2-yes';
|
||||
connection no_privs;
|
||||
select current_user;
|
||||
current_user
|
||||
test_noprivs@localhost
|
||||
@ -62,6 +67,7 @@ ERROR 42000: UPDATE command denied to user 'test_yesprivs'@'localhost' for colum
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert-yes
|
||||
connection default;
|
||||
select current_user;
|
||||
current_user
|
||||
root@localhost
|
||||
@ -72,6 +78,7 @@ select f1 from t1 order by f1;
|
||||
f1
|
||||
insert-yes
|
||||
trig 1_2-yes
|
||||
connection no_privs;
|
||||
select current_user;
|
||||
current_user
|
||||
test_noprivs@localhost
|
||||
@ -82,6 +89,7 @@ f1
|
||||
insert-yes
|
||||
trig 1_2-yes
|
||||
trig 1_2-yes
|
||||
connection default;
|
||||
select current_user;
|
||||
current_user
|
||||
root@localhost
|
||||
@ -93,12 +101,14 @@ GRANT SELECT, UPDATE ON `priv_db`.* TO 'test_yesprivs'@'localhost'
|
||||
|
||||
no trigger privilege on db level for drop:
|
||||
------------------------------------------
|
||||
connection yes_privs;
|
||||
select current_user;
|
||||
current_user
|
||||
test_yesprivs@localhost
|
||||
use priv_db;
|
||||
drop trigger trg1_2;
|
||||
ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't1'
|
||||
connection no_privs;
|
||||
select current_user;
|
||||
current_user
|
||||
test_noprivs@localhost
|
||||
@ -116,10 +126,12 @@ trig 1_2-yes
|
||||
|
||||
trigger privilege at activation time:
|
||||
-------------------------------------
|
||||
connection default;
|
||||
select current_user;
|
||||
current_user
|
||||
root@localhost
|
||||
grant TRIGGER on priv_db.* to test_yesprivs@localhost;
|
||||
connection no_privs;
|
||||
select current_user;
|
||||
current_user
|
||||
test_noprivs@localhost
|
||||
@ -134,6 +146,7 @@ trig 1_2-yes
|
||||
|
||||
trigger privilege on db level for drop:
|
||||
---------------------------------------
|
||||
connection yes_privs;
|
||||
select current_user;
|
||||
current_user
|
||||
test_yesprivs@localhost
|
||||
@ -148,6 +161,7 @@ takes effect after use priv_db:
|
||||
-------------------------------
|
||||
use priv_db;
|
||||
drop trigger trg1_2;
|
||||
connection default;
|
||||
select current_user;
|
||||
current_user
|
||||
root@localhost
|
||||
@ -174,6 +188,7 @@ GRANT SELECT, UPDATE ON `no_priv_db`.* TO 'test_yesprivs'@'localhost'
|
||||
|
||||
use db with trigger privilege on db level and without...:
|
||||
---------------------------------------------------------
|
||||
connection yes_privs;
|
||||
select current_user;
|
||||
current_user
|
||||
test_yesprivs@localhost
|
||||
@ -191,6 +206,7 @@ ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for tabl
|
||||
use priv_db;
|
||||
create trigger trg1_4 before UPDATE on t1 for each row
|
||||
set new.f1 = 'trig 1_4-yes';
|
||||
connection no_privs;
|
||||
select current_user;
|
||||
current_user
|
||||
test_noprivs@localhost
|
||||
@ -216,6 +232,8 @@ trig 1_2-yes
|
||||
trig 1_2-yes
|
||||
trig 1_3-yes
|
||||
trig 1_3-yes
|
||||
disconnect no_privs;
|
||||
connection yes_privs;
|
||||
select current_user;
|
||||
current_user
|
||||
test_yesprivs@localhost
|
||||
@ -229,6 +247,8 @@ drop trigger trg1_4;
|
||||
ERROR HY000: Trigger does not exist
|
||||
use priv_db;
|
||||
drop trigger trg1_4;
|
||||
disconnect yes_privs;
|
||||
connection default;
|
||||
select current_user;
|
||||
current_user
|
||||
root@localhost
|
||||
@ -251,9 +271,12 @@ revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
|
||||
create User test_noprivs@localhost;
|
||||
set password for test_noprivs@localhost = password('PWD');
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
|
||||
connect yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
|
||||
connect no_privs,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
|
||||
|
||||
no trigger privilege on table level for create:
|
||||
-----------------------------------------------
|
||||
connection default;
|
||||
select current_user;
|
||||
current_user
|
||||
root@localhost
|
||||
@ -269,6 +292,7 @@ show grants for test_noprivs@localhost;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
|
||||
connection yes_privs;
|
||||
select current_user;
|
||||
current_user
|
||||
test_yesprivs@localhost
|
||||
@ -279,6 +303,7 @@ t1
|
||||
create trigger trg1_1 before INSERT on t1 for each row
|
||||
set new.f1 = 'trig 1_1-no';
|
||||
ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't1'
|
||||
connection no_privs;
|
||||
select current_user;
|
||||
current_user
|
||||
test_noprivs@localhost
|
||||
@ -287,6 +312,7 @@ insert into t1 (f1) values ('insert1-yes');
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert1-yes
|
||||
connection default;
|
||||
select current_user;
|
||||
current_user
|
||||
root@localhost
|
||||
@ -308,6 +334,7 @@ GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'loca
|
||||
|
||||
trigger privilege on table level for create:
|
||||
--------------------------------------------
|
||||
connection yes_privs;
|
||||
select current_user;
|
||||
current_user
|
||||
test_yesprivs@localhost
|
||||
@ -315,6 +342,7 @@ show triggers;
|
||||
Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
|
||||
create trigger trg1_2 before INSERT on t1 for each row
|
||||
set new.f1 = 'trig 1_2-yes';
|
||||
connection no_privs;
|
||||
select current_user;
|
||||
current_user
|
||||
test_noprivs@localhost
|
||||
@ -324,6 +352,7 @@ f1
|
||||
insert1-yes
|
||||
insert2-yes
|
||||
trig 1_2-yes
|
||||
connection default;
|
||||
select current_user;
|
||||
current_user
|
||||
root@localhost
|
||||
@ -342,6 +371,7 @@ GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
|
||||
|
||||
no trigger privilege on table level for drop:
|
||||
---------------------------------------------
|
||||
connection yes_privs;
|
||||
select current_user;
|
||||
current_user
|
||||
test_yesprivs@localhost
|
||||
@ -350,6 +380,7 @@ ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for tabl
|
||||
|
||||
no trigger privilege at activation time:
|
||||
----------------------------------------
|
||||
connection no_privs;
|
||||
select current_user;
|
||||
current_user
|
||||
test_noprivs@localhost
|
||||
@ -361,6 +392,7 @@ insert1-yes
|
||||
insert2-yes
|
||||
trig 1_2-yes
|
||||
trig 1_2-yes
|
||||
connection default;
|
||||
select current_user;
|
||||
current_user
|
||||
root@localhost
|
||||
@ -368,6 +400,7 @@ grant TRIGGER on priv_db.t1 to test_yesprivs@localhost;
|
||||
|
||||
trigger privilege at activation time:
|
||||
-------------------------------------
|
||||
connection no_privs;
|
||||
select current_user;
|
||||
current_user
|
||||
test_noprivs@localhost
|
||||
@ -382,6 +415,7 @@ trig 1_2-yes
|
||||
|
||||
trigger privilege on table level for drop:
|
||||
------------------------------------------
|
||||
connection yes_privs;
|
||||
select current_user;
|
||||
current_user
|
||||
test_yesprivs@localhost
|
||||
@ -390,6 +424,7 @@ Grants for test_yesprivs@localhost
|
||||
GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
|
||||
drop trigger trg1_2;
|
||||
connection no_privs;
|
||||
select current_user;
|
||||
current_user
|
||||
test_noprivs@localhost
|
||||
@ -402,6 +437,7 @@ insert7-yes
|
||||
trig 1_2-yes
|
||||
trig 1_2-yes
|
||||
trig 1_2-yes
|
||||
connection default;
|
||||
select current_user;
|
||||
current_user
|
||||
root@localhost
|
||||
@ -434,6 +470,7 @@ GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t2` TO 'test_noprivs'@'localhost'
|
||||
|
||||
use table with trigger privilege and without...:
|
||||
------------------------------------------------
|
||||
connection yes_privs;
|
||||
select current_user;
|
||||
current_user
|
||||
test_yesprivs@localhost
|
||||
@ -451,6 +488,7 @@ show triggers;
|
||||
Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
|
||||
trg1_3 INSERT t1 set new.f1 = 'trig 1_3-yes' BEFORE NULL NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION test_yesprivs@localhost latin1 latin1_swedish_ci latin1_swedish_ci
|
||||
trg1_4 UPDATE t1 set new.f1 = 'trig 1_4-yes' BEFORE NULL NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION test_yesprivs@localhost latin1 latin1_swedish_ci latin1_swedish_ci
|
||||
connection no_privs;
|
||||
select current_user;
|
||||
current_user
|
||||
test_noprivs@localhost
|
||||
@ -469,6 +507,8 @@ trig 1_2-yes
|
||||
trig 1_2-yes
|
||||
trig 1_2-yes
|
||||
trig 1_3-yes
|
||||
disconnect no_privs;
|
||||
connection yes_privs;
|
||||
select current_user;
|
||||
current_user
|
||||
test_yesprivs@localhost
|
||||
@ -478,6 +518,8 @@ drop trigger trg1_3;
|
||||
drop trigger trg2_2;
|
||||
ERROR HY000: Trigger does not exist
|
||||
drop trigger trg1_4;
|
||||
disconnect yes_privs;
|
||||
connection default;
|
||||
select current_user;
|
||||
current_user
|
||||
root@localhost
|
||||
@ -509,6 +551,9 @@ grant SELECT,INSERT on *.* to test_noprivs@localhost;
|
||||
show grants for test_noprivs@localhost;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT SELECT, INSERT ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
connect yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
|
||||
connect no_privs,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
|
||||
connection yes_privs;
|
||||
select current_user;
|
||||
current_user
|
||||
test_yesprivs@localhost
|
||||
@ -532,6 +577,7 @@ f1
|
||||
trig 1_1-yes
|
||||
trig 1_1-yes
|
||||
drop trigger priv_db.trg1_5;
|
||||
connection no_privs;
|
||||
select current_user;
|
||||
current_user
|
||||
test_noprivs@localhost
|
||||
@ -542,6 +588,7 @@ f1
|
||||
trig 1_1-yes
|
||||
trig 1_1-yes
|
||||
trig 1_1-yes
|
||||
connection default;
|
||||
select current_user;
|
||||
current_user
|
||||
root@localhost
|
||||
@ -557,6 +604,8 @@ revoke TRIGGER on *.* from test_yesprivs@localhost;
|
||||
show grants for test_yesprivs@localhost;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
disconnect yes_privs;
|
||||
connect yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
|
||||
select current_user;
|
||||
current_user
|
||||
test_yesprivs@localhost
|
||||
@ -567,6 +616,7 @@ select * from information_schema.triggers;
|
||||
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
|
||||
drop trigger trg1_1;
|
||||
ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't1'
|
||||
connection default;
|
||||
select current_user;
|
||||
current_user
|
||||
root@localhost
|
||||
@ -579,12 +629,14 @@ use priv_db;
|
||||
|
||||
no trigger privilege on db level for create:
|
||||
--------------------------------------------
|
||||
connection yes_privs;
|
||||
select current_user;
|
||||
current_user
|
||||
test_yesprivs@localhost
|
||||
create trigger trg1_1 before INSERT on t1 for each row
|
||||
set new.f1 = 'trig 1_1-no';
|
||||
ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't1'
|
||||
connection no_privs;
|
||||
select current_user;
|
||||
current_user
|
||||
test_noprivs@localhost
|
||||
@ -597,6 +649,7 @@ trig 1_1-yes
|
||||
trig 1_1-yes
|
||||
trig 1_1-yes
|
||||
trig 1_1-yes
|
||||
connection default;
|
||||
select current_user;
|
||||
current_user
|
||||
root@localhost
|
||||
@ -608,6 +661,7 @@ GRANT TRIGGER ON `priv_db`.* TO 'test_yesprivs'@'localhost'
|
||||
|
||||
trigger privilege on db level for create:
|
||||
-----------------------------------------
|
||||
connection yes_privs;
|
||||
select current_user;
|
||||
current_user
|
||||
test_yesprivs@localhost
|
||||
@ -625,6 +679,7 @@ ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for tabl
|
||||
create trigger priv_db.trg1_9 before UPDATE on priv_db.t1
|
||||
for each row
|
||||
set new.f1 = 'trig 1_9-yes';
|
||||
connection no_privs;
|
||||
select current_user;
|
||||
current_user
|
||||
test_noprivs@localhost
|
||||
@ -645,6 +700,7 @@ f1
|
||||
insert-yes
|
||||
drop trigger priv_db.trg1_9;
|
||||
ERROR 42000: TRIGGER command denied to user 'test_noprivs'@'localhost' for table 't1'
|
||||
connection default;
|
||||
select current_user;
|
||||
current_user
|
||||
root@localhost
|
||||
@ -665,6 +721,7 @@ grant TRIGGER on *.* to test_yesprivs@localhost;
|
||||
show grants for test_yesprivs@localhost;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT ALL PRIVILEGES ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
connection yes_privs;
|
||||
select current_user;
|
||||
current_user
|
||||
test_yesprivs@localhost
|
||||
@ -672,6 +729,7 @@ use no_priv_db;
|
||||
create trigger trg1_2 before INSERT on t1 for each row
|
||||
set new.f1 = 'trig 1_2-no';
|
||||
ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't1'
|
||||
connection no_privs;
|
||||
select current_user;
|
||||
current_user
|
||||
test_noprivs@localhost
|
||||
@ -692,12 +750,16 @@ select f1 from t1 order by f1;
|
||||
f1
|
||||
insert-yes
|
||||
insert-yes
|
||||
disconnect yes_privs;
|
||||
connect yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
|
||||
select current_user;
|
||||
current_user
|
||||
test_yesprivs@localhost
|
||||
use no_priv_db;
|
||||
create trigger trg1_2 before INSERT on t1 for each row
|
||||
set new.f1 = 'trig 1_2-yes';
|
||||
disconnect yes_privs;
|
||||
connection no_privs;
|
||||
select current_user;
|
||||
current_user
|
||||
test_noprivs@localhost
|
||||
@ -720,6 +782,8 @@ f1
|
||||
insert-yes
|
||||
insert-yes
|
||||
trig 1_2-yes
|
||||
disconnect no_privs;
|
||||
connection default;
|
||||
select current_user;
|
||||
current_user
|
||||
root@localhost
|
||||
@ -760,11 +824,14 @@ Grants for test_noprivs@localhost
|
||||
GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT, INSERT, UPDATE ON `priv1_db`.* TO 'test_noprivs'@'localhost'
|
||||
GRANT SELECT, INSERT ON `priv2_db`.* TO 'test_noprivs'@'localhost'
|
||||
connect yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
|
||||
use priv1_db;
|
||||
connect no_privs,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
|
||||
use priv1_db;
|
||||
|
||||
trigger privilege on one db1 db level, not on db2
|
||||
-------------------------------------------------
|
||||
connection yes_privs;
|
||||
select current_user;
|
||||
current_user
|
||||
test_yesprivs@localhost
|
||||
@ -777,6 +844,7 @@ use priv2_db;
|
||||
create trigger trg1_1 before INSERT on t1 for each row
|
||||
set new.f1 = 'trig1_1-yes';
|
||||
ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't1'
|
||||
connection no_privs;
|
||||
select current_user;
|
||||
current_user
|
||||
test_noprivs@localhost
|
||||
@ -811,6 +879,7 @@ trig 2_1-yes
|
||||
|
||||
revoke trigger privilege on table level (not existing)
|
||||
------------------------------------------------------
|
||||
connection default;
|
||||
select current_user;
|
||||
current_user
|
||||
root@localhost
|
||||
@ -822,6 +891,7 @@ Grants for test_yesprivs@localhost
|
||||
GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT ALL PRIVILEGES ON `priv1_db`.* TO 'test_yesprivs'@'localhost'
|
||||
GRANT SELECT, UPDATE ON `priv2_db`.* TO 'test_yesprivs'@'localhost'
|
||||
connection yes_privs;
|
||||
select current_user;
|
||||
current_user
|
||||
test_yesprivs@localhost
|
||||
@ -832,6 +902,7 @@ ERROR HY000: Trigger does not exist
|
||||
use priv1_db;
|
||||
drop trigger trg1_1;
|
||||
drop trigger trg2_1;
|
||||
connection default;
|
||||
select current_user;
|
||||
current_user
|
||||
root@localhost
|
||||
@ -840,6 +911,7 @@ revoke TRIGGER on priv1_db.* from test_yesprivs@localhost;
|
||||
|
||||
no trigger privilege on table level for create:
|
||||
-----------------------------------------------
|
||||
connection yes_privs;
|
||||
select current_user;
|
||||
current_user
|
||||
test_yesprivs@localhost
|
||||
@ -847,6 +919,7 @@ use priv1_db;
|
||||
create trigger trg1_1 before INSERT on t1 for each row
|
||||
set new.f1 = 'trig 1_1-no';
|
||||
ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't1'
|
||||
connection default;
|
||||
select current_user;
|
||||
current_user
|
||||
root@localhost
|
||||
@ -862,6 +935,7 @@ GRANT TRIGGER ON `priv1_db`.`t1` TO 'test_yesprivs'@'localhost'
|
||||
|
||||
trigger privilege on table level for create:
|
||||
--------------------------------------------
|
||||
connection yes_privs;
|
||||
select current_user;
|
||||
current_user
|
||||
test_yesprivs@localhost
|
||||
@ -872,6 +946,7 @@ set new.f1 = 'trig 1_2-yes';
|
||||
create trigger trg2_1 before INSERT on t2 for each row
|
||||
set new.f1 = 'trig 2_1-no';
|
||||
ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't2'
|
||||
connection no_privs;
|
||||
select current_user;
|
||||
current_user
|
||||
test_noprivs@localhost
|
||||
@ -894,6 +969,7 @@ f1
|
||||
insert1_yes
|
||||
insert21-yes
|
||||
insert22-yes
|
||||
connection default;
|
||||
select current_user;
|
||||
current_user
|
||||
root@localhost
|
||||
@ -904,6 +980,7 @@ GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C4973
|
||||
GRANT ALL PRIVILEGES ON `priv1_db`.* TO 'test_yesprivs'@'localhost'
|
||||
GRANT SELECT, UPDATE ON `priv2_db`.* TO 'test_yesprivs'@'localhost'
|
||||
GRANT TRIGGER ON `priv1_db`.`t1` TO 'test_yesprivs'@'localhost'
|
||||
connection yes_privs;
|
||||
select current_user;
|
||||
current_user
|
||||
test_yesprivs@localhost
|
||||
@ -913,6 +990,7 @@ ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for tabl
|
||||
use priv1_db;
|
||||
create trigger trg2_1 before INSERT on t2 for each row
|
||||
set new.f1 = 'trig 2_1-yes';
|
||||
connection no_privs;
|
||||
select current_user;
|
||||
current_user
|
||||
test_noprivs@localhost
|
||||
@ -948,11 +1026,15 @@ trig 2_1-yes
|
||||
trig 2_1-yes
|
||||
trig 2_1-yes
|
||||
trig 2_1-yes
|
||||
disconnect no_privs;
|
||||
connection yes_privs;
|
||||
select current_user;
|
||||
current_user
|
||||
test_yesprivs@localhost
|
||||
drop trigger trg1_2;
|
||||
drop trigger trg2_1;
|
||||
disconnect yes_privs;
|
||||
connection default;
|
||||
select current_user;
|
||||
current_user
|
||||
root@localhost
|
||||
@ -973,6 +1055,8 @@ create User test_useprivs@localhost;
|
||||
set password for test_useprivs@localhost = password('PWD');
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_useprivs@localhost;
|
||||
connect yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
|
||||
connection default;
|
||||
select current_user;
|
||||
current_user
|
||||
root@localhost
|
||||
@ -987,6 +1071,7 @@ show grants for test_yesprivs@localhost;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
|
||||
connection yes_privs;
|
||||
select current_user;
|
||||
current_user
|
||||
test_yesprivs@localhost
|
||||
@ -1000,6 +1085,7 @@ select f1 from t1 order by f1;
|
||||
f1
|
||||
trig 1_1-yes
|
||||
prepare ins1 from 'insert into t1 (f1) values (''insert2-no'')';
|
||||
connect use_privs,localhost,test_useprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
|
||||
select current_user;
|
||||
current_user
|
||||
test_useprivs@localhost
|
||||
@ -1010,6 +1096,7 @@ select f1 from t1 order by f1;
|
||||
f1
|
||||
trig 1_1-yes
|
||||
trig 1_1-yes
|
||||
connection default;
|
||||
select current_user;
|
||||
current_user
|
||||
root@localhost
|
||||
@ -1018,6 +1105,7 @@ show grants for test_yesprivs@localhost;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
|
||||
connection yes_privs;
|
||||
select current_user;
|
||||
current_user
|
||||
test_yesprivs@localhost
|
||||
@ -1028,6 +1116,7 @@ f1
|
||||
trig 1_1-yes
|
||||
trig 1_1-yes
|
||||
prepare ins1 from 'insert into t1 (f1) values (''insert4-no'')';
|
||||
connection use_privs;
|
||||
select current_user;
|
||||
current_user
|
||||
test_useprivs@localhost
|
||||
@ -1038,6 +1127,7 @@ select f1 from t1 order by f1;
|
||||
f1
|
||||
trig 1_1-yes
|
||||
trig 1_1-yes
|
||||
connection default;
|
||||
select current_user;
|
||||
current_user
|
||||
root@localhost
|
||||
@ -1046,6 +1136,7 @@ show grants for test_yesprivs@localhost;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
|
||||
connection yes_privs;
|
||||
select current_user;
|
||||
current_user
|
||||
test_yesprivs@localhost
|
||||
@ -1056,6 +1147,7 @@ trig 1_1-yes
|
||||
trig 1_1-yes
|
||||
trig 1_1-yes
|
||||
prepare ins1 from 'insert into t1 (f1) values (''insert6-no'')';
|
||||
connection use_privs;
|
||||
select current_user;
|
||||
current_user
|
||||
test_useprivs@localhost
|
||||
@ -1067,6 +1159,7 @@ trig 1_1-yes
|
||||
trig 1_1-yes
|
||||
trig 1_1-yes
|
||||
prepare ins1 from 'insert into t1 (f1) values (''insert7-no'')';
|
||||
connection default;
|
||||
select current_user;
|
||||
current_user
|
||||
root@localhost
|
||||
@ -1075,6 +1168,7 @@ show grants for test_yesprivs@localhost;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
|
||||
connection yes_privs;
|
||||
select current_user;
|
||||
current_user
|
||||
test_yesprivs@localhost
|
||||
@ -1086,6 +1180,7 @@ trig 1_1-yes
|
||||
trig 1_1-yes
|
||||
trig 1_1-yes
|
||||
trig 1_1-yes
|
||||
connection use_privs;
|
||||
select current_user;
|
||||
current_user
|
||||
test_useprivs@localhost
|
||||
@ -1097,6 +1192,7 @@ trig 1_1-yes
|
||||
trig 1_1-yes
|
||||
trig 1_1-yes
|
||||
trig 1_1-yes
|
||||
connection default;
|
||||
select current_user;
|
||||
current_user
|
||||
root@localhost
|
||||
@ -1105,6 +1201,7 @@ show grants for test_yesprivs@localhost;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
|
||||
connection yes_privs;
|
||||
select current_user;
|
||||
current_user
|
||||
test_yesprivs@localhost
|
||||
@ -1116,6 +1213,7 @@ trig 1_1-yes
|
||||
trig 1_1-yes
|
||||
trig 1_1-yes
|
||||
trig 1_1-yes
|
||||
connection use_privs;
|
||||
select current_user;
|
||||
current_user
|
||||
test_useprivs@localhost
|
||||
@ -1128,6 +1226,7 @@ trig 1_1-yes
|
||||
trig 1_1-yes
|
||||
trig 1_1-yes
|
||||
trig 1_1-yes
|
||||
connection default;
|
||||
select current_user;
|
||||
current_user
|
||||
root@localhost
|
||||
@ -1136,6 +1235,7 @@ show grants for test_yesprivs@localhost;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
|
||||
connection yes_privs;
|
||||
select current_user;
|
||||
current_user
|
||||
test_yesprivs@localhost
|
||||
@ -1150,6 +1250,7 @@ trig 1_1-yes
|
||||
trig 1_1-yes
|
||||
trig 1_1-yes
|
||||
deallocate prepare ins1;
|
||||
connection use_privs;
|
||||
select current_user;
|
||||
current_user
|
||||
test_useprivs@localhost
|
||||
@ -1164,6 +1265,7 @@ trig 1_1-yes
|
||||
trig 1_1-yes
|
||||
trig 1_1-yes
|
||||
deallocate prepare ins1;
|
||||
connection default;
|
||||
select current_user;
|
||||
current_user
|
||||
root@localhost
|
||||
@ -1172,13 +1274,17 @@ show grants for test_yesprivs@localhost;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
|
||||
connection yes_privs;
|
||||
select current_user;
|
||||
current_user
|
||||
test_yesprivs@localhost
|
||||
drop trigger trg1_1;
|
||||
connection default;
|
||||
select current_user;
|
||||
current_user
|
||||
root@localhost
|
||||
disconnect yes_privs;
|
||||
connection default;
|
||||
select current_user;
|
||||
current_user
|
||||
root@localhost
|
||||
@ -1195,6 +1301,8 @@ create table t1 (f1 char(20)) engine= innodb;
|
||||
create User test_yesprivs@localhost;
|
||||
set password for test_yesprivs@localhost = password('PWD');
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
|
||||
connect yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
|
||||
connection default;
|
||||
select current_user;
|
||||
current_user
|
||||
root@localhost
|
||||
@ -1209,6 +1317,7 @@ before INSERT on t1 for each row
|
||||
set new.f1 = 'trig 1_0-yes';
|
||||
grant select, insert, update
|
||||
on priv_db.t1 to test_yesprivs@localhost;
|
||||
connection yes_privs;
|
||||
select current_user;
|
||||
current_user
|
||||
test_yesprivs@localhost
|
||||
@ -1219,6 +1328,7 @@ select f1 from t1 order by f1;
|
||||
f1
|
||||
drop trigger trg1_0;
|
||||
ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't1'
|
||||
connection default;
|
||||
select current_user;
|
||||
current_user
|
||||
root@localhost
|
||||
@ -1228,6 +1338,7 @@ show grants for test_yesprivs@localhost;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
|
||||
connection yes_privs;
|
||||
select current_user;
|
||||
current_user
|
||||
test_yesprivs@localhost
|
||||
@ -1256,11 +1367,13 @@ select f1 from t1 order by f1;
|
||||
f1
|
||||
trig 1_2-yes
|
||||
trig 1_2-yes
|
||||
connection default;
|
||||
select current_user;
|
||||
current_user
|
||||
root@localhost
|
||||
grant trigger on priv_db.* to test_yesprivs@localhost
|
||||
with grant option;
|
||||
connection yes_privs;
|
||||
select current_user;
|
||||
current_user
|
||||
test_yesprivs@localhost
|
||||
@ -1273,9 +1386,12 @@ create definer=not_ex_user@localhost trigger trg1_3
|
||||
after UPDATE on t1 for each row
|
||||
set @var1 = 'trig 1_3-yes';
|
||||
ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
|
||||
connection default;
|
||||
select current_user;
|
||||
current_user
|
||||
root@localhost
|
||||
disconnect yes_privs;
|
||||
connection default;
|
||||
select current_user;
|
||||
current_user
|
||||
root@localhost
|
||||
@ -1291,6 +1407,8 @@ create table t1 (f1 char(20)) engine= innodb;
|
||||
create User test_yesprivs@localhost;
|
||||
set password for test_yesprivs@localhost = password('PWD');
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
|
||||
connect yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
|
||||
connection default;
|
||||
select current_user;
|
||||
current_user
|
||||
root@localhost
|
||||
@ -1300,6 +1418,7 @@ show grants for test_yesprivs@localhost;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
|
||||
connection yes_privs;
|
||||
select current_user;
|
||||
current_user
|
||||
test_yesprivs@localhost
|
||||
@ -1329,9 +1448,12 @@ ERROR HY000: Trigger does not exist
|
||||
drop trigger trg1_2;
|
||||
commit work;
|
||||
set autocommit=1;
|
||||
connection default;
|
||||
select current_user;
|
||||
current_user
|
||||
root@localhost
|
||||
disconnect yes_privs;
|
||||
connection default;
|
||||
select current_user;
|
||||
current_user
|
||||
root@localhost
|
||||
@ -1362,9 +1484,12 @@ show grants for test_noprivs@localhost;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT, UPDATE ON `priv_db`.* TO 'test_noprivs'@'localhost'
|
||||
connect yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
|
||||
connect no_privs,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
|
||||
|
||||
update only on column:
|
||||
----------------------
|
||||
connection default;
|
||||
select current_user;
|
||||
current_user
|
||||
root@localhost
|
||||
@ -1372,6 +1497,7 @@ grant SELECT(f1),INSERT,UPDATE(f1) on priv_db.t1
|
||||
to test_yesprivs@localhost;
|
||||
grant SELECT(f1),INSERT,UPDATE(f1) on priv_db.t2
|
||||
to test_yesprivs@localhost;
|
||||
connection yes_privs;
|
||||
select current_user;
|
||||
current_user
|
||||
test_yesprivs@localhost
|
||||
@ -1382,6 +1508,7 @@ create trigger trg1_1 before UPDATE on t1 for each row
|
||||
set new.f1 = 'trig 1_1-yes';
|
||||
create trigger trg2_1 before UPDATE on t2 for each row
|
||||
set new.f1 = 'trig 2_1-yes';
|
||||
connection no_privs;
|
||||
select current_user;
|
||||
current_user
|
||||
test_noprivs@localhost
|
||||
@ -1402,6 +1529,7 @@ update t2 set f1 = 'update1_no'
|
||||
select f1 from t2 order by f1;
|
||||
f1
|
||||
trig 2_1-yes
|
||||
connection default;
|
||||
select current_user;
|
||||
current_user
|
||||
root@localhost
|
||||
@ -1415,12 +1543,14 @@ GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C4973
|
||||
GRANT TRIGGER ON `priv_db`.* TO 'test_yesprivs'@'localhost'
|
||||
GRANT SELECT (f1), INSERT ON `priv_db`.`t2` TO 'test_yesprivs'@'localhost'
|
||||
GRANT SELECT (f1), INSERT, UPDATE (f1) ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
|
||||
connection yes_privs;
|
||||
select current_user;
|
||||
current_user
|
||||
test_yesprivs@localhost
|
||||
use priv_db;
|
||||
insert into t1 (f1) values ('insert2-yes');
|
||||
insert into t2 (f1) values ('insert2-yes');
|
||||
connection no_privs;
|
||||
select current_user;
|
||||
current_user
|
||||
test_noprivs@localhost
|
||||
@ -1446,6 +1576,7 @@ trig 2_1-yes
|
||||
|
||||
check if access only on one of three columns
|
||||
--------------------------------------------
|
||||
connection default;
|
||||
select current_user;
|
||||
current_user
|
||||
root@localhost
|
||||
@ -1453,6 +1584,7 @@ alter table priv_db.t1 add f2 char(20), add f3 int;
|
||||
revoke TRIGGER on priv_db.* from test_yesprivs@localhost;
|
||||
grant TRIGGER,SELECT on priv_db.t1 to test_yesprivs@localhost;
|
||||
grant UPDATE on priv_db.t2 to test_yesprivs@localhost;
|
||||
connection yes_privs;
|
||||
select current_user;
|
||||
current_user
|
||||
test_yesprivs@localhost
|
||||
@ -1465,6 +1597,7 @@ insert2-yes insert2-yes 1
|
||||
insert3-yes insert3-yes 2
|
||||
trig 1_1-yes NULL NULL
|
||||
trig 1_1-yes NULL NULL
|
||||
connection no_privs;
|
||||
select current_user;
|
||||
current_user
|
||||
test_noprivs@localhost
|
||||
@ -1479,11 +1612,13 @@ trig 1_1-yes NULL NULL
|
||||
trig 1_1-yes NULL NULL
|
||||
trig 1_1-yes update4-yes 10
|
||||
trig 1_1-yes update4-yes 20
|
||||
connection yes_privs;
|
||||
select current_user;
|
||||
current_user
|
||||
test_yesprivs@localhost
|
||||
create trigger trg1_2 after UPDATE on t1 for each row
|
||||
set @f2 = 'trig 1_2-yes';
|
||||
connection no_privs;
|
||||
select current_user;
|
||||
current_user
|
||||
test_noprivs@localhost
|
||||
@ -1522,10 +1657,12 @@ trig 2_1-yes
|
||||
|
||||
check if rejected without trigger privilege:
|
||||
--------------------------------------------
|
||||
connection default;
|
||||
select current_user;
|
||||
current_user
|
||||
root@localhost
|
||||
revoke TRIGGER on priv_db.t1 from test_yesprivs@localhost;
|
||||
connection no_privs;
|
||||
select current_user;
|
||||
current_user
|
||||
test_noprivs@localhost
|
||||
@ -1545,6 +1682,7 @@ trig 1_2-yes
|
||||
|
||||
check trigger, but not update privilege on column:
|
||||
--------------------------------------------------
|
||||
connection default;
|
||||
select current_user;
|
||||
current_user
|
||||
root@localhost
|
||||
@ -1556,6 +1694,7 @@ Grants for test_yesprivs@localhost
|
||||
GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT (f1), INSERT, UPDATE ON `priv_db`.`t2` TO 'test_yesprivs'@'localhost'
|
||||
GRANT SELECT, SELECT (f1), INSERT, UPDATE (f3, f2), TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
|
||||
connection yes_privs;
|
||||
select current_user;
|
||||
current_user
|
||||
test_yesprivs@localhost
|
||||
@ -1563,6 +1702,7 @@ use priv_db;
|
||||
drop trigger trg1_1;
|
||||
create trigger trg1_3 before UPDATE on t1 for each row
|
||||
set new.f1 = 'trig 1_3-yes';
|
||||
connection no_privs;
|
||||
select current_user;
|
||||
current_user
|
||||
test_noprivs@localhost
|
||||
@ -1585,6 +1725,7 @@ NULL
|
||||
NULL
|
||||
10
|
||||
20
|
||||
connection default;
|
||||
select current_user;
|
||||
current_user
|
||||
root@localhost
|
||||
@ -1596,6 +1737,7 @@ Grants for test_yesprivs@localhost
|
||||
GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT (f1), INSERT, UPDATE ON `priv_db`.`t2` TO 'test_yesprivs'@'localhost'
|
||||
GRANT SELECT, SELECT (f1), INSERT, UPDATE (f3, f2, f1) ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
|
||||
connection no_privs;
|
||||
select current_user;
|
||||
current_user
|
||||
test_noprivs@localhost
|
||||
@ -1613,6 +1755,9 @@ NULL
|
||||
------------------------------------------------
|
||||
grant TRIGGER(f1) on priv_db.t1 to test_yesprivs@localhost;
|
||||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '(f1) on priv_db.t1 to test_yesprivs@localhost' at line 1
|
||||
disconnect yes_privs;
|
||||
disconnect no_privs;
|
||||
connection default;
|
||||
select current_user;
|
||||
current_user
|
||||
root@localhost
|
||||
|
Reference in New Issue
Block a user