memory_trig_03.result

来自「这个文件是windows mysql源码」· RESULT 代码 · 共 696 行 · 第 1/2 页

RESULT
696
字号
USE test;drop table if exists tb3;create table tb3 (f118 char not null DEFAULT 'a',f119 char binary not null DEFAULT b'101',f120 char ascii not null DEFAULT b'101',f121 char(50),f122 char(50),f129 binary not null DEFAULT b'101',f130 tinyint not null DEFAULT 99,f131 tinyint unsigned not null DEFAULT 99,f132 tinyint zerofill not null DEFAULT 99,f133 tinyint unsigned zerofill not null DEFAULT 99,f134 smallint not null DEFAULT 999,f135 smallint unsigned not null DEFAULT 999,f136 smallint zerofill not null DEFAULT 999,f137 smallint unsigned zerofill not null DEFAULT 999,f138 mediumint not null DEFAULT 9999,f139 mediumint unsigned not null DEFAULT 9999,f140 mediumint zerofill not null DEFAULT 9999,f141 mediumint unsigned zerofill not null DEFAULT 9999,f142 int not null DEFAULT 99999,f143 int unsigned not null DEFAULT 99999,f144 int zerofill not null DEFAULT 99999,f145 int unsigned zerofill not null DEFAULT 99999,f146 bigint not null DEFAULT 999999,f147 bigint unsigned not null DEFAULT 999999,f148 bigint zerofill not null DEFAULT 999999,f149 bigint unsigned zerofill not null DEFAULT 999999,f150 decimal not null DEFAULT 999.999,f151 decimal unsigned not null DEFAULT 999.17,f152 decimal zerofill not null DEFAULT 999.999,f153 decimal unsigned zerofill,f154 decimal (0),f155 decimal (64),f156 decimal (0) unsigned,f157 decimal (64) unsigned,f158 decimal (0) zerofill,f159 decimal (64) zerofill,f160 decimal (0) unsigned zerofill,f161 decimal (64) unsigned zerofill,f162 decimal (0,0),f163 decimal (63,30),f164 decimal (0,0) unsigned,f165 decimal (63,30) unsigned,f166 decimal (0,0) zerofill,f167 decimal (63,30) zerofill,f168 decimal (0,0) unsigned zerofill,f169 decimal (63,30) unsigned zerofill,f170 numeric,f171 numeric unsigned,f172 numeric zerofill,f173 numeric unsigned zerofill,f174 numeric (0),f175 numeric (64)) engine = <engine_to_be_used>;Warnings:Note	1265	Data truncated for column 'f150' at row 1Note	1265	Data truncated for column 'f151' at row 1Note	1265	Data truncated for column 'f152' at row 1Testcase 3.5.3:---------------drop database if exists priv_db;create database priv_db;use priv_db;create table t1 (f1 char(20)) engine= <engine_to_be_used>;create User test_noprivs@localhost;set password for test_noprivs@localhost = password('PWD');create User test_yesprivs@localhost;set password for test_yesprivs@localhost = password('PWD');Testcase 3.5.3.2/6:-------------------revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;grant ALL  on *.* to test_noprivs@localhost;revoke SUPER  on *.* from test_noprivs@localhost;show grants for test_noprivs@localhost;Grants for test_noprivs@localhostGRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;grant SUPER on *.* to test_yesprivs@localhost;grant SELECT on priv_db.t1 to test_yesprivs@localhost;show grants for test_yesprivs@localhost;Grants for test_yesprivs@localhostGRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'GRANT SELECT ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'connect(localhost,test_noprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);connect(localhost,test_yesprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);Testcase 3.5.3.2:-----------------select current_user;current_usertest_noprivs@localhostuse priv_db;create trigger trg1_1 before INSERT on t1 for each rowset new.f1 = 'trig 3.5.3.2_1-no';ERROR 42000: Access denied; you need the SUPER privilege for this operationuse priv_db;insert into t1 (f1) values ('insert 3.5.3.2-no');select f1 from t1 order by f1;f1insert 3.5.3.2-noselect current_user;current_usertest_yesprivs@localhostuse priv_db;create trigger trg1_2 before INSERT  on t1 for each rowset new.f1 = 'trig 3.5.3.2_2-yes';select current_user;current_userroot@localhostuse priv_db;insert into t1 (f1) values ('insert 3.5.3.2-yes');ERROR 42000: UPDATE command denied to user 'test_yesprivs'@'localhost' for column 'f1' in table 't1'select f1 from t1 order by f1;f1insert 3.5.3.2-nogrant UPDATE on priv_db.t1 to test_yesprivs@localhost;insert into t1 (f1) values ('insert 3.5.3.2-yes');select f1 from t1 order by f1;f1insert 3.5.3.2-notrig 3.5.3.2_2-yesTestcase 3.5.3.6:-----------------use priv_db;drop trigger trg1_2;ERROR 42000: Access denied; you need the SUPER privilege for this operationuse priv_db;insert into t1 (f1) values ('insert 3.5.3.6-yes');select f1 from t1 order by f1;f1insert 3.5.3.2-notrig 3.5.3.2_2-yestrig 3.5.3.2_2-yesuse priv_db;drop trigger trg1_2;use priv_db;insert into t1 (f1) values ('insert 3.5.3.6-no');select f1 from t1 order by f1;f1insert 3.5.3.2-noinsert 3.5.3.6-notrig 3.5.3.2_2-yestrig 3.5.3.2_2-yesdrop trigger trg1_2;Testcase 3.5.3.7a:------------------revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;grant ALL  on *.* to test_noprivs@localhost;revoke UPDATE  on *.* from test_noprivs@localhost;show grants for test_noprivs@localhost;Grants for test_noprivs@localhostGRANT SELECT, INSERT, 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 ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;grant SUPER, UPDATE on *.* to test_yesprivs@localhost;show grants for test_yesprivs@localhost;Grants for test_yesprivs@localhostGRANT UPDATE, SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'connect(localhost,test_noprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);connect(localhost,test_yesprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);select current_user;current_usertest_noprivs@localhostuse priv_db;show grants;Grants for test_noprivs@localhostGRANT SELECT, INSERT, 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 ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'select f1 from t1 order by f1;f1insert 3.5.3.2-noinsert 3.5.3.6-notrig 3.5.3.2_2-yestrig 3.5.3.2_2-yescreate trigger trg4a_1 before INSERT on t1 for each rowset new.f1 = 'trig 3.5.3.7-1a';insert into t1 (f1) values ('insert 3.5.3.7-1a');ERROR 42000: UPDATE command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'select f1 from t1 order by f1;f1insert 3.5.3.2-noinsert 3.5.3.6-notrig 3.5.3.2_2-yestrig 3.5.3.2_2-yesdrop trigger trg4a_1;use priv_db;select current_user;current_usertest_yesprivs@localhostshow grants;Grants for test_yesprivs@localhostGRANT UPDATE, SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'create trigger trg4a_2 before INSERT  on t1 for each rowset new.f1 = 'trig 3.5.3.7-2a';insert into t1 (f1) values ('insert 3.5.3.7-2b');select f1 from t1 order by f1;f1insert 3.5.3.2-noinsert 3.5.3.6-notrig 3.5.3.2_2-yestrig 3.5.3.2_2-yestrig 3.5.3.7-2adrop trigger trg4a_2;Testcase 3.5.3.7b:------------------revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;grant SUPER on *.* to test_noprivs;grant ALL  on priv_db.* to test_noprivs@localhost;revoke UPDATE  on priv_db.* from test_noprivs@localhost;show grants for test_noprivs;Grants for test_noprivs@%GRANT SUPER ON *.* TO 'test_noprivs'@'%'revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;grant SUPER on *.* to test_yesprivs@localhost;grant UPDATE on priv_db.* to test_yesprivs@localhost;show grants for test_yesprivs@localhost;Grants for test_yesprivs@localhostGRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'GRANT UPDATE ON `priv_db`.* TO 'test_yesprivs'@'localhost'connect(localhost,test_noprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);connect(localhost,test_yesprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);show grants;Grants for test_noprivs@localhostGRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE ON `priv_db`.* TO 'test_noprivs'@'localhost'use priv_db;create trigger trg4b_1 before UPDATE on t1 for each rowset new.f1 = 'trig 3.5.3.7-1b';ERROR 42000: Access denied; you need the SUPER privilege for this operationinsert into t1 (f1) values ('insert 3.5.3.7-1b');select f1 from t1 order by f1;f1insert 3.5.3.2-noinsert 3.5.3.6-noinsert 3.5.3.7-1btrig 3.5.3.2_2-yestrig 3.5.3.2_2-yestrig 3.5.3.7-2aupdate t1 set  f1 = 'update 3.5.3.7-1b' where f1 = 'insert 3.5.3.7-1b';select f1 from t1 order by f1;f1insert 3.5.3.2-noinsert 3.5.3.6-notrig 3.5.3.2_2-yestrig 3.5.3.2_2-yestrig 3.5.3.7-2aupdate 3.5.3.7-1bdrop trigger trg4b_1;ERROR HY000: Trigger does not existshow grants;Grants for test_yesprivs@localhostGRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'GRANT UPDATE ON `priv_db`.* TO 'test_yesprivs'@'localhost'use priv_db;create trigger trg4b_2 before UPDATE  on t1 for each rowset new.f1 = 'trig 3.5.3.7-2b';insert into t1 (f1) values ('insert 3.5.3.7-2b');select f1 from t1 order by f1;f1insert 3.5.3.2-noinsert 3.5.3.6-noinsert 3.5.3.7-2btrig 3.5.3.2_2-yestrig 3.5.3.2_2-yestrig 3.5.3.7-2aupdate 3.5.3.7-1bupdate t1 set  f1 = 'update 3.5.3.7-2b' where f1 = 'insert 3.5.3.7-2b';select f1 from t1 order by f1;f1insert 3.5.3.2-noinsert 3.5.3.6-notrig 3.5.3.2_2-yestrig 3.5.3.2_2-yestrig 3.5.3.7-2atrig 3.5.3.7-2bupdate 3.5.3.7-1bdrop trigger trg4b_2;Testcase 3.5.3.7c-----------------revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;grant SUPER on *.* to test_noprivs@localhost;grant ALL  on priv_db.t1 to test_noprivs@localhost;revoke UPDATE  on priv_db.t1 from test_noprivs@localhost;show grants for test_noprivs;Grants for test_noprivs@%GRANT SUPER ON *.* TO 'test_noprivs'@'%'revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;grant SUPER on *.* to test_yesprivs@localhost;grant UPDATE on priv_db.t1 to test_yesprivs@localhost;show grants for test_yesprivs@localhost;Grants for test_yesprivs@localhostGRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'GRANT UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'connect(localhost,test_noprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);connect(localhost,test_yesprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);show grants;Grants for test_noprivs@localhostGRANT SUPER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'use priv_db;create trigger trg4c_1 before INSERT on t1 for each rowset new.f1 = 'trig 3.5.3.7-1c';insert into t1 (f1) values ('insert 3.5.3.7-1c');ERROR 42000: UPDATE command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'select f1 from t1 order by f1;f1insert 3.5.3.2-noinsert 3.5.3.6-notrig 3.5.3.2_2-yestrig 3.5.3.2_2-yestrig 3.5.3.7-2atrig 3.5.3.7-2bupdate 3.5.3.7-1bdrop trigger trg4c_1;show grants;Grants for test_yesprivs@localhostGRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'GRANT UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'use priv_db;create trigger trg4c_2 before INSERT  on t1 for each rowset new.f1 = 'trig 3.5.3.7-2c';insert into t1 (f1) values ('insert 3.5.3.7-2c');select f1 from t1 order by f1;f1insert 3.5.3.2-noinsert 3.5.3.6-notrig 3.5.3.2_2-yestrig 3.5.3.2_2-yestrig 3.5.3.7-2atrig 3.5.3.7-2btrig 3.5.3.7-2cupdate 3.5.3.7-1bdrop trigger trg4c_2;Testcase 3.5.3.7d:------------------revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;grant SUPER on *.* to test_noprivs@localhost;grant SELECT (f1), INSERT (f1) on priv_db.t1 to test_noprivs@localhost;show grants for test_noprivs;Grants for test_noprivs@%GRANT SUPER ON *.* TO 'test_noprivs'@'%'

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?