mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Fix a bad BitKeeper dependency structure for the "funcs_1" suite:
Step 2: Restore the 5.1 contents in the 5.0-dependent files. mysql-test/suite/funcs_1/cursors/cursors_master.test: Restore the 5.1 contents in the 5.0-dependent file. mysql-test/suite/funcs_1/datadict/datadict_master.inc: Restore the 5.1 contents in the 5.0-dependent file. mysql-test/suite/funcs_1/datadict/datadict_tables.inc: Restore the 5.1 contents in the 5.0-dependent file. mysql-test/suite/funcs_1/r/innodb__datadict.result: Restore the 5.1 contents in the 5.0-dependent file. mysql-test/suite/funcs_1/r/innodb_func_view.result: Restore the 5.1 contents in the 5.0-dependent file. mysql-test/suite/funcs_1/r/innodb_storedproc.result: Restore the 5.1 contents in the 5.0-dependent file. mysql-test/suite/funcs_1/r/innodb_storedproc_02.result: Restore the 5.1 contents in the 5.0-dependent file. mysql-test/suite/funcs_1/r/innodb_storedproc_10.result: Restore the 5.1 contents in the 5.0-dependent file. mysql-test/suite/funcs_1/r/innodb_trig_0102.result: Restore the 5.1 contents in the 5.0-dependent file. mysql-test/suite/funcs_1/r/innodb_trig_03.result: Restore the 5.1 contents in the 5.0-dependent file. mysql-test/suite/funcs_1/r/innodb_trig_0407.result: Restore the 5.1 contents in the 5.0-dependent file. mysql-test/suite/funcs_1/r/innodb_trig_08.result: Restore the 5.1 contents in the 5.0-dependent file. mysql-test/suite/funcs_1/r/innodb_trig_09.result: Restore the 5.1 contents in the 5.0-dependent file. mysql-test/suite/funcs_1/r/innodb_trig_1011ext.result: Restore the 5.1 contents in the 5.0-dependent file. mysql-test/suite/funcs_1/r/innodb_trig_frkey.result: Restore the 5.1 contents in the 5.0-dependent file. mysql-test/suite/funcs_1/r/innodb_views.result: Restore the 5.1 contents in the 5.0-dependent file. mysql-test/suite/funcs_1/r/memory__datadict.result: Restore the 5.1 contents in the 5.0-dependent file. mysql-test/suite/funcs_1/r/memory_func_view.result: Restore the 5.1 contents in the 5.0-dependent file. mysql-test/suite/funcs_1/r/memory_storedproc.result: Restore the 5.1 contents in the 5.0-dependent file. mysql-test/suite/funcs_1/r/memory_storedproc_02.result: Restore the 5.1 contents in the 5.0-dependent file. mysql-test/suite/funcs_1/r/memory_storedproc_10.result: Restore the 5.1 contents in the 5.0-dependent file. mysql-test/suite/funcs_1/r/memory_trig_0102.result: Restore the 5.1 contents in the 5.0-dependent file. mysql-test/suite/funcs_1/r/memory_trig_03.result: Restore the 5.1 contents in the 5.0-dependent file. mysql-test/suite/funcs_1/r/memory_trig_0407.result: Restore the 5.1 contents in the 5.0-dependent file. mysql-test/suite/funcs_1/r/memory_trig_08.result: Restore the 5.1 contents in the 5.0-dependent file. mysql-test/suite/funcs_1/r/memory_trig_09.result: Restore the 5.1 contents in the 5.0-dependent file. mysql-test/suite/funcs_1/r/memory_trig_1011ext.result: Restore the 5.1 contents in the 5.0-dependent file. mysql-test/suite/funcs_1/r/memory_views.result: Restore the 5.1 contents in the 5.0-dependent file. mysql-test/suite/funcs_1/r/myisam__datadict.result: Restore the 5.1 contents in the 5.0-dependent file. mysql-test/suite/funcs_1/r/myisam_func_view.result: Restore the 5.1 contents in the 5.0-dependent file. mysql-test/suite/funcs_1/r/myisam_storedproc.result: Restore the 5.1 contents in the 5.0-dependent file. mysql-test/suite/funcs_1/r/myisam_storedproc_02.result: Restore the 5.1 contents in the 5.0-dependent file. mysql-test/suite/funcs_1/r/myisam_storedproc_10.result: Restore the 5.1 contents in the 5.0-dependent file. mysql-test/suite/funcs_1/r/myisam_trig_0102.result: Restore the 5.1 contents in the 5.0-dependent file. mysql-test/suite/funcs_1/r/myisam_trig_03.result: Restore the 5.1 contents in the 5.0-dependent file. mysql-test/suite/funcs_1/r/myisam_trig_0407.result: Restore the 5.1 contents in the 5.0-dependent file. mysql-test/suite/funcs_1/r/myisam_trig_08.result: Restore the 5.1 contents in the 5.0-dependent file. mysql-test/suite/funcs_1/r/myisam_trig_09.result: Restore the 5.1 contents in the 5.0-dependent file. mysql-test/suite/funcs_1/r/myisam_trig_1011ext.result: Restore the 5.1 contents in the 5.0-dependent file. mysql-test/suite/funcs_1/r/myisam_views.result: Restore the 5.1 contents in the 5.0-dependent file. mysql-test/suite/funcs_1/storedproc/storedproc_02.inc: Restore the 5.1 contents in the 5.0-dependent file. mysql-test/suite/funcs_1/storedproc/storedproc_10.inc: Restore the 5.1 contents in the 5.0-dependent file. mysql-test/suite/funcs_1/storedproc/storedproc_master.inc: Restore the 5.1 contents in the 5.0-dependent file. mysql-test/suite/funcs_1/triggers/triggers_0102.inc: Restore the 5.1 contents in the 5.0-dependent file. mysql-test/suite/funcs_1/triggers/triggers_03.inc: Restore the 5.1 contents in the 5.0-dependent file. mysql-test/suite/funcs_1/triggers/triggers_0407.inc: Restore the 5.1 contents in the 5.0-dependent file. mysql-test/suite/funcs_1/triggers/triggers_08.inc: Restore the 5.1 contents in the 5.0-dependent file. mysql-test/suite/funcs_1/triggers/triggers_09.inc: Restore the 5.1 contents in the 5.0-dependent file. mysql-test/suite/funcs_1/triggers/triggers_1011ext.inc: Restore the 5.1 contents in the 5.0-dependent file. mysql-test/suite/funcs_1/views/func_view.inc: Restore the 5.1 contents in the 5.0-dependent file. mysql-test/suite/funcs_1/views/views_master.inc: Restore the 5.1 contents in the 5.0-dependent file.
This commit is contained in:
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -166,7 +166,7 @@ declare y integer default 1;
|
||||
set @x = x;
|
||||
set @y = y;
|
||||
set @z = 234;
|
||||
SELECT f1, f2 into @x, @y from t2 limit 1;
|
||||
SELECT f1, f2 into @x, @y from t2 where f1='a`' and f2='a`' limit 1;
|
||||
SELECT @x, @y, @z, invar;
|
||||
BEGIN
|
||||
set @x = 2;
|
||||
@ -209,7 +209,7 @@ BEGIN
|
||||
declare x integer; declare y integer;
|
||||
set @x=x;
|
||||
set @y=y;
|
||||
SELECT f4, f3 into @x, @y from t2 limit 1;
|
||||
SELECT f4, f3 into @x, @y from t2 where f4=-5000 and f3='1000-01-01' limit 1;
|
||||
SELECT @x, @y;
|
||||
END//
|
||||
CALL sp1();
|
||||
@ -544,6 +544,9 @@ exit handler 2
|
||||
exit handler 2
|
||||
exit handler 1
|
||||
exit handler 1
|
||||
Warnings:
|
||||
Note 1051 Unknown table 'tqq'
|
||||
Note 1051 Unknown table 'tqq'
|
||||
create table res_t1(w char unique, x char);
|
||||
insert into res_t1 values ('a', 'b');
|
||||
CREATE PROCEDURE h1 ()
|
||||
@ -1084,7 +1087,8 @@ declare f2_value char(20);
|
||||
declare f5_value char(20);
|
||||
declare f4_value integer;
|
||||
declare f6_value integer;
|
||||
declare cur1 cursor for SELECT f1, f2, f4, f5, f6 from t2 limit 3;
|
||||
declare cur1 cursor for SELECT f1, f2, f4, f5, f6 from t2
|
||||
where f4 >=-5000 order by f4 limit 3;
|
||||
open cur1;
|
||||
while proceed do
|
||||
SELECT count AS 'loop';
|
||||
@ -1167,7 +1171,7 @@ of a compound statement ends.
|
||||
DROP TABLE IF EXISTS temp1;
|
||||
DROP PROCEDURE IF EXISTS sp1;
|
||||
create table temp1( f0 char(20), f1 char(20), f2 char(20), f3 int, f4 char(20) );
|
||||
SELECT f1, f2, f4, f5 from t2;
|
||||
SELECT f1, f2, f4, f5 from t2 order by f4;
|
||||
f1 f2 f4 f5
|
||||
a` a` -5000 a`
|
||||
aaa aaa -4999 aaa
|
||||
@ -1187,21 +1191,21 @@ declare newf1 char(20);
|
||||
declare newf2 char(20);
|
||||
declare newf5 char(20);
|
||||
declare newf4 integer;
|
||||
declare cur1 cursor for SELECT f1, f2, f4, f5 from t2 limit 5;
|
||||
declare cur2 cursor for SELECT f1, f2, f4, f5 from t2 limit 5;
|
||||
declare cur1 cursor for SELECT f1, f2, f4, f5 from t2 where f4 >= -5000 order by f4 limit 5;
|
||||
declare cur2 cursor for SELECT f1, f2, f4, f5 from t2 where f4 >= -5000 order by f4 limit 5;
|
||||
open cur1;
|
||||
open cur2;
|
||||
BEGIN
|
||||
declare continue handler for sqlstate '02000' set count = 1;
|
||||
declare continue handler for sqlstate '02000' set count=1;
|
||||
fetch cur1 into newf1, newf2, newf4, newf5;
|
||||
SELECT '-1-', count, newf1, newf2, newf4, newf5;
|
||||
insert into temp1 values ('cur1_out', newf1, newf2, newf4, newf5);
|
||||
set count = 4;
|
||||
set count= 4;
|
||||
BEGIN
|
||||
while count > 0 do
|
||||
while count> 0 do
|
||||
fetch cur1 into newf1, newf2, newf4, newf5;
|
||||
SELECT '-2-', count, newf1, newf2, newf4, newf5;
|
||||
set count = count - 1;
|
||||
set count = count- 1;
|
||||
END while;
|
||||
SELECT '-3-', count, newf1, newf2, newf4, newf4;
|
||||
END;
|
||||
@ -1270,8 +1274,10 @@ declare i_newf11 char(20);
|
||||
declare i_newf12 char(20);
|
||||
declare i_newf13 date;
|
||||
declare i_newf14 integer;
|
||||
declare cur1 cursor for SELECT f1, f2, f3, f4 from t2 limit 4;
|
||||
declare cur2 cursor for SELECT f1, f2, f3, f4 from t2 limit 3;
|
||||
declare cur1 cursor for SELECT f1, f2, f3, f4 from t2
|
||||
where f4>=-5000 order by f4 limit 4;
|
||||
declare cur2 cursor for SELECT f1, f2, f3, f4 from t2
|
||||
where f4>=-5000 order by f4 limit 3;
|
||||
declare continue handler for sqlstate '02000' set proceed=0;
|
||||
open cur1;
|
||||
open cur2;
|
||||
@ -1302,8 +1308,10 @@ DECLARE o_newf11 CHAR(20);
|
||||
DECLARE o_newf12 CHAR(20);
|
||||
DECLARE o_newf13 DATE;
|
||||
DECLARE o_newf14 INTEGER;
|
||||
DECLARE cur1 CURSOR FOR SELECT f1, f2, f3, f4 FROM t2 LIMIT 5;
|
||||
DECLARE cur2 CURSOR FOR SELECT f1, f2, f3, f4 FROM t2 LIMIT 5;
|
||||
DECLARE cur1 CURSOR FOR SELECT f1, f2, f3, f4 FROM t2
|
||||
WHERE f4>=-5000 ORDER BY f4 LIMIT 5;
|
||||
DECLARE cur2 CURSOR FOR SELECT f1, f2, f3, f4 FROM t2
|
||||
WHERE f4>=-5000 ORDER BY f4 LIMIT 5;
|
||||
DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET proceed=0;
|
||||
OPEN cur1;
|
||||
OPEN cur2;
|
||||
|
@ -80,7 +80,7 @@ connect(localhost,user_1,,db_storedproc,MYSQL_PORT,MYSQL_SOCK);
|
||||
user_1@localhost db_storedproc
|
||||
CREATE PROCEDURE sp31102 () SQL SECURITY INVOKER
|
||||
BEGIN
|
||||
SELECT * FROM db_storedproc.t1 LIMIT 1;
|
||||
SELECT * FROM db_storedproc.t1 WHERE f4=-5000 LIMIT 1;
|
||||
END//
|
||||
CREATE FUNCTION fn31105(n INT) RETURNS INT
|
||||
BEGIN
|
||||
@ -209,7 +209,7 @@ CALL sp_ins_1();
|
||||
SELECT row_count();
|
||||
row_count()
|
||||
1
|
||||
SELECT * FROM temp;
|
||||
SELECT * FROM temp ORDER BY f4;
|
||||
f1 f2 f3 f4 f5 f6
|
||||
a` a` 1000-01-01 -5000 a` -5000
|
||||
aaa aaa 1000-01-02 -4999 aaa -4999
|
||||
@ -226,7 +226,7 @@ CALL sp_ins_3();
|
||||
SELECT row_count();
|
||||
row_count()
|
||||
1
|
||||
SELECT * FROM temp;
|
||||
SELECT * FROM temp ORDER BY f4;
|
||||
f1 f2 f3 f4 f5 f6
|
||||
a` a` 1000-01-01 -5000 a` -5000
|
||||
aaa aaa 1000-01-02 -4999 aaa -4999
|
||||
@ -246,7 +246,7 @@ CALL sp_upd();
|
||||
SELECT row_count();
|
||||
row_count()
|
||||
4
|
||||
SELECT * FROM temp;
|
||||
SELECT * FROM temp ORDER BY f4;
|
||||
f1 f2 f3 f4 f5 f6
|
||||
a` a` 1000-01-01 -5000 a` -5000
|
||||
aaa aaa 1000-01-02 -4999 aaa -4999
|
||||
@ -279,7 +279,7 @@ COUNT( f1 ) f1
|
||||
SELECT row_count();
|
||||
row_count()
|
||||
3
|
||||
SELECT * FROM temp;
|
||||
SELECT * FROM temp ORDER BY f4;
|
||||
f1 f2 f3 f4 f5 f6
|
||||
a` a` 1000-01-01 -5000 a` -5000
|
||||
aaa aaa 1000-01-02 -4999 aaa -4999
|
||||
|
@ -199,6 +199,9 @@ CREATE TRIGGER trg5_1 BEFORE INSERT on test.t1
|
||||
for each row set new.f3 = '14';
|
||||
CREATE TRIGGER trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ
|
||||
BEFORE UPDATE on test.t1 for each row set new.f3 = '42';
|
||||
ERROR 42000: Identifier name 'trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ' is too long
|
||||
CREATE TRIGGER trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWX
|
||||
BEFORE UPDATE on test.t1 for each row set new.f3 = '42';
|
||||
insert into t1 (f2) values ('insert 3.5.1.7');
|
||||
select * from t1;
|
||||
f1 f2 f3
|
||||
@ -207,12 +210,14 @@ update t1 set f2='update 3.5.1.7';
|
||||
select * from t1;
|
||||
f1 f2 f3
|
||||
NULL update 3.5.1.7 42
|
||||
select trigger_name from information_schema.triggers;
|
||||
select trigger_name from information_schema.triggers order by trigger_name;
|
||||
trigger_name
|
||||
trg5_1
|
||||
trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWX
|
||||
drop trigger trg5_1;
|
||||
drop trigger trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ;
|
||||
ERROR 42000: Identifier name 'trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ' is too long
|
||||
drop trigger trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWX;
|
||||
drop table t1;
|
||||
|
||||
Testcase 3.5.1.8:
|
||||
@ -314,7 +319,7 @@ insert into trig_db3.t1 (f1,f2) values ('insert to db3 t1 from db1',4);
|
||||
select @test_var1, @test_var2, @test_var3;
|
||||
@test_var1 @test_var2 @test_var3
|
||||
trig1 trig2 trig3
|
||||
select * from t1;
|
||||
select * from t1 order by f2;
|
||||
f1 f2
|
||||
trig1 1
|
||||
trig1 2
|
||||
@ -324,7 +329,7 @@ trig2 3
|
||||
select * from trig_db3.t1;
|
||||
f1 f2
|
||||
trig3 4
|
||||
select * from t1;
|
||||
select * from t1 order by f2;
|
||||
f1 f2
|
||||
trig1 1
|
||||
trig1 2
|
||||
@ -349,10 +354,10 @@ for each row set @test_var2='trig1_a';
|
||||
create trigger trig_db2.trig2 before insert on trig_db2.t1
|
||||
for each row set @test_var3='trig2';
|
||||
select trigger_schema, trigger_name, event_object_table
|
||||
from information_schema.triggers;
|
||||
from information_schema.triggers order by trigger_name;
|
||||
trigger_schema trigger_name event_object_table
|
||||
trig_db1 trig1_b t1
|
||||
trig_db1 trig1_a t1
|
||||
trig_db1 trig1_b t1
|
||||
trig_db2 trig2 t1
|
||||
set @test_var1= '', @test_var2= '', @test_var3= '';
|
||||
insert into t1 (f1,f2) values ('insert to db1 t1 from db1',352);
|
||||
|
@ -82,16 +82,16 @@ 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;
|
||||
revoke TRIGGER on *.* from test_noprivs@localhost;
|
||||
show grants for test_noprivs@localhost;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT 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'
|
||||
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 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 TRIGGER 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@localhost
|
||||
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER 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);
|
||||
@ -104,10 +104,10 @@ test_noprivs@localhost
|
||||
use priv_db;
|
||||
create trigger trg1_1 before INSERT on t1 for each row
|
||||
set new.f1 = 'trig 3.5.3.2_1-no';
|
||||
ERROR 42000: Access denied; you need the SUPER privilege for this operation
|
||||
Got one of the listed errors
|
||||
use priv_db;
|
||||
insert into t1 (f1) values ('insert 3.5.3.2-no');
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
select current_user;
|
||||
@ -122,15 +122,12 @@ root@localhost
|
||||
use 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;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
grant UPDATE on priv_db.t1 to test_yesprivs@localhost;
|
||||
|
||||
note: once 15166 is fixed a similar case for SELECT needs to be added
|
||||
---------------------------------------------------------------------
|
||||
insert into t1 (f1) values ('insert 3.5.3.2-yes');
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
trig 3.5.3.2_2-yes
|
||||
@ -139,10 +136,10 @@ Testcase 3.5.3.6:
|
||||
-----------------
|
||||
use priv_db;
|
||||
drop trigger trg1_2;
|
||||
ERROR 42000: Access denied; you need the SUPER privilege for this operation
|
||||
Got one of the listed errors
|
||||
use priv_db;
|
||||
insert into t1 (f1) values ('insert 3.5.3.6-yes');
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
trig 3.5.3.2_2-yes
|
||||
@ -151,12 +148,12 @@ use priv_db;
|
||||
drop trigger trg1_2;
|
||||
use priv_db;
|
||||
insert into t1 (f1) values ('insert 3.5.3.6-no');
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
insert 3.5.3.6-no
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
drop trigger trg1_2;
|
||||
|
||||
Testcase 3.5.3.7a:
|
||||
@ -166,12 +163,12 @@ grant ALL on *.* to test_noprivs@localhost;
|
||||
revoke UPDATE on *.* from test_noprivs@localhost;
|
||||
show grants for test_noprivs@localhost;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT 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'
|
||||
GRANT 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, EVENT, TRIGGER 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;
|
||||
grant TRIGGER, UPDATE on *.* to test_yesprivs@localhost;
|
||||
show grants for test_yesprivs@localhost;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT UPDATE, SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT UPDATE, TRIGGER 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;
|
||||
@ -180,24 +177,24 @@ test_noprivs@localhost
|
||||
use priv_db;
|
||||
show grants;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT 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;
|
||||
GRANT 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, EVENT, TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
insert 3.5.3.6-no
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
|
||||
Trigger create disabled - should fail - Bug 8884
|
||||
------------------------------------------------
|
||||
insert into t1 (f1) values ('insert 3.5.3.7-1a');
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
insert 3.5.3.6-no
|
||||
insert 3.5.3.7-1a
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
drop trigger trg4a_1;
|
||||
use priv_db;
|
||||
select current_user;
|
||||
@ -205,236 +202,220 @@ current_user
|
||||
test_yesprivs@localhost
|
||||
show grants;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT UPDATE, SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT UPDATE, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
create trigger trg4a_2 before INSERT on t1 for each row
|
||||
set new.f1 = 'trig 3.5.3.7-2a';
|
||||
|
||||
SELECT priv added to bypass bug 15166
|
||||
-------------------------------------
|
||||
grant SELECT on *.* to test_yesprivs@localhost;
|
||||
insert into t1 (f1) values ('insert 3.5.3.7-2b');
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
insert 3.5.3.6-no
|
||||
insert 3.5.3.7-1a
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.7-2a
|
||||
drop trigger trg4a_2;
|
||||
|
||||
Testcase 3.5.3.7b:
|
||||
------------------
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
|
||||
grant SUPER on *.* to test_noprivs;
|
||||
grant TRIGGER 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'@'%'
|
||||
GRANT TRIGGER ON *.* TO 'test_noprivs'@'%'
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
|
||||
grant SUPER on *.* to test_yesprivs@localhost;
|
||||
grant TRIGGER on *.* to test_yesprivs@localhost;
|
||||
grant UPDATE on priv_db.* to test_yesprivs@localhost;
|
||||
show grants for test_yesprivs@localhost;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER 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@localhost
|
||||
GRANT 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'
|
||||
GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER ON `priv_db`.* TO 'test_noprivs'@'localhost'
|
||||
use priv_db;
|
||||
|
||||
Trigger create disabled - should fail - Bug 8884
|
||||
------------------------------------------------
|
||||
insert into t1 (f1) values ('insert 3.5.3.7-1b');
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
insert 3.5.3.6-no
|
||||
insert 3.5.3.7-1a
|
||||
trig 3.5.3.7-2a
|
||||
insert 3.5.3.7-1b
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.7-2a
|
||||
update t1 set f1 = 'update 3.5.3.7-1b' where f1 = 'insert 3.5.3.7-1b';
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
insert 3.5.3.6-no
|
||||
insert 3.5.3.7-1a
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.7-2a
|
||||
update 3.5.3.7-1b
|
||||
drop trigger trg4b_1;
|
||||
show grants;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER 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 row
|
||||
set new.f1 = 'trig 3.5.3.7-2b';
|
||||
|
||||
SELECT priv added to bypass bug 15166
|
||||
-------------------------------------
|
||||
grant SELECT on priv_db.* to test_yesprivs@localhost;
|
||||
insert into t1 (f1) values ('insert 3.5.3.7-2b');
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
insert 3.5.3.6-no
|
||||
insert 3.5.3.7-1a
|
||||
trig 3.5.3.7-2a
|
||||
update 3.5.3.7-1b
|
||||
insert 3.5.3.7-2b
|
||||
update t1 set f1 = 'update 3.5.3.7-2b' where f1 = 'insert 3.5.3.7-2b';
|
||||
select f1 from t1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
insert 3.5.3.6-no
|
||||
insert 3.5.3.7-1a
|
||||
trig 3.5.3.7-2a
|
||||
update 3.5.3.7-1b
|
||||
update t1 set f1 = 'update 3.5.3.7-2b' where f1 = 'insert 3.5.3.7-2b';
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
insert 3.5.3.6-no
|
||||
insert 3.5.3.7-1a
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.7-2a
|
||||
trig 3.5.3.7-2b
|
||||
update 3.5.3.7-1b
|
||||
drop 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 TRIGGER 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'@'%'
|
||||
GRANT TRIGGER ON *.* TO 'test_noprivs'@'%'
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
|
||||
grant SUPER on *.* to test_yesprivs@localhost;
|
||||
grant TRIGGER 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@localhost
|
||||
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER 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@localhost
|
||||
GRANT 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'
|
||||
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
|
||||
use priv_db;
|
||||
|
||||
Trigger create disabled - should fail - Bug 8884
|
||||
------------------------------------------------
|
||||
insert into t1 (f1) values ('insert 3.5.3.7-1c');
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
insert 3.5.3.6-no
|
||||
insert 3.5.3.7-1a
|
||||
trig 3.5.3.7-2a
|
||||
update 3.5.3.7-1b
|
||||
trig 3.5.3.7-2b
|
||||
insert 3.5.3.7-1c
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.7-2a
|
||||
trig 3.5.3.7-2b
|
||||
update 3.5.3.7-1b
|
||||
drop trigger trg4c_1;
|
||||
show grants;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER 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 row
|
||||
set new.f1 = 'trig 3.5.3.7-2c';
|
||||
|
||||
SELECT priv added to bypass bug 15166
|
||||
-------------------------------------
|
||||
grant SELECT on priv_db.t1 to test_yesprivs@localhost;
|
||||
insert into t1 (f1) values ('insert 3.5.3.7-2c');
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
insert 3.5.3.6-no
|
||||
insert 3.5.3.7-1a
|
||||
trig 3.5.3.7-2a
|
||||
update 3.5.3.7-1b
|
||||
trig 3.5.3.7-2b
|
||||
insert 3.5.3.7-1c
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.7-2a
|
||||
trig 3.5.3.7-2b
|
||||
trig 3.5.3.7-2c
|
||||
update 3.5.3.7-1b
|
||||
drop 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 TRIGGER 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'@'%'
|
||||
GRANT TRIGGER ON *.* TO 'test_noprivs'@'%'
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
|
||||
grant SUPER on *.* to test_yesprivs@localhost;
|
||||
grant TRIGGER on *.* to test_yesprivs@localhost;
|
||||
grant UPDATE (f1) on priv_db.t1 to test_yesprivs@localhost;
|
||||
show grants for test_noprivs;
|
||||
Grants for test_noprivs@%
|
||||
GRANT SUPER ON *.* TO 'test_noprivs'@'%'
|
||||
GRANT TRIGGER ON *.* TO 'test_noprivs'@'%'
|
||||
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@localhost
|
||||
GRANT SUPER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT (f1), INSERT (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
|
||||
use priv_db;
|
||||
|
||||
Trigger create disabled - should fail - Bug 8884
|
||||
------------------------------------------------
|
||||
insert into t1 (f1) values ('insert 3.5.3.7-1d');
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
insert 3.5.3.6-no
|
||||
insert 3.5.3.7-1a
|
||||
trig 3.5.3.7-2a
|
||||
update 3.5.3.7-1b
|
||||
trig 3.5.3.7-2b
|
||||
insert 3.5.3.7-1c
|
||||
trig 3.5.3.7-2c
|
||||
insert 3.5.3.7-1d
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.7-2a
|
||||
trig 3.5.3.7-2b
|
||||
trig 3.5.3.7-2c
|
||||
update 3.5.3.7-1b
|
||||
drop trigger trg4d_1;
|
||||
show grants;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT UPDATE (f1) ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
|
||||
use priv_db;
|
||||
create trigger trg4d_2 before INSERT on t1 for each row
|
||||
set new.f1 = 'trig 3.5.3.7-2d';
|
||||
|
||||
SELECT priv added to bypass bug 15166
|
||||
-------------------------------------
|
||||
grant SELECT (f1) on priv_db.t1 to test_yesprivs@localhost;
|
||||
insert into t1 (f1) values ('insert 3.5.3.7-2d');
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
insert 3.5.3.6-no
|
||||
insert 3.5.3.7-1a
|
||||
trig 3.5.3.7-2a
|
||||
update 3.5.3.7-1b
|
||||
trig 3.5.3.7-2b
|
||||
insert 3.5.3.7-1c
|
||||
trig 3.5.3.7-2c
|
||||
insert 3.5.3.7-1d
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.7-2a
|
||||
trig 3.5.3.7-2b
|
||||
trig 3.5.3.7-2c
|
||||
trig 3.5.3.7-2d
|
||||
update 3.5.3.7-1b
|
||||
drop trigger trg4d_2;
|
||||
|
||||
Testcase 3.5.3.8a:
|
||||
@ -444,12 +425,12 @@ grant ALL on *.* to test_noprivs@localhost;
|
||||
revoke SELECT on *.* from test_noprivs@localhost;
|
||||
show grants for test_noprivs@localhost;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT 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 ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT 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, TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
|
||||
grant SUPER, SELECT on *.* to test_yesprivs@localhost;
|
||||
grant TRIGGER, SELECT on *.* to test_yesprivs@localhost;
|
||||
show grants for test_yesprivs@localhost;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT SELECT, SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT, TRIGGER 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;
|
||||
@ -458,7 +439,7 @@ test_noprivs@localhost
|
||||
use priv_db;
|
||||
show grants;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT 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 ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT 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, TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
|
||||
Trigger create disabled - should fail - Bug 8887
|
||||
------------------------------------------------
|
||||
@ -477,17 +458,13 @@ current_user
|
||||
test_yesprivs@localhost
|
||||
show grants;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT SELECT, SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
create trigger trg5a_2 before INSERT on t1 for each row
|
||||
set @test_var= new.f1;
|
||||
set @test_var= 'before trig 3.5.3.8-2a';
|
||||
select @test_var;
|
||||
@test_var
|
||||
before trig 3.5.3.8-2a
|
||||
|
||||
UPDATE priv added to bypass bug 15166
|
||||
-------------------------------------
|
||||
grant UPDATE on *.* to test_yesprivs@localhost;
|
||||
insert into t1 (f1) values ('insert 3.5.3.8-2a');
|
||||
select @test_var;
|
||||
@test_var
|
||||
@ -497,26 +474,26 @@ drop trigger trg5a_2;
|
||||
Testcase: 3.5.3.8b
|
||||
------------------
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
|
||||
grant SUPER on *.* to test_noprivs@localhost;
|
||||
grant TRIGGER on *.* to test_noprivs@localhost;
|
||||
grant ALL on priv_db.* to test_noprivs@localhost;
|
||||
revoke SELECT on priv_db.* from test_noprivs@localhost;
|
||||
show grants for test_noprivs@localhost;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT INSERT, UPDATE, 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'
|
||||
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER ON `priv_db`.* TO 'test_noprivs'@'localhost'
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
|
||||
grant SUPER on *.* to test_yesprivs@localhost;
|
||||
grant TRIGGER on *.* to test_yesprivs@localhost;
|
||||
grant SELECT on priv_db.* to test_yesprivs@localhost;
|
||||
show grants for test_yesprivs@localhost;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT 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@localhost
|
||||
GRANT SUPER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT INSERT, UPDATE, 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'
|
||||
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER ON `priv_db`.* TO 'test_noprivs'@'localhost'
|
||||
use priv_db;
|
||||
|
||||
Trigger create disabled - should fail - Bug 8887
|
||||
@ -533,7 +510,7 @@ before trig 3.5.3.8-1b
|
||||
drop trigger trg5b_1;
|
||||
show grants;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT ON `priv_db`.* TO 'test_yesprivs'@'localhost'
|
||||
use priv_db;
|
||||
create trigger trg5b_2 before UPDATE on t1 for each row
|
||||
@ -543,10 +520,6 @@ insert into t1 (f1) values ('insert 3.5.3.8-2b');
|
||||
select @test_var;
|
||||
@test_var
|
||||
before trig 3.5.3.8-2b
|
||||
|
||||
UPDATE priv added to bypass bug 15166
|
||||
-------------------------------------
|
||||
grant UPDATE on priv_db.* to test_yesprivs@localhost;
|
||||
update t1 set f1= 'update 3.5.3.8-2b' where f1 = 'insert 3.5.3.8-2b';
|
||||
select @test_var;
|
||||
@test_var
|
||||
@ -556,26 +529,26 @@ drop trigger trg5b_2;
|
||||
Testcase 3.5.3.8c:
|
||||
------------------
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
|
||||
grant SUPER on *.* to test_noprivs@localhost;
|
||||
grant TRIGGER on *.* to test_noprivs@localhost;
|
||||
grant ALL on priv_db.t1 to test_noprivs@localhost;
|
||||
revoke SELECT on priv_db.t1 from test_noprivs@localhost;
|
||||
show grants for test_noprivs@localhost;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
|
||||
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
|
||||
grant SUPER on *.* to test_yesprivs@localhost;
|
||||
grant TRIGGER 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@localhost
|
||||
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER 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);
|
||||
show grants;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
|
||||
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
|
||||
use priv_db;
|
||||
|
||||
Trigger create disabled - should fail - Bug 8887
|
||||
@ -588,16 +561,12 @@ before trig 3.5.3.8-1c
|
||||
drop trigger trg5c_1;
|
||||
show grants;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
|
||||
use priv_db;
|
||||
create trigger trg5c_2 before INSERT on t1 for each row
|
||||
set @test_var= new.f1;
|
||||
set @test_var='before trig 3.5.3.8-2c';
|
||||
|
||||
UPDATE priv added to bypass bug 15166
|
||||
-------------------------------------
|
||||
grant UPDATE on priv_db.t1 to test_yesprivs@localhost;
|
||||
insert into t1 (f1) values ('insert 3.5.3.8-2c');
|
||||
select @test_var;
|
||||
@test_var
|
||||
@ -607,24 +576,24 @@ drop trigger trg5c_2;
|
||||
Testcase: 3.5.3.8d:
|
||||
-------------------
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
|
||||
grant SUPER on *.* to test_noprivs@localhost;
|
||||
grant TRIGGER on *.* to test_noprivs@localhost;
|
||||
grant UPDATE (f1), INSERT (f1) on priv_db.t1 to test_noprivs@localhost;
|
||||
show grants for test_noprivs@localhost;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
|
||||
grant SUPER on *.* to test_yesprivs@localhost;
|
||||
grant TRIGGER on *.* to test_yesprivs@localhost;
|
||||
grant SELECT (f1) on priv_db.t1 to test_yesprivs@localhost;
|
||||
show grants for test_noprivs@localhost;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'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@localhost
|
||||
GRANT SUPER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
|
||||
use priv_db;
|
||||
|
||||
@ -638,16 +607,12 @@ before trig 3.5.3.8-1d
|
||||
drop trigger trg5d_1;
|
||||
show grants;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT (f1) ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
|
||||
use priv_db;
|
||||
create trigger trg5d_2 before INSERT on t1 for each row
|
||||
set @test_var= new.f1;
|
||||
set @test_var='before trig 3.5.3.8-2d';
|
||||
|
||||
UPDATE priv added to bypass bug 15166
|
||||
-------------------------------------
|
||||
grant UPDATE (f1) on priv_db.t1 to test_yesprivs@localhost;
|
||||
insert into t1 (f1) values ('insert 3.5.3.8-2d');
|
||||
select @test_var;
|
||||
@test_var
|
||||
@ -662,12 +627,12 @@ drop table if exists t2;
|
||||
create table t1 (f1 int) engine= innodb;
|
||||
create table t2 (f2 int) engine= innodb;
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
|
||||
grant SUPER on *.* to test_yesprivs@localhost;
|
||||
grant TRIGGER on *.* to test_yesprivs@localhost;
|
||||
grant SELECT, UPDATE on priv_db.t1 to test_yesprivs@localhost;
|
||||
grant SELECT on priv_db.t2 to test_yesprivs@localhost;
|
||||
show grants for test_yesprivs@localhost;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT ON `priv_db`.`t2` TO 'test_yesprivs'@'localhost'
|
||||
GRANT SELECT, UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
|
||||
connect(localhost,test_yesprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
|
||||
@ -683,10 +648,10 @@ ERROR 42000: INSERT command denied to user 'test_yesprivs'@'localhost' for table
|
||||
revoke SELECT on priv_db.t2 from test_yesprivs@localhost;
|
||||
grant INSERT on priv_db.t2 to test_yesprivs@localhost;
|
||||
insert into t1 (f1) values (4);
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
4
|
||||
select f2 from t2;
|
||||
select f2 from t2 order by f2;
|
||||
f2
|
||||
4
|
||||
use priv_db;
|
||||
@ -699,11 +664,11 @@ ERROR 42000: UPDATE command denied to user 'test_yesprivs'@'localhost' for table
|
||||
revoke INSERT on priv_db.t2 from test_yesprivs@localhost;
|
||||
grant UPDATE on priv_db.t2 to test_yesprivs@localhost;
|
||||
insert into t1 (f1) values (2);
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
4
|
||||
2
|
||||
select f2 from t2;
|
||||
4
|
||||
select f2 from t2 order by f2;
|
||||
f2
|
||||
1
|
||||
use priv_db;
|
||||
@ -716,12 +681,12 @@ ERROR 42000: SELECT command denied to user 'test_yesprivs'@'localhost' for table
|
||||
revoke UPDATE on priv_db.t2 from test_yesprivs@localhost;
|
||||
grant SELECT on priv_db.t2 to test_yesprivs@localhost;
|
||||
insert into t1 (f1) values (1);
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
4
|
||||
2
|
||||
1
|
||||
select f2 from t2;
|
||||
2
|
||||
4
|
||||
select f2 from t2 order by f2;
|
||||
f2
|
||||
1
|
||||
select @aaa;
|
||||
@ -737,13 +702,13 @@ ERROR 42000: DELETE command denied to user 'test_yesprivs'@'localhost' for table
|
||||
revoke SELECT on priv_db.t2 from test_yesprivs@localhost;
|
||||
grant DELETE on priv_db.t2 to test_yesprivs@localhost;
|
||||
insert into t1 (f1) values (1);
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
4
|
||||
1
|
||||
1
|
||||
2
|
||||
1
|
||||
1
|
||||
select f2 from t2;
|
||||
4
|
||||
select f2 from t2 order by f2;
|
||||
f2
|
||||
drop database if exists priv_db;
|
||||
drop user test_yesprivs@localhost;
|
||||
|
@ -93,18 +93,18 @@ Create trigger trg1 BEFORE INSERT on t1
|
||||
for each row set new.f1='Trigger 3.5.4.1';
|
||||
Use db_drop;
|
||||
Insert into t1 values ('Insert error 3.5.4.1');
|
||||
Select * from t1;
|
||||
Select * from t1 order by f1;
|
||||
f1
|
||||
Trigger 3.5.4.1
|
||||
drop trigger trg1;
|
||||
select trigger_schema, trigger_name, event_object_table
|
||||
from information_schema.triggers;
|
||||
from information_schema.triggers order by trigger_name;
|
||||
trigger_schema trigger_name event_object_table
|
||||
Insert into t1 values ('Insert no trigger 3.5.4.1');
|
||||
Select * from t1;
|
||||
Select * from t1 order by f1;
|
||||
f1
|
||||
Trigger 3.5.4.1
|
||||
Insert no trigger 3.5.4.1
|
||||
Trigger 3.5.4.1
|
||||
drop trigger trg1;
|
||||
drop database if exists db_drop;
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM 'test_general'@'localhost';
|
||||
@ -258,7 +258,7 @@ use dbtest_one;
|
||||
Insert into dbtest_two.t2 values ('2nd Insert 3.5.5.4');
|
||||
Warnings:
|
||||
Warning 1265 Data truncated for column 'f1' at row 1
|
||||
Select * from dbtest_two.t2;
|
||||
Select * from dbtest_two.t2 order by f1;
|
||||
f1
|
||||
1st Insert 3.5.
|
||||
2nd Insert 3.5.
|
||||
|
@ -139,10 +139,10 @@ values ('1', 'Test 3.5.8.4', 222, 23456, 1.05);
|
||||
Select f120, f122, f136, f144, f163 from tb3 where f122= 'Test 3.5.8.4';
|
||||
f120 f122 f136 f144 f163
|
||||
1 Test 3.5.8.4 00222 0000023456 1.050000000000000000000000000000
|
||||
select * from db_test.t1_i;
|
||||
select * from db_test.t1_i order by i120;
|
||||
i120 i136 i144 i163
|
||||
1 00222 0000023456 1.050000000000000000000000000000
|
||||
select * from db_test.t1_u;
|
||||
select * from db_test.t1_u order by u120;
|
||||
u120 u136 u144 u163
|
||||
a 00111 0000099999 999.990000000000000000000000000000
|
||||
b 00222 0000023456 1.050000000000000000000000000000
|
||||
@ -150,7 +150,7 @@ c 00333 0000099999 999.990000000000000000000000000000
|
||||
d 00222 0000023456 1.050000000000000000000000000000
|
||||
e 00222 0000023456 1.050000000000000000000000000000
|
||||
f 00333 0000099999 999.990000000000000000000000000000
|
||||
select * from db_test.t1_d;
|
||||
select * from db_test.t1_d order by d120;
|
||||
d120 d136 d144 d163
|
||||
a 00111 0000099999 999.990000000000000000000000000000
|
||||
c 00333 0000099999 999.990000000000000000000000000000
|
||||
@ -162,14 +162,22 @@ select @test_var;
|
||||
3.5.8.4 - single SQL - insert
|
||||
-----------------------------
|
||||
Create trigger trg2 BEFORE UPDATE on tb3 for each row
|
||||
BEGIN
|
||||
insert into db_test.t1_i
|
||||
values (new.f120, new.f136, new.f144, new.f163);
|
||||
END//
|
||||
Select f120, f122, f136, f144, f163 from tb3 where f122 like 'Test 3.5.8.4%';
|
||||
f120 f122 f136 f144 f163
|
||||
1 Test 3.5.8.4 00222 0000023456 1.050000000000000000000000000000
|
||||
select * from db_test.t1_i order by i120;
|
||||
i120 i136 i144 i163
|
||||
1 00222 0000023456 1.050000000000000000000000000000
|
||||
update tb3 set f120='I', f122='Test 3.5.8.4-Single Insert'
|
||||
where f122='Test 3.5.8.4';
|
||||
Select f120, f122, f136, f144, f163 from tb3 where f122 like 'Test 3.5.8.4%';
|
||||
f120 f122 f136 f144 f163
|
||||
I Test 3.5.8.4-Single Insert 00222 0000023456 1.050000000000000000000000000000
|
||||
select * from db_test.t1_i;
|
||||
select * from db_test.t1_i order by i120;
|
||||
i120 i136 i144 i163
|
||||
1 00222 0000023456 1.050000000000000000000000000000
|
||||
I 00222 0000023456 1.050000000000000000000000000000
|
||||
@ -186,14 +194,14 @@ update tb3 set f120='U', f122='Test 3.5.8.4-Single Update'
|
||||
Select f120, f122, f136, f144, f163 from tb3 where f122 like 'Test 3.5.8.4%';
|
||||
f120 f122 f136 f144 f163
|
||||
U Test 3.5.8.4-Single Update 00222 0000023456 1.050000000000000000000000000000
|
||||
select * from db_test.t1_u;
|
||||
select * from db_test.t1_u order by u120;
|
||||
u120 u136 u144 u163
|
||||
a 00111 0000099999 999.990000000000000000000000000000
|
||||
U 00222 0000023456 1.050000000000000000000000000000
|
||||
c 00333 0000099999 999.990000000000000000000000000000
|
||||
U 00222 0000023456 1.050000000000000000000000000000
|
||||
U 00222 0000023456 1.050000000000000000000000000000
|
||||
f 00333 0000099999 999.990000000000000000000000000000
|
||||
U 00222 0000023456 1.050000000000000000000000000000
|
||||
U 00222 0000023456 1.050000000000000000000000000000
|
||||
U 00222 0000023456 1.050000000000000000000000000000
|
||||
|
||||
3.5.8.3/4 - single SQL - delete
|
||||
-------------------------------
|
||||
@ -206,7 +214,7 @@ f122='Test 3.5.8.4-Single Delete'
|
||||
Select f120, f122, f136, f144, f163 from tb3 where f122 like 'Test 3.5.8.4%';
|
||||
f120 f122 f136 f144 f163
|
||||
D Test 3.5.8.4-Single Delete 00444 0000023456 1.050000000000000000000000000000
|
||||
select * from db_test.t1_d;
|
||||
select * from db_test.t1_d order by d120;
|
||||
d120 d136 d144 d163
|
||||
a 00111 0000099999 999.990000000000000000000000000000
|
||||
c 00333 0000099999 999.990000000000000000000000000000
|
||||
@ -253,29 +261,29 @@ END//
|
||||
set @test_var='Empty', @test_var2=0;
|
||||
Insert into tb3 (f120, f122, f136) values ('1', 'Test 3.5.8.5-if', 101);
|
||||
select f120, f122, f136, @test_var, @test_var2
|
||||
from tb3 where f122 = 'Test 3.5.8.5-if';
|
||||
from tb3 where f122 = 'Test 3.5.8.5-if' order by f136;
|
||||
f120 f122 f136 @test_var @test_var2
|
||||
D Test 3.5.8.5-if 00101 one 2nd else
|
||||
Insert into tb3 (f120, f122, f136) values ('2', 'Test 3.5.8.5-if', 102);
|
||||
select f120, f122, f136, @test_var, @test_var2
|
||||
from tb3 where f122 = 'Test 3.5.8.5-if';
|
||||
from tb3 where f122 = 'Test 3.5.8.5-if' order by f136;
|
||||
f120 f122 f136 @test_var @test_var2
|
||||
D Test 3.5.8.5-if 00101 two 2nd else
|
||||
D Test 3.5.8.5-if 00102 two 2nd else
|
||||
Insert into tb3 (f120, f122, f136) values ('3', 'Test 3.5.8.5-if', 10);
|
||||
select f120, f122, f136, @test_var, @test_var2
|
||||
from tb3 where f122 = 'Test 3.5.8.5-if';
|
||||
from tb3 where f122 = 'Test 3.5.8.5-if' order by f136;
|
||||
f120 f122 f136 @test_var @test_var2
|
||||
d Test 3.5.8.5-if 00010 three 2nd if
|
||||
D Test 3.5.8.5-if 00101 three 2nd if
|
||||
D Test 3.5.8.5-if 00102 three 2nd if
|
||||
d Test 3.5.8.5-if 00010 three 2nd if
|
||||
Insert into tb3 (f120, f122, f136) values ('3', 'Test 3.5.8.5-if', 103);
|
||||
select f120, f122, f136, @test_var, @test_var2
|
||||
from tb3 where f122 = 'Test 3.5.8.5-if';
|
||||
from tb3 where f122 = 'Test 3.5.8.5-if' order by f136;
|
||||
f120 f122 f136 @test_var @test_var2
|
||||
d Test 3.5.8.5-if 00010 three 2nd else
|
||||
D Test 3.5.8.5-if 00101 three 2nd else
|
||||
D Test 3.5.8.5-if 00102 three 2nd else
|
||||
d Test 3.5.8.5-if 00010 three 2nd else
|
||||
D Test 3.5.8.5-if 00103 three 2nd else
|
||||
create trigger trg3 before update on tb3 for each row
|
||||
BEGIN
|
||||
@ -335,20 +343,20 @@ set @test_var='Empty';
|
||||
Insert into tb3 (f120, f122, f136, f144)
|
||||
values ('a', 'Test 3.5.8.5-case', 5, 7);
|
||||
select f120, f122, f136, f144, @test_var
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case';
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
|
||||
f120 f122 f136 f144 @test_var
|
||||
A Test 3.5.8.5-case 00125 0000000007 A*seven
|
||||
Insert into tb3 (f120, f122, f136, f144)
|
||||
values ('b', 'Test 3.5.8.5-case', 71,16);
|
||||
select f120, f122, f136, f144, @test_var
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case';
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
|
||||
f120 f122 f136 f144 @test_var
|
||||
A Test 3.5.8.5-case 00125 0000000007 B*0000000016
|
||||
B Test 3.5.8.5-case 00191 0000000016 B*0000000016
|
||||
Insert into tb3 (f120, f122, f136, f144)
|
||||
values ('c', 'Test 3.5.8.5-case', 80,1);
|
||||
select f120, f122, f136, f144, @test_var
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case';
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
|
||||
f120 f122 f136 f144 @test_var
|
||||
A Test 3.5.8.5-case 00125 0000000007 C=one
|
||||
B Test 3.5.8.5-case 00191 0000000016 C=one
|
||||
@ -358,34 +366,34 @@ values ('d', 'Test 3.5.8.5-case', 152);
|
||||
Warnings:
|
||||
Warning 1265 Data truncated for column 'f120' at row 1
|
||||
select f120, f122, f136, f144, @test_var
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case';
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
|
||||
f120 f122 f136 f144 @test_var
|
||||
1 Test 3.5.8.5-case 00152 0000099999 1*0000099999
|
||||
A Test 3.5.8.5-case 00125 0000000007 1*0000099999
|
||||
B Test 3.5.8.5-case 00191 0000000016 1*0000099999
|
||||
C Test 3.5.8.5-case 00200 0000000001 1*0000099999
|
||||
1 Test 3.5.8.5-case 00152 0000099999 1*0000099999
|
||||
Insert into tb3 (f120, f122, f136, f144)
|
||||
values ('e', 'Test 3.5.8.5-case', 200, 8);
|
||||
Warnings:
|
||||
Warning 1265 Data truncated for column 'f120' at row 1
|
||||
select f120, f122, f136, f144, @test_var
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case';
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
|
||||
f120 f122 f136 f144 @test_var
|
||||
1 Test 3.5.8.5-case 00152 0000099999 1=eight
|
||||
1 Test 3.5.8.5-case 00200 0000000008 1=eight
|
||||
A Test 3.5.8.5-case 00125 0000000007 1=eight
|
||||
B Test 3.5.8.5-case 00191 0000000016 1=eight
|
||||
C Test 3.5.8.5-case 00200 0000000001 1=eight
|
||||
1 Test 3.5.8.5-case 00152 0000099999 1=eight
|
||||
1 Test 3.5.8.5-case 00200 0000000008 1=eight
|
||||
Insert into tb3 (f120, f122, f136, f144)
|
||||
values ('f', 'Test 3.5.8.5-case', 100, 8);
|
||||
select f120, f122, f136, f144, @test_var
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case';
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
|
||||
f120 f122 f136 f144 @test_var
|
||||
1 Test 3.5.8.5-case 00152 0000099999 1=eight
|
||||
1 Test 3.5.8.5-case 00200 0000000008 1=eight
|
||||
A Test 3.5.8.5-case 00125 0000000007 1=eight
|
||||
B Test 3.5.8.5-case 00191 0000000016 1=eight
|
||||
C Test 3.5.8.5-case 00200 0000000001 1=eight
|
||||
1 Test 3.5.8.5-case 00152 0000099999 1=eight
|
||||
1 Test 3.5.8.5-case 00200 0000000008 1=eight
|
||||
create trigger trg3a before update on tb3 for each row
|
||||
BEGIN
|
||||
CASE
|
||||
|
@ -120,7 +120,7 @@ set @tr_var_af_118=old.f118, @tr_var_af_121=old.f121,
|
||||
Insert into tb3 (f122, f136, f163)
|
||||
values ('Test 3.5.9.3', 7, 123.17);
|
||||
Update tb3 Set f136=8 where f122='Test 3.5.9.3';
|
||||
select f118, f121, f122, f136, f163 from tb3 where f122='Test 3.5.9.3';
|
||||
select f118, f121, f122, f136, f163 from tb3 where f122='Test 3.5.9.3' order by f136;
|
||||
f118 f121 f122 f136 f163
|
||||
a NULL Test 3.5.9.3 00008 123.170000000000000000000000000000
|
||||
select @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122,
|
||||
@ -136,7 +136,7 @@ a NULL Test 3.5.9.3 7 123.170000000000000000000000000000
|
||||
@tr_var_af_118 @tr_var_af_121 @tr_var_af_122 @tr_var_af_136 @tr_var_af_163
|
||||
0 0 0 0 0
|
||||
delete from tb3 where f122='Test 3.5.9.3';
|
||||
select f118, f121, f122, f136, f163 from tb3 where f122='Test 3.5.9.3';
|
||||
select f118, f121, f122, f136, f163 from tb3 where f122='Test 3.5.9.3' order by f136;
|
||||
f118 f121 f122 f136 f163
|
||||
select @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122,
|
||||
@tr_var_b4_136, @tr_var_b4_163;
|
||||
@ -176,7 +176,7 @@ set @tr_var_af_118=new.f118, @tr_var_af_121=new.f121,
|
||||
Insert into tb3 (f122, f136, f151, f163)
|
||||
values ('Test 3.5.9.4', 7, DEFAULT, 995.24);
|
||||
select f118, f121, f122, f136, f151, f163 from tb3
|
||||
where f122 like 'Test 3.5.9.4%';
|
||||
where f122 like 'Test 3.5.9.4%' order by f163;
|
||||
f118 f121 f122 f136 f151 f163
|
||||
a NULL Test 3.5.9.4 00007 999 995.240000000000000000000000000000
|
||||
select @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122,
|
||||
@ -194,9 +194,9 @@ a NULL Test 3.5.9.4 7 999 995.240000000000000000000000000000
|
||||
Update tb3 Set f122='Test 3.5.9.4-trig', f136=NULL, f151=DEFAULT, f163=NULL
|
||||
where f122='Test 3.5.9.4';
|
||||
Warnings:
|
||||
Warning 1263 Column was set to data type implicit default; NULL supplied for NOT NULL column 'f136' at row 11
|
||||
Warning 1048 Column 'f136' cannot be null
|
||||
select f118, f121, f122, f136, f151, f163 from tb3
|
||||
where f122 like 'Test 3.5.9.4-trig';
|
||||
where f122 like 'Test 3.5.9.4-trig' order by f163;
|
||||
f118 f121 f122 f136 f151 f163
|
||||
a NULL Test 3.5.9.4-trig 00000 999 NULL
|
||||
select @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122,
|
||||
|
@ -87,7 +87,7 @@ Insert into vw11 (f122, f151) values ('Test 3.5.10.1/2/3', 1);
|
||||
Insert into vw11 (f122, f151) values ('Test 3.5.10.1/2/3', 2);
|
||||
Insert into vw11 (f122, f151) values ('Not in View', 3);
|
||||
select f121, f122, f151, f163
|
||||
from tb3 where f122 like 'Test 3.5.10.1/2/3%';
|
||||
from tb3 where f122 like 'Test 3.5.10.1/2/3%' order by f151;
|
||||
f121 f122 f151 f163
|
||||
NULL Test 3.5.10.1/2/3 1 111.110000000000000000000000000000
|
||||
NULL Test 3.5.10.1/2/3 2 111.110000000000000000000000000000
|
||||
@ -101,7 +101,7 @@ f121 f122 f151 f163
|
||||
NULL Not in View 3 111.110000000000000000000000000000
|
||||
Update vw11 set f163=1;
|
||||
select f121, f122, f151, f163 from tb3
|
||||
where f122 like 'Test 3.5.10.1/2/3%';
|
||||
where f122 like 'Test 3.5.10.1/2/3%' order by f151;
|
||||
f121 f122 f151 f163
|
||||
Y Test 3.5.10.1/2/3-Update 1 1.000000000000000000000000000000
|
||||
Y Test 3.5.10.1/2/3-Update 2 1.000000000000000000000000000000
|
||||
@ -115,7 +115,7 @@ before delete
|
||||
0
|
||||
delete from vw11 where f151=1;
|
||||
select f121, f122, f151, f163 from tb3
|
||||
where f122 like 'Test 3.5.10.1/2/3%';
|
||||
where f122 like 'Test 3.5.10.1/2/3%' order by f151;
|
||||
f121 f122 f151 f163
|
||||
Y Test 3.5.10.1/2/3-Update 2 1.000000000000000000000000000000
|
||||
select f121, f122, f151, f163 from vw11;
|
||||
@ -146,7 +146,7 @@ load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t9.txt' into table tb_load;
|
||||
select @counter as 'Rows Loaded After';
|
||||
Rows Loaded After
|
||||
10
|
||||
Select * from tb_load limit 10;
|
||||
Select * from tb_load order by f1 limit 10;
|
||||
f1 f2 f3
|
||||
-5000 a` 1000
|
||||
-4999 aaa 999
|
||||
@ -241,7 +241,7 @@ insert into t3 (f1) values (new.f1+1000);
|
||||
create trigger tr2_4 after insert on t2_4 for each row
|
||||
insert into t3 (f1) values (new.f1+10000);
|
||||
insert into t1 values (1);
|
||||
select * from t3;
|
||||
select * from t3 order by f1;
|
||||
f1
|
||||
12
|
||||
102
|
||||
@ -276,14 +276,14 @@ create trigger tr4 after insert on t4
|
||||
for each row insert into t1 (f1) values (new.f4+1);
|
||||
insert into t1 values (1);
|
||||
ERROR HY000: Can't update table 't1' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
|
||||
select * from t1;
|
||||
select * from t1 order by f1;
|
||||
f1
|
||||
0
|
||||
select * from t2;
|
||||
select * from t2 order by f2;
|
||||
f2
|
||||
select * from t3;
|
||||
select * from t3 order by f3;
|
||||
f3
|
||||
select * from t4;
|
||||
select * from t4 order by f4;
|
||||
f4
|
||||
drop trigger tr1;
|
||||
drop trigger tr2;
|
||||
@ -369,7 +369,7 @@ create table t4 (f4 tinyint) engine = innodb;
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`f1` int(11) default NULL
|
||||
`f1` int(11) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
||||
insert into t1 values (1);
|
||||
create trigger tr1 after insert on t1
|
||||
@ -381,14 +381,14 @@ for each row insert into t4 (f4) values (new.f3+1000);
|
||||
set autocommit=0;
|
||||
start transaction;
|
||||
insert into t1 values (1);
|
||||
ERROR 22003: Out of range value adjusted for column 'f4' at row 1
|
||||
ERROR 22003: Out of range value for column 'f4' at row 1
|
||||
commit;
|
||||
select * from t1;
|
||||
select * from t1 order by f1;
|
||||
f1
|
||||
1
|
||||
select * from t2;
|
||||
select * from t2 order by f2;
|
||||
f2
|
||||
select * from t3;
|
||||
select * from t3 order by f3;
|
||||
f3
|
||||
drop trigger tr1;
|
||||
drop trigger tr2;
|
||||
|
@ -116,7 +116,7 @@ insert into t1 values (3,'Department C');
|
||||
insert into t2 values (1,2,'Emp 1');
|
||||
insert into t2 values (2,3,'Emp 2');
|
||||
insert into t2 values (3,4,'Emp 3');
|
||||
ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test/t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`f_id`) REFERENCES `t1` (`id`) ON UPDATE CASCADE)
|
||||
ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`f_id`) REFERENCES `t1` (`id`) ON UPDATE CASCADE)
|
||||
create trigger tr_t2 before insert on t2 for each row
|
||||
insert into t1 values(new.f_id, concat('New Department ', new.f_id));
|
||||
lock tables t1 write, t2 write;
|
||||
|
@ -1926,7 +1926,7 @@ f1 f2
|
||||
2 two
|
||||
4 four
|
||||
INSERT INTO v1 VALUES(2,'two');
|
||||
ERROR 23000: Duplicate entry '2' for key 1
|
||||
ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
|
||||
INSERT INTO v1 VALUES(3,'three');
|
||||
affected rows: 1
|
||||
INSERT INTO v1 VALUES(6,'six');
|
||||
@ -1945,7 +1945,7 @@ f1 f2
|
||||
3 three
|
||||
4 four
|
||||
UPDATE v1 SET f1 = 2 WHERE f1 = 3;
|
||||
ERROR 23000: Duplicate entry '2' for key 1
|
||||
ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
|
||||
UPDATE v1 SET f2 = 'number' WHERE f1 = 3;
|
||||
affected rows: 1
|
||||
info: Rows matched: 1 Changed: 1 Warnings: 0
|
||||
@ -1992,12 +1992,12 @@ DROP VIEW IF EXISTS test.v1;
|
||||
CREATE TABLE t1 (f1 ENUM('A', 'B', 'C') NOT NULL, f2 INTEGER)
|
||||
ENGINE = innodb;
|
||||
INSERT INTO t1 VALUES ('A', 1);
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 order by f1, f2;
|
||||
f1 f2
|
||||
A 1
|
||||
CREATE VIEW v1 AS SELECT * FROM t1 WHERE f2 BETWEEN 1 AND 2
|
||||
WITH CASCADED CHECK OPTION ;
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by f1, f2;
|
||||
f1 f2
|
||||
A 1
|
||||
UPDATE v1 SET f2 = 2 WHERE f2 = 1;
|
||||
@ -2005,7 +2005,7 @@ affected rows: 1
|
||||
info: Rows matched: 1 Changed: 1 Warnings: 0
|
||||
INSERT INTO v1 VALUES('B',2);
|
||||
affected rows: 1
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by f1, f2;
|
||||
f1 f2
|
||||
A 2
|
||||
B 2
|
||||
@ -2013,7 +2013,7 @@ UPDATE v1 SET f2 = 4;
|
||||
ERROR HY000: CHECK OPTION failed 'test.v1'
|
||||
INSERT INTO v1 VALUES('B',3);
|
||||
ERROR HY000: CHECK OPTION failed 'test.v1'
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by f1, f2;
|
||||
f1 f2
|
||||
A 2
|
||||
B 2
|
||||
@ -10580,7 +10580,7 @@ f1 f2 f3 f4
|
||||
DELETE FROM t1;
|
||||
INSERT INTO v1 SET f2 = 'ABC';
|
||||
INSERT INTO v1 SET f2 = 'ABC';
|
||||
ERROR 23000: Duplicate entry '0' for key 1
|
||||
ERROR 23000: Duplicate entry '0' for key 'PRIMARY'
|
||||
SELECT * from t1;
|
||||
f1 f2 f3 f4
|
||||
0 ABC NULL NULL
|
||||
@ -10649,7 +10649,7 @@ DROP VIEW v1;
|
||||
CREATE VIEW v1 AS SELECT f2, f3 FROM t1;
|
||||
INSERT INTO v1 SET f2 = 'ABC';
|
||||
INSERT INTO v1 SET f2 = 'ABC';
|
||||
ERROR 23000: Duplicate entry '0' for key 1
|
||||
ERROR 23000: Duplicate entry '0' for key 'PRIMARY'
|
||||
SELECT * from t1;
|
||||
f1 f2 f3 f4
|
||||
0 ABC NULL NULL
|
||||
@ -10984,11 +10984,11 @@ f1 bigint(20) YES NULL
|
||||
f2 date YES NULL
|
||||
f4 char(5) YES NULL
|
||||
report char(10) YES NULL
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 order by f1, report;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by f1, report;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
@ -11008,12 +11008,12 @@ f4x char(5) YES NULL
|
||||
report char(10) YES NULL
|
||||
DESCRIBE v1;
|
||||
ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 order by f1, report;
|
||||
f1 f2 f4x report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
0 NULL ABC t1 1
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by f1, report;
|
||||
ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
|
||||
ALTER TABLE t1 CHANGE COLUMN f4x f4 CHAR(5);
|
||||
ALTER TABLE t1 CHANGE COLUMN f4 f4 CHAR(10);
|
||||
@ -11031,14 +11031,14 @@ f1 bigint(20) YES NULL
|
||||
f2 date YES NULL
|
||||
f4 char(10) YES NULL
|
||||
report char(10) YES NULL
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 order by f1, report;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
0 NULL ABC t1 1
|
||||
2 NULL <-- 10 --> t1 2
|
||||
2 NULL <-- 10 --> v1 2
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by f1, report;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
@ -11067,7 +11067,7 @@ f1 bigint(20) YES NULL
|
||||
f2 date YES NULL
|
||||
f4 char(8) YES NULL
|
||||
report char(10) YES NULL
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 order by f1, report;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
@ -11076,7 +11076,7 @@ f1 f2 f4 report
|
||||
2 NULL <-- 10 - v1 2
|
||||
3 NULL <-- 10 - t1 3
|
||||
3 NULL <-- 10 - v1 3
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by f1, report;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
@ -11100,7 +11100,7 @@ f1 bigint(20) YES NULL
|
||||
f2 date YES NULL
|
||||
f4 varchar(20) YES NULL
|
||||
report char(10) YES NULL
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 order by f1, report;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
@ -11111,7 +11111,7 @@ f1 f2 f4 report
|
||||
3 NULL <-- 10 - v1 3
|
||||
4 NULL <------ 20 --------> t1 4
|
||||
4 NULL <------ 20 --------> v1 4
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by f1, report;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
@ -11139,7 +11139,7 @@ f1 varchar(30) YES NULL
|
||||
f2 date YES NULL
|
||||
f4 varchar(20) YES NULL
|
||||
report char(10) YES NULL
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 order by f1, report;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
@ -11152,7 +11152,7 @@ f1 f2 f4 report
|
||||
4 NULL <------ 20 --------> v1 4
|
||||
<------------- 30 -----------> NULL <------ 20 --------> t1 5
|
||||
<------------- 30 -----------> NULL <------ 20 --------> v1 5
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by f1, report;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
@ -11176,7 +11176,7 @@ f4 varchar(20) YES NULL
|
||||
report char(10) YES NULL
|
||||
DESCRIBE v1;
|
||||
ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 order by f1, report;
|
||||
f1 f4 report
|
||||
-1 ABC t1 0
|
||||
-1 ABC v1 0
|
||||
@ -11190,7 +11190,7 @@ f1 f4 report
|
||||
<------------- 30 -----------> <------ 20 --------> t1 5
|
||||
<------------- 30 -----------> <------ 20 --------> v1 5
|
||||
ABC <------ 20 --------> t1 6
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by f1, report;
|
||||
ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
|
||||
ALTER TABLE t1 ADD COLUMN f2 DATE DEFAULT NULL;
|
||||
INSERT INTO t1 SET f1 = 'ABC', f2 = '1500-12-04',
|
||||
@ -11209,7 +11209,7 @@ f1 varchar(30) YES NULL
|
||||
f2 date YES NULL
|
||||
f4 varchar(20) YES NULL
|
||||
report char(10) YES NULL
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 order by f1, report;
|
||||
f1 f4 report f2
|
||||
-1 ABC t1 0 NULL
|
||||
-1 ABC v1 0 NULL
|
||||
@ -11225,7 +11225,7 @@ f1 f4 report f2
|
||||
ABC <------ 20 --------> t1 6 NULL
|
||||
ABC <------ 20 --------> t1 7 1500-12-04
|
||||
ABC <------ 20 --------> v1 7 1500-12-04
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by f1, report;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
@ -11259,7 +11259,7 @@ f1 varchar(30) YES NULL
|
||||
f2 float YES NULL
|
||||
f4 varchar(20) YES NULL
|
||||
report char(10) YES NULL
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 order by f1, report;
|
||||
f1 f4 report f2
|
||||
-1 ABC t1 0 NULL
|
||||
-1 ABC v1 0 NULL
|
||||
@ -11274,10 +11274,10 @@ f1 f4 report f2
|
||||
<------------- 30 -----------> <------ 20 --------> v1 5 NULL
|
||||
ABC <------ 20 --------> t1 6 NULL
|
||||
ABC <------ 20 --------> t1 7 NULL
|
||||
ABC <------ 20 --------> v1 7 NULL
|
||||
ABC <------ 20 --------> t1 8 -0.00033
|
||||
ABC <------ 20 --------> v1 7 NULL
|
||||
ABC <------ 20 --------> v1 8 -0.00033
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by f1, report;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
@ -11292,8 +11292,8 @@ f1 f2 f4 report
|
||||
<------------- 30 -----------> NULL <------ 20 --------> v1 5
|
||||
ABC NULL <------ 20 --------> t1 6
|
||||
ABC NULL <------ 20 --------> t1 7
|
||||
ABC NULL <------ 20 --------> v1 7
|
||||
ABC -0.00033 <------ 20 --------> t1 8
|
||||
ABC NULL <------ 20 --------> v1 7
|
||||
ABC -0.00033 <------ 20 --------> v1 8
|
||||
ALTER TABLE t1 ADD COLUMN f3 NUMERIC(7,2);
|
||||
INSERT INTO t1 SET f1 = 'ABC', f2 = -3.3E-4,
|
||||
@ -11316,7 +11316,7 @@ f1 varchar(30) YES NULL
|
||||
f2 float YES NULL
|
||||
f4 varchar(20) YES NULL
|
||||
report char(10) YES NULL
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 order by f1, report;
|
||||
f1 f4 report f2 f3
|
||||
-1 ABC t1 0 NULL NULL
|
||||
-1 ABC v1 0 NULL NULL
|
||||
@ -11331,12 +11331,12 @@ f1 f4 report f2 f3
|
||||
<------------- 30 -----------> <------ 20 --------> v1 5 NULL NULL
|
||||
ABC <------ 20 --------> t1 6 NULL NULL
|
||||
ABC <------ 20 --------> t1 7 NULL NULL
|
||||
ABC <------ 20 --------> v1 7 NULL NULL
|
||||
ABC <------ 20 --------> t1 8 -0.00033 NULL
|
||||
ABC <------ 20 --------> v1 8 -0.00033 NULL
|
||||
ABC <------ 20 --------> t1 9 -0.00033 -2.20
|
||||
ABC <------ 20 --------> v1 7 NULL NULL
|
||||
ABC <------ 20 --------> v1 8 -0.00033 NULL
|
||||
ABC <------ 20 --------> v1 9a -0.00033 NULL
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by f1, report;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
@ -11351,10 +11351,10 @@ f1 f2 f4 report
|
||||
<------------- 30 -----------> NULL <------ 20 --------> v1 5
|
||||
ABC NULL <------ 20 --------> t1 6
|
||||
ABC NULL <------ 20 --------> t1 7
|
||||
ABC NULL <------ 20 --------> v1 7
|
||||
ABC -0.00033 <------ 20 --------> t1 8
|
||||
ABC -0.00033 <------ 20 --------> v1 8
|
||||
ABC -0.00033 <------ 20 --------> t1 9
|
||||
ABC NULL <------ 20 --------> v1 7
|
||||
ABC -0.00033 <------ 20 --------> v1 8
|
||||
ABC -0.00033 <------ 20 --------> v1 9a
|
||||
DROP TABLE t1;
|
||||
DROP VIEW v1;
|
||||
@ -11369,10 +11369,10 @@ DESCRIBE v1;
|
||||
Field Type Null Key Default Extra
|
||||
f1 char(10) YES NULL
|
||||
my_sqrt double YES NULL
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 order by f1, f2;
|
||||
f1 f2
|
||||
ABC 3
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by 2;
|
||||
f1 my_sqrt
|
||||
ABC 1.7320508075689
|
||||
ALTER TABLE t1 CHANGE COLUMN f2 f2 VARCHAR(30);
|
||||
@ -11385,21 +11385,21 @@ DESCRIBE v1;
|
||||
Field Type Null Key Default Extra
|
||||
f1 char(10) YES NULL
|
||||
my_sqrt double YES NULL
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 order by f1, f2;
|
||||
f1 f2
|
||||
ABC 3
|
||||
ABC DEF
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by 2;
|
||||
f1 my_sqrt
|
||||
ABC 1.7320508075689
|
||||
ABC 0
|
||||
ABC 1.7320508075689
|
||||
SELECT SQRT('DEF');
|
||||
SQRT('DEF')
|
||||
0
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect DOUBLE value: 'DEF'
|
||||
CREATE VIEW v2 AS SELECT SQRT('DEF');
|
||||
SELECT * FROM v2;
|
||||
SELECT * FROM v2 order by 1;
|
||||
SQRT('DEF')
|
||||
0
|
||||
Warnings:
|
||||
@ -11409,27 +11409,27 @@ DESCRIBE v2;
|
||||
Field Type Null Key Default Extra
|
||||
f1 char(10) YES NULL
|
||||
my_sqrt double YES NULL
|
||||
SELECT * FROM v2;
|
||||
SELECT * FROM v2 order by 2;
|
||||
f1 my_sqrt
|
||||
ABC 0
|
||||
ABC 1.7320508075689
|
||||
ABC 0
|
||||
CREATE TABLE t2 AS SELECT f1, SQRT(f2) my_sqrt FROM t1;
|
||||
SELECT * FROM t2;
|
||||
SELECT * FROM t2 order by 2;
|
||||
f1 my_sqrt
|
||||
ABC 1.73205080756888
|
||||
ABC 0
|
||||
ABC 1.73205080756888
|
||||
DROP TABLE t2;
|
||||
CREATE TABLE t2 AS SELECT * FROM v1;
|
||||
SELECT * FROM t2;
|
||||
SELECT * FROM t2 order by 2;
|
||||
f1 my_sqrt
|
||||
ABC 1.73205080756888
|
||||
ABC 0
|
||||
ABC 1.73205080756888
|
||||
DROP TABLE t2;
|
||||
CREATE TABLE t2 AS SELECT * FROM v2;
|
||||
SELECT * FROM t2;
|
||||
SELECT * FROM t2 order by 2;
|
||||
f1 my_sqrt
|
||||
ABC 1.73205080756888
|
||||
ABC 0
|
||||
ABC 1.73205080756888
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
||||
DROP VIEW v1;
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -166,7 +166,7 @@ declare y integer default 1;
|
||||
set @x = x;
|
||||
set @y = y;
|
||||
set @z = 234;
|
||||
SELECT f1, f2 into @x, @y from t2 limit 1;
|
||||
SELECT f1, f2 into @x, @y from t2 where f1='a`' and f2='a`' limit 1;
|
||||
SELECT @x, @y, @z, invar;
|
||||
BEGIN
|
||||
set @x = 2;
|
||||
@ -209,7 +209,7 @@ BEGIN
|
||||
declare x integer; declare y integer;
|
||||
set @x=x;
|
||||
set @y=y;
|
||||
SELECT f4, f3 into @x, @y from t2 limit 1;
|
||||
SELECT f4, f3 into @x, @y from t2 where f4=-5000 and f3='1000-01-01' limit 1;
|
||||
SELECT @x, @y;
|
||||
END//
|
||||
CALL sp1();
|
||||
@ -544,6 +544,9 @@ exit handler 2
|
||||
exit handler 2
|
||||
exit handler 1
|
||||
exit handler 1
|
||||
Warnings:
|
||||
Note 1051 Unknown table 'tqq'
|
||||
Note 1051 Unknown table 'tqq'
|
||||
create table res_t1(w char unique, x char);
|
||||
insert into res_t1 values ('a', 'b');
|
||||
CREATE PROCEDURE h1 ()
|
||||
@ -1084,7 +1087,8 @@ declare f2_value char(20);
|
||||
declare f5_value char(20);
|
||||
declare f4_value integer;
|
||||
declare f6_value integer;
|
||||
declare cur1 cursor for SELECT f1, f2, f4, f5, f6 from t2 limit 3;
|
||||
declare cur1 cursor for SELECT f1, f2, f4, f5, f6 from t2
|
||||
where f4 >=-5000 order by f4 limit 3;
|
||||
open cur1;
|
||||
while proceed do
|
||||
SELECT count AS 'loop';
|
||||
@ -1167,7 +1171,7 @@ of a compound statement ends.
|
||||
DROP TABLE IF EXISTS temp1;
|
||||
DROP PROCEDURE IF EXISTS sp1;
|
||||
create table temp1( f0 char(20), f1 char(20), f2 char(20), f3 int, f4 char(20) );
|
||||
SELECT f1, f2, f4, f5 from t2;
|
||||
SELECT f1, f2, f4, f5 from t2 order by f4;
|
||||
f1 f2 f4 f5
|
||||
a` a` -5000 a`
|
||||
aaa aaa -4999 aaa
|
||||
@ -1187,21 +1191,21 @@ declare newf1 char(20);
|
||||
declare newf2 char(20);
|
||||
declare newf5 char(20);
|
||||
declare newf4 integer;
|
||||
declare cur1 cursor for SELECT f1, f2, f4, f5 from t2 limit 5;
|
||||
declare cur2 cursor for SELECT f1, f2, f4, f5 from t2 limit 5;
|
||||
declare cur1 cursor for SELECT f1, f2, f4, f5 from t2 where f4 >= -5000 order by f4 limit 5;
|
||||
declare cur2 cursor for SELECT f1, f2, f4, f5 from t2 where f4 >= -5000 order by f4 limit 5;
|
||||
open cur1;
|
||||
open cur2;
|
||||
BEGIN
|
||||
declare continue handler for sqlstate '02000' set count = 1;
|
||||
declare continue handler for sqlstate '02000' set count=1;
|
||||
fetch cur1 into newf1, newf2, newf4, newf5;
|
||||
SELECT '-1-', count, newf1, newf2, newf4, newf5;
|
||||
insert into temp1 values ('cur1_out', newf1, newf2, newf4, newf5);
|
||||
set count = 4;
|
||||
set count= 4;
|
||||
BEGIN
|
||||
while count > 0 do
|
||||
while count> 0 do
|
||||
fetch cur1 into newf1, newf2, newf4, newf5;
|
||||
SELECT '-2-', count, newf1, newf2, newf4, newf5;
|
||||
set count = count - 1;
|
||||
set count = count- 1;
|
||||
END while;
|
||||
SELECT '-3-', count, newf1, newf2, newf4, newf4;
|
||||
END;
|
||||
@ -1270,8 +1274,10 @@ declare i_newf11 char(20);
|
||||
declare i_newf12 char(20);
|
||||
declare i_newf13 date;
|
||||
declare i_newf14 integer;
|
||||
declare cur1 cursor for SELECT f1, f2, f3, f4 from t2 limit 4;
|
||||
declare cur2 cursor for SELECT f1, f2, f3, f4 from t2 limit 3;
|
||||
declare cur1 cursor for SELECT f1, f2, f3, f4 from t2
|
||||
where f4>=-5000 order by f4 limit 4;
|
||||
declare cur2 cursor for SELECT f1, f2, f3, f4 from t2
|
||||
where f4>=-5000 order by f4 limit 3;
|
||||
declare continue handler for sqlstate '02000' set proceed=0;
|
||||
open cur1;
|
||||
open cur2;
|
||||
@ -1302,8 +1308,10 @@ DECLARE o_newf11 CHAR(20);
|
||||
DECLARE o_newf12 CHAR(20);
|
||||
DECLARE o_newf13 DATE;
|
||||
DECLARE o_newf14 INTEGER;
|
||||
DECLARE cur1 CURSOR FOR SELECT f1, f2, f3, f4 FROM t2 LIMIT 5;
|
||||
DECLARE cur2 CURSOR FOR SELECT f1, f2, f3, f4 FROM t2 LIMIT 5;
|
||||
DECLARE cur1 CURSOR FOR SELECT f1, f2, f3, f4 FROM t2
|
||||
WHERE f4>=-5000 ORDER BY f4 LIMIT 5;
|
||||
DECLARE cur2 CURSOR FOR SELECT f1, f2, f3, f4 FROM t2
|
||||
WHERE f4>=-5000 ORDER BY f4 LIMIT 5;
|
||||
DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET proceed=0;
|
||||
OPEN cur1;
|
||||
OPEN cur2;
|
||||
|
@ -80,7 +80,7 @@ connect(localhost,user_1,,db_storedproc,MYSQL_PORT,MYSQL_SOCK);
|
||||
user_1@localhost db_storedproc
|
||||
CREATE PROCEDURE sp31102 () SQL SECURITY INVOKER
|
||||
BEGIN
|
||||
SELECT * FROM db_storedproc.t1 LIMIT 1;
|
||||
SELECT * FROM db_storedproc.t1 WHERE f4=-5000 LIMIT 1;
|
||||
END//
|
||||
CREATE FUNCTION fn31105(n INT) RETURNS INT
|
||||
BEGIN
|
||||
@ -209,7 +209,7 @@ CALL sp_ins_1();
|
||||
SELECT row_count();
|
||||
row_count()
|
||||
1
|
||||
SELECT * FROM temp;
|
||||
SELECT * FROM temp ORDER BY f4;
|
||||
f1 f2 f3 f4 f5 f6
|
||||
a` a` 1000-01-01 -5000 a` -5000
|
||||
aaa aaa 1000-01-02 -4999 aaa -4999
|
||||
@ -226,7 +226,7 @@ CALL sp_ins_3();
|
||||
SELECT row_count();
|
||||
row_count()
|
||||
1
|
||||
SELECT * FROM temp;
|
||||
SELECT * FROM temp ORDER BY f4;
|
||||
f1 f2 f3 f4 f5 f6
|
||||
a` a` 1000-01-01 -5000 a` -5000
|
||||
aaa aaa 1000-01-02 -4999 aaa -4999
|
||||
@ -246,7 +246,7 @@ CALL sp_upd();
|
||||
SELECT row_count();
|
||||
row_count()
|
||||
4
|
||||
SELECT * FROM temp;
|
||||
SELECT * FROM temp ORDER BY f4;
|
||||
f1 f2 f3 f4 f5 f6
|
||||
a` a` 1000-01-01 -5000 a` -5000
|
||||
aaa aaa 1000-01-02 -4999 aaa -4999
|
||||
@ -279,7 +279,7 @@ COUNT( f1 ) f1
|
||||
SELECT row_count();
|
||||
row_count()
|
||||
3
|
||||
SELECT * FROM temp;
|
||||
SELECT * FROM temp ORDER BY f4;
|
||||
f1 f2 f3 f4 f5 f6
|
||||
a` a` 1000-01-01 -5000 a` -5000
|
||||
aaa aaa 1000-01-02 -4999 aaa -4999
|
||||
|
@ -195,6 +195,9 @@ CREATE TRIGGER trg5_1 BEFORE INSERT on test.t1
|
||||
for each row set new.f3 = '14';
|
||||
CREATE TRIGGER trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ
|
||||
BEFORE UPDATE on test.t1 for each row set new.f3 = '42';
|
||||
ERROR 42000: Identifier name 'trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ' is too long
|
||||
CREATE TRIGGER trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWX
|
||||
BEFORE UPDATE on test.t1 for each row set new.f3 = '42';
|
||||
insert into t1 (f2) values ('insert 3.5.1.7');
|
||||
select * from t1;
|
||||
f1 f2 f3
|
||||
@ -203,12 +206,14 @@ update t1 set f2='update 3.5.1.7';
|
||||
select * from t1;
|
||||
f1 f2 f3
|
||||
NULL update 3.5.1.7 42
|
||||
select trigger_name from information_schema.triggers;
|
||||
select trigger_name from information_schema.triggers order by trigger_name;
|
||||
trigger_name
|
||||
trg5_1
|
||||
trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWX
|
||||
drop trigger trg5_1;
|
||||
drop trigger trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ;
|
||||
ERROR 42000: Identifier name 'trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ' is too long
|
||||
drop trigger trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWX;
|
||||
drop table t1;
|
||||
|
||||
Testcase 3.5.1.8:
|
||||
@ -310,7 +315,7 @@ insert into trig_db3.t1 (f1,f2) values ('insert to db3 t1 from db1',4);
|
||||
select @test_var1, @test_var2, @test_var3;
|
||||
@test_var1 @test_var2 @test_var3
|
||||
trig1 trig2 trig3
|
||||
select * from t1;
|
||||
select * from t1 order by f2;
|
||||
f1 f2
|
||||
trig1 1
|
||||
trig1 2
|
||||
@ -320,7 +325,7 @@ trig2 3
|
||||
select * from trig_db3.t1;
|
||||
f1 f2
|
||||
trig3 4
|
||||
select * from t1;
|
||||
select * from t1 order by f2;
|
||||
f1 f2
|
||||
trig1 1
|
||||
trig1 2
|
||||
@ -345,10 +350,10 @@ for each row set @test_var2='trig1_a';
|
||||
create trigger trig_db2.trig2 before insert on trig_db2.t1
|
||||
for each row set @test_var3='trig2';
|
||||
select trigger_schema, trigger_name, event_object_table
|
||||
from information_schema.triggers;
|
||||
from information_schema.triggers order by trigger_name;
|
||||
trigger_schema trigger_name event_object_table
|
||||
trig_db1 trig1_b t1
|
||||
trig_db1 trig1_a t1
|
||||
trig_db1 trig1_b t1
|
||||
trig_db2 trig2 t1
|
||||
set @test_var1= '', @test_var2= '', @test_var3= '';
|
||||
insert into t1 (f1,f2) values ('insert to db1 t1 from db1',352);
|
||||
|
@ -78,16 +78,16 @@ 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;
|
||||
revoke TRIGGER on *.* from test_noprivs@localhost;
|
||||
show grants for test_noprivs@localhost;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT 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'
|
||||
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 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 TRIGGER 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@localhost
|
||||
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER 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);
|
||||
@ -100,10 +100,10 @@ test_noprivs@localhost
|
||||
use priv_db;
|
||||
create trigger trg1_1 before INSERT on t1 for each row
|
||||
set new.f1 = 'trig 3.5.3.2_1-no';
|
||||
ERROR 42000: Access denied; you need the SUPER privilege for this operation
|
||||
Got one of the listed errors
|
||||
use priv_db;
|
||||
insert into t1 (f1) values ('insert 3.5.3.2-no');
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
select current_user;
|
||||
@ -118,15 +118,12 @@ root@localhost
|
||||
use 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;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
grant UPDATE on priv_db.t1 to test_yesprivs@localhost;
|
||||
|
||||
note: once 15166 is fixed a similar case for SELECT needs to be added
|
||||
---------------------------------------------------------------------
|
||||
insert into t1 (f1) values ('insert 3.5.3.2-yes');
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
trig 3.5.3.2_2-yes
|
||||
@ -135,10 +132,10 @@ Testcase 3.5.3.6:
|
||||
-----------------
|
||||
use priv_db;
|
||||
drop trigger trg1_2;
|
||||
ERROR 42000: Access denied; you need the SUPER privilege for this operation
|
||||
Got one of the listed errors
|
||||
use priv_db;
|
||||
insert into t1 (f1) values ('insert 3.5.3.6-yes');
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
trig 3.5.3.2_2-yes
|
||||
@ -147,12 +144,12 @@ use priv_db;
|
||||
drop trigger trg1_2;
|
||||
use priv_db;
|
||||
insert into t1 (f1) values ('insert 3.5.3.6-no');
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
insert 3.5.3.6-no
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
drop trigger trg1_2;
|
||||
|
||||
Testcase 3.5.3.7a:
|
||||
@ -162,12 +159,12 @@ grant ALL on *.* to test_noprivs@localhost;
|
||||
revoke UPDATE on *.* from test_noprivs@localhost;
|
||||
show grants for test_noprivs@localhost;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT 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'
|
||||
GRANT 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, EVENT, TRIGGER 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;
|
||||
grant TRIGGER, UPDATE on *.* to test_yesprivs@localhost;
|
||||
show grants for test_yesprivs@localhost;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT UPDATE, SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT UPDATE, TRIGGER 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;
|
||||
@ -176,24 +173,24 @@ test_noprivs@localhost
|
||||
use priv_db;
|
||||
show grants;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT 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;
|
||||
GRANT 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, EVENT, TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
insert 3.5.3.6-no
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
|
||||
Trigger create disabled - should fail - Bug 8884
|
||||
------------------------------------------------
|
||||
insert into t1 (f1) values ('insert 3.5.3.7-1a');
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
insert 3.5.3.6-no
|
||||
insert 3.5.3.7-1a
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
drop trigger trg4a_1;
|
||||
use priv_db;
|
||||
select current_user;
|
||||
@ -201,236 +198,220 @@ current_user
|
||||
test_yesprivs@localhost
|
||||
show grants;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT UPDATE, SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT UPDATE, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
create trigger trg4a_2 before INSERT on t1 for each row
|
||||
set new.f1 = 'trig 3.5.3.7-2a';
|
||||
|
||||
SELECT priv added to bypass bug 15166
|
||||
-------------------------------------
|
||||
grant SELECT on *.* to test_yesprivs@localhost;
|
||||
insert into t1 (f1) values ('insert 3.5.3.7-2b');
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
insert 3.5.3.6-no
|
||||
insert 3.5.3.7-1a
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.7-2a
|
||||
drop trigger trg4a_2;
|
||||
|
||||
Testcase 3.5.3.7b:
|
||||
------------------
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
|
||||
grant SUPER on *.* to test_noprivs;
|
||||
grant TRIGGER 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'@'%'
|
||||
GRANT TRIGGER ON *.* TO 'test_noprivs'@'%'
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
|
||||
grant SUPER on *.* to test_yesprivs@localhost;
|
||||
grant TRIGGER on *.* to test_yesprivs@localhost;
|
||||
grant UPDATE on priv_db.* to test_yesprivs@localhost;
|
||||
show grants for test_yesprivs@localhost;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER 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@localhost
|
||||
GRANT 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'
|
||||
GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER ON `priv_db`.* TO 'test_noprivs'@'localhost'
|
||||
use priv_db;
|
||||
|
||||
Trigger create disabled - should fail - Bug 8884
|
||||
------------------------------------------------
|
||||
insert into t1 (f1) values ('insert 3.5.3.7-1b');
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
insert 3.5.3.6-no
|
||||
insert 3.5.3.7-1a
|
||||
trig 3.5.3.7-2a
|
||||
insert 3.5.3.7-1b
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.7-2a
|
||||
update t1 set f1 = 'update 3.5.3.7-1b' where f1 = 'insert 3.5.3.7-1b';
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
insert 3.5.3.6-no
|
||||
insert 3.5.3.7-1a
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.7-2a
|
||||
update 3.5.3.7-1b
|
||||
drop trigger trg4b_1;
|
||||
show grants;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER 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 row
|
||||
set new.f1 = 'trig 3.5.3.7-2b';
|
||||
|
||||
SELECT priv added to bypass bug 15166
|
||||
-------------------------------------
|
||||
grant SELECT on priv_db.* to test_yesprivs@localhost;
|
||||
insert into t1 (f1) values ('insert 3.5.3.7-2b');
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
insert 3.5.3.6-no
|
||||
insert 3.5.3.7-1a
|
||||
trig 3.5.3.7-2a
|
||||
update 3.5.3.7-1b
|
||||
insert 3.5.3.7-2b
|
||||
update t1 set f1 = 'update 3.5.3.7-2b' where f1 = 'insert 3.5.3.7-2b';
|
||||
select f1 from t1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
insert 3.5.3.6-no
|
||||
insert 3.5.3.7-1a
|
||||
trig 3.5.3.7-2a
|
||||
update 3.5.3.7-1b
|
||||
update t1 set f1 = 'update 3.5.3.7-2b' where f1 = 'insert 3.5.3.7-2b';
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
insert 3.5.3.6-no
|
||||
insert 3.5.3.7-1a
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.7-2a
|
||||
trig 3.5.3.7-2b
|
||||
update 3.5.3.7-1b
|
||||
drop 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 TRIGGER 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'@'%'
|
||||
GRANT TRIGGER ON *.* TO 'test_noprivs'@'%'
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
|
||||
grant SUPER on *.* to test_yesprivs@localhost;
|
||||
grant TRIGGER 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@localhost
|
||||
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER 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@localhost
|
||||
GRANT 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'
|
||||
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
|
||||
use priv_db;
|
||||
|
||||
Trigger create disabled - should fail - Bug 8884
|
||||
------------------------------------------------
|
||||
insert into t1 (f1) values ('insert 3.5.3.7-1c');
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
insert 3.5.3.6-no
|
||||
insert 3.5.3.7-1a
|
||||
trig 3.5.3.7-2a
|
||||
update 3.5.3.7-1b
|
||||
trig 3.5.3.7-2b
|
||||
insert 3.5.3.7-1c
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.7-2a
|
||||
trig 3.5.3.7-2b
|
||||
update 3.5.3.7-1b
|
||||
drop trigger trg4c_1;
|
||||
show grants;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER 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 row
|
||||
set new.f1 = 'trig 3.5.3.7-2c';
|
||||
|
||||
SELECT priv added to bypass bug 15166
|
||||
-------------------------------------
|
||||
grant SELECT on priv_db.t1 to test_yesprivs@localhost;
|
||||
insert into t1 (f1) values ('insert 3.5.3.7-2c');
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
insert 3.5.3.6-no
|
||||
insert 3.5.3.7-1a
|
||||
trig 3.5.3.7-2a
|
||||
update 3.5.3.7-1b
|
||||
trig 3.5.3.7-2b
|
||||
insert 3.5.3.7-1c
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.7-2a
|
||||
trig 3.5.3.7-2b
|
||||
trig 3.5.3.7-2c
|
||||
update 3.5.3.7-1b
|
||||
drop 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 TRIGGER 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'@'%'
|
||||
GRANT TRIGGER ON *.* TO 'test_noprivs'@'%'
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
|
||||
grant SUPER on *.* to test_yesprivs@localhost;
|
||||
grant TRIGGER on *.* to test_yesprivs@localhost;
|
||||
grant UPDATE (f1) on priv_db.t1 to test_yesprivs@localhost;
|
||||
show grants for test_noprivs;
|
||||
Grants for test_noprivs@%
|
||||
GRANT SUPER ON *.* TO 'test_noprivs'@'%'
|
||||
GRANT TRIGGER ON *.* TO 'test_noprivs'@'%'
|
||||
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@localhost
|
||||
GRANT SUPER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT (f1), INSERT (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
|
||||
use priv_db;
|
||||
|
||||
Trigger create disabled - should fail - Bug 8884
|
||||
------------------------------------------------
|
||||
insert into t1 (f1) values ('insert 3.5.3.7-1d');
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
insert 3.5.3.6-no
|
||||
insert 3.5.3.7-1a
|
||||
trig 3.5.3.7-2a
|
||||
update 3.5.3.7-1b
|
||||
trig 3.5.3.7-2b
|
||||
insert 3.5.3.7-1c
|
||||
trig 3.5.3.7-2c
|
||||
insert 3.5.3.7-1d
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.7-2a
|
||||
trig 3.5.3.7-2b
|
||||
trig 3.5.3.7-2c
|
||||
update 3.5.3.7-1b
|
||||
drop trigger trg4d_1;
|
||||
show grants;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT UPDATE (f1) ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
|
||||
use priv_db;
|
||||
create trigger trg4d_2 before INSERT on t1 for each row
|
||||
set new.f1 = 'trig 3.5.3.7-2d';
|
||||
|
||||
SELECT priv added to bypass bug 15166
|
||||
-------------------------------------
|
||||
grant SELECT (f1) on priv_db.t1 to test_yesprivs@localhost;
|
||||
insert into t1 (f1) values ('insert 3.5.3.7-2d');
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
insert 3.5.3.6-no
|
||||
insert 3.5.3.7-1a
|
||||
trig 3.5.3.7-2a
|
||||
update 3.5.3.7-1b
|
||||
trig 3.5.3.7-2b
|
||||
insert 3.5.3.7-1c
|
||||
trig 3.5.3.7-2c
|
||||
insert 3.5.3.7-1d
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.7-2a
|
||||
trig 3.5.3.7-2b
|
||||
trig 3.5.3.7-2c
|
||||
trig 3.5.3.7-2d
|
||||
update 3.5.3.7-1b
|
||||
drop trigger trg4d_2;
|
||||
|
||||
Testcase 3.5.3.8a:
|
||||
@ -440,12 +421,12 @@ grant ALL on *.* to test_noprivs@localhost;
|
||||
revoke SELECT on *.* from test_noprivs@localhost;
|
||||
show grants for test_noprivs@localhost;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT 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 ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT 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, TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
|
||||
grant SUPER, SELECT on *.* to test_yesprivs@localhost;
|
||||
grant TRIGGER, SELECT on *.* to test_yesprivs@localhost;
|
||||
show grants for test_yesprivs@localhost;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT SELECT, SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT, TRIGGER 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;
|
||||
@ -454,7 +435,7 @@ test_noprivs@localhost
|
||||
use priv_db;
|
||||
show grants;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT 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 ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT 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, TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
|
||||
Trigger create disabled - should fail - Bug 8887
|
||||
------------------------------------------------
|
||||
@ -473,17 +454,13 @@ current_user
|
||||
test_yesprivs@localhost
|
||||
show grants;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT SELECT, SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
create trigger trg5a_2 before INSERT on t1 for each row
|
||||
set @test_var= new.f1;
|
||||
set @test_var= 'before trig 3.5.3.8-2a';
|
||||
select @test_var;
|
||||
@test_var
|
||||
before trig 3.5.3.8-2a
|
||||
|
||||
UPDATE priv added to bypass bug 15166
|
||||
-------------------------------------
|
||||
grant UPDATE on *.* to test_yesprivs@localhost;
|
||||
insert into t1 (f1) values ('insert 3.5.3.8-2a');
|
||||
select @test_var;
|
||||
@test_var
|
||||
@ -493,26 +470,26 @@ drop trigger trg5a_2;
|
||||
Testcase: 3.5.3.8b
|
||||
------------------
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
|
||||
grant SUPER on *.* to test_noprivs@localhost;
|
||||
grant TRIGGER on *.* to test_noprivs@localhost;
|
||||
grant ALL on priv_db.* to test_noprivs@localhost;
|
||||
revoke SELECT on priv_db.* from test_noprivs@localhost;
|
||||
show grants for test_noprivs@localhost;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT INSERT, UPDATE, 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'
|
||||
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER ON `priv_db`.* TO 'test_noprivs'@'localhost'
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
|
||||
grant SUPER on *.* to test_yesprivs@localhost;
|
||||
grant TRIGGER on *.* to test_yesprivs@localhost;
|
||||
grant SELECT on priv_db.* to test_yesprivs@localhost;
|
||||
show grants for test_yesprivs@localhost;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT 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@localhost
|
||||
GRANT SUPER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT INSERT, UPDATE, 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'
|
||||
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER ON `priv_db`.* TO 'test_noprivs'@'localhost'
|
||||
use priv_db;
|
||||
|
||||
Trigger create disabled - should fail - Bug 8887
|
||||
@ -529,7 +506,7 @@ before trig 3.5.3.8-1b
|
||||
drop trigger trg5b_1;
|
||||
show grants;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT ON `priv_db`.* TO 'test_yesprivs'@'localhost'
|
||||
use priv_db;
|
||||
create trigger trg5b_2 before UPDATE on t1 for each row
|
||||
@ -539,10 +516,6 @@ insert into t1 (f1) values ('insert 3.5.3.8-2b');
|
||||
select @test_var;
|
||||
@test_var
|
||||
before trig 3.5.3.8-2b
|
||||
|
||||
UPDATE priv added to bypass bug 15166
|
||||
-------------------------------------
|
||||
grant UPDATE on priv_db.* to test_yesprivs@localhost;
|
||||
update t1 set f1= 'update 3.5.3.8-2b' where f1 = 'insert 3.5.3.8-2b';
|
||||
select @test_var;
|
||||
@test_var
|
||||
@ -552,26 +525,26 @@ drop trigger trg5b_2;
|
||||
Testcase 3.5.3.8c:
|
||||
------------------
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
|
||||
grant SUPER on *.* to test_noprivs@localhost;
|
||||
grant TRIGGER on *.* to test_noprivs@localhost;
|
||||
grant ALL on priv_db.t1 to test_noprivs@localhost;
|
||||
revoke SELECT on priv_db.t1 from test_noprivs@localhost;
|
||||
show grants for test_noprivs@localhost;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
|
||||
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
|
||||
grant SUPER on *.* to test_yesprivs@localhost;
|
||||
grant TRIGGER 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@localhost
|
||||
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER 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);
|
||||
show grants;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
|
||||
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
|
||||
use priv_db;
|
||||
|
||||
Trigger create disabled - should fail - Bug 8887
|
||||
@ -584,16 +557,12 @@ before trig 3.5.3.8-1c
|
||||
drop trigger trg5c_1;
|
||||
show grants;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
|
||||
use priv_db;
|
||||
create trigger trg5c_2 before INSERT on t1 for each row
|
||||
set @test_var= new.f1;
|
||||
set @test_var='before trig 3.5.3.8-2c';
|
||||
|
||||
UPDATE priv added to bypass bug 15166
|
||||
-------------------------------------
|
||||
grant UPDATE on priv_db.t1 to test_yesprivs@localhost;
|
||||
insert into t1 (f1) values ('insert 3.5.3.8-2c');
|
||||
select @test_var;
|
||||
@test_var
|
||||
@ -603,24 +572,24 @@ drop trigger trg5c_2;
|
||||
Testcase: 3.5.3.8d:
|
||||
-------------------
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
|
||||
grant SUPER on *.* to test_noprivs@localhost;
|
||||
grant TRIGGER on *.* to test_noprivs@localhost;
|
||||
grant UPDATE (f1), INSERT (f1) on priv_db.t1 to test_noprivs@localhost;
|
||||
show grants for test_noprivs@localhost;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
|
||||
grant SUPER on *.* to test_yesprivs@localhost;
|
||||
grant TRIGGER on *.* to test_yesprivs@localhost;
|
||||
grant SELECT (f1) on priv_db.t1 to test_yesprivs@localhost;
|
||||
show grants for test_noprivs@localhost;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'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@localhost
|
||||
GRANT SUPER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
|
||||
use priv_db;
|
||||
|
||||
@ -634,16 +603,12 @@ before trig 3.5.3.8-1d
|
||||
drop trigger trg5d_1;
|
||||
show grants;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT (f1) ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
|
||||
use priv_db;
|
||||
create trigger trg5d_2 before INSERT on t1 for each row
|
||||
set @test_var= new.f1;
|
||||
set @test_var='before trig 3.5.3.8-2d';
|
||||
|
||||
UPDATE priv added to bypass bug 15166
|
||||
-------------------------------------
|
||||
grant UPDATE (f1) on priv_db.t1 to test_yesprivs@localhost;
|
||||
insert into t1 (f1) values ('insert 3.5.3.8-2d');
|
||||
select @test_var;
|
||||
@test_var
|
||||
@ -658,12 +623,12 @@ drop table if exists t2;
|
||||
create table t1 (f1 int) engine= memory;
|
||||
create table t2 (f2 int) engine= memory;
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
|
||||
grant SUPER on *.* to test_yesprivs@localhost;
|
||||
grant TRIGGER on *.* to test_yesprivs@localhost;
|
||||
grant SELECT, UPDATE on priv_db.t1 to test_yesprivs@localhost;
|
||||
grant SELECT on priv_db.t2 to test_yesprivs@localhost;
|
||||
show grants for test_yesprivs@localhost;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT ON `priv_db`.`t2` TO 'test_yesprivs'@'localhost'
|
||||
GRANT SELECT, UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
|
||||
connect(localhost,test_yesprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
|
||||
@ -679,10 +644,10 @@ ERROR 42000: INSERT command denied to user 'test_yesprivs'@'localhost' for table
|
||||
revoke SELECT on priv_db.t2 from test_yesprivs@localhost;
|
||||
grant INSERT on priv_db.t2 to test_yesprivs@localhost;
|
||||
insert into t1 (f1) values (4);
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
4
|
||||
select f2 from t2;
|
||||
select f2 from t2 order by f2;
|
||||
f2
|
||||
4
|
||||
use priv_db;
|
||||
@ -695,11 +660,11 @@ ERROR 42000: UPDATE command denied to user 'test_yesprivs'@'localhost' for table
|
||||
revoke INSERT on priv_db.t2 from test_yesprivs@localhost;
|
||||
grant UPDATE on priv_db.t2 to test_yesprivs@localhost;
|
||||
insert into t1 (f1) values (2);
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
4
|
||||
2
|
||||
select f2 from t2;
|
||||
4
|
||||
select f2 from t2 order by f2;
|
||||
f2
|
||||
1
|
||||
use priv_db;
|
||||
@ -712,12 +677,12 @@ ERROR 42000: SELECT command denied to user 'test_yesprivs'@'localhost' for table
|
||||
revoke UPDATE on priv_db.t2 from test_yesprivs@localhost;
|
||||
grant SELECT on priv_db.t2 to test_yesprivs@localhost;
|
||||
insert into t1 (f1) values (1);
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
4
|
||||
2
|
||||
1
|
||||
select f2 from t2;
|
||||
2
|
||||
4
|
||||
select f2 from t2 order by f2;
|
||||
f2
|
||||
1
|
||||
select @aaa;
|
||||
@ -733,13 +698,13 @@ ERROR 42000: DELETE command denied to user 'test_yesprivs'@'localhost' for table
|
||||
revoke SELECT on priv_db.t2 from test_yesprivs@localhost;
|
||||
grant DELETE on priv_db.t2 to test_yesprivs@localhost;
|
||||
insert into t1 (f1) values (1);
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
4
|
||||
1
|
||||
1
|
||||
2
|
||||
1
|
||||
1
|
||||
select f2 from t2;
|
||||
4
|
||||
select f2 from t2 order by f2;
|
||||
f2
|
||||
drop database if exists priv_db;
|
||||
drop user test_yesprivs@localhost;
|
||||
|
@ -89,18 +89,18 @@ Create trigger trg1 BEFORE INSERT on t1
|
||||
for each row set new.f1='Trigger 3.5.4.1';
|
||||
Use db_drop;
|
||||
Insert into t1 values ('Insert error 3.5.4.1');
|
||||
Select * from t1;
|
||||
Select * from t1 order by f1;
|
||||
f1
|
||||
Trigger 3.5.4.1
|
||||
drop trigger trg1;
|
||||
select trigger_schema, trigger_name, event_object_table
|
||||
from information_schema.triggers;
|
||||
from information_schema.triggers order by trigger_name;
|
||||
trigger_schema trigger_name event_object_table
|
||||
Insert into t1 values ('Insert no trigger 3.5.4.1');
|
||||
Select * from t1;
|
||||
Select * from t1 order by f1;
|
||||
f1
|
||||
Trigger 3.5.4.1
|
||||
Insert no trigger 3.5.4.1
|
||||
Trigger 3.5.4.1
|
||||
drop trigger trg1;
|
||||
drop database if exists db_drop;
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM 'test_general'@'localhost';
|
||||
@ -254,7 +254,7 @@ use dbtest_one;
|
||||
Insert into dbtest_two.t2 values ('2nd Insert 3.5.5.4');
|
||||
Warnings:
|
||||
Warning 1265 Data truncated for column 'f1' at row 1
|
||||
Select * from dbtest_two.t2;
|
||||
Select * from dbtest_two.t2 order by f1;
|
||||
f1
|
||||
1st Insert 3.5.
|
||||
2nd Insert 3.5.
|
||||
|
@ -135,10 +135,10 @@ values ('1', 'Test 3.5.8.4', 222, 23456, 1.05);
|
||||
Select f120, f122, f136, f144, f163 from tb3 where f122= 'Test 3.5.8.4';
|
||||
f120 f122 f136 f144 f163
|
||||
1 Test 3.5.8.4 00222 0000023456 1.050000000000000000000000000000
|
||||
select * from db_test.t1_i;
|
||||
select * from db_test.t1_i order by i120;
|
||||
i120 i136 i144 i163
|
||||
1 00222 0000023456 1.050000000000000000000000000000
|
||||
select * from db_test.t1_u;
|
||||
select * from db_test.t1_u order by u120;
|
||||
u120 u136 u144 u163
|
||||
a 00111 0000099999 999.990000000000000000000000000000
|
||||
b 00222 0000023456 1.050000000000000000000000000000
|
||||
@ -146,7 +146,7 @@ c 00333 0000099999 999.990000000000000000000000000000
|
||||
d 00222 0000023456 1.050000000000000000000000000000
|
||||
e 00222 0000023456 1.050000000000000000000000000000
|
||||
f 00333 0000099999 999.990000000000000000000000000000
|
||||
select * from db_test.t1_d;
|
||||
select * from db_test.t1_d order by d120;
|
||||
d120 d136 d144 d163
|
||||
a 00111 0000099999 999.990000000000000000000000000000
|
||||
c 00333 0000099999 999.990000000000000000000000000000
|
||||
@ -158,14 +158,22 @@ select @test_var;
|
||||
3.5.8.4 - single SQL - insert
|
||||
-----------------------------
|
||||
Create trigger trg2 BEFORE UPDATE on tb3 for each row
|
||||
BEGIN
|
||||
insert into db_test.t1_i
|
||||
values (new.f120, new.f136, new.f144, new.f163);
|
||||
END//
|
||||
Select f120, f122, f136, f144, f163 from tb3 where f122 like 'Test 3.5.8.4%';
|
||||
f120 f122 f136 f144 f163
|
||||
1 Test 3.5.8.4 00222 0000023456 1.050000000000000000000000000000
|
||||
select * from db_test.t1_i order by i120;
|
||||
i120 i136 i144 i163
|
||||
1 00222 0000023456 1.050000000000000000000000000000
|
||||
update tb3 set f120='I', f122='Test 3.5.8.4-Single Insert'
|
||||
where f122='Test 3.5.8.4';
|
||||
Select f120, f122, f136, f144, f163 from tb3 where f122 like 'Test 3.5.8.4%';
|
||||
f120 f122 f136 f144 f163
|
||||
I Test 3.5.8.4-Single Insert 00222 0000023456 1.050000000000000000000000000000
|
||||
select * from db_test.t1_i;
|
||||
select * from db_test.t1_i order by i120;
|
||||
i120 i136 i144 i163
|
||||
1 00222 0000023456 1.050000000000000000000000000000
|
||||
I 00222 0000023456 1.050000000000000000000000000000
|
||||
@ -182,14 +190,14 @@ update tb3 set f120='U', f122='Test 3.5.8.4-Single Update'
|
||||
Select f120, f122, f136, f144, f163 from tb3 where f122 like 'Test 3.5.8.4%';
|
||||
f120 f122 f136 f144 f163
|
||||
U Test 3.5.8.4-Single Update 00222 0000023456 1.050000000000000000000000000000
|
||||
select * from db_test.t1_u;
|
||||
select * from db_test.t1_u order by u120;
|
||||
u120 u136 u144 u163
|
||||
a 00111 0000099999 999.990000000000000000000000000000
|
||||
U 00222 0000023456 1.050000000000000000000000000000
|
||||
c 00333 0000099999 999.990000000000000000000000000000
|
||||
U 00222 0000023456 1.050000000000000000000000000000
|
||||
U 00222 0000023456 1.050000000000000000000000000000
|
||||
f 00333 0000099999 999.990000000000000000000000000000
|
||||
U 00222 0000023456 1.050000000000000000000000000000
|
||||
U 00222 0000023456 1.050000000000000000000000000000
|
||||
U 00222 0000023456 1.050000000000000000000000000000
|
||||
|
||||
3.5.8.3/4 - single SQL - delete
|
||||
-------------------------------
|
||||
@ -202,7 +210,7 @@ f122='Test 3.5.8.4-Single Delete'
|
||||
Select f120, f122, f136, f144, f163 from tb3 where f122 like 'Test 3.5.8.4%';
|
||||
f120 f122 f136 f144 f163
|
||||
D Test 3.5.8.4-Single Delete 00444 0000023456 1.050000000000000000000000000000
|
||||
select * from db_test.t1_d;
|
||||
select * from db_test.t1_d order by d120;
|
||||
d120 d136 d144 d163
|
||||
a 00111 0000099999 999.990000000000000000000000000000
|
||||
c 00333 0000099999 999.990000000000000000000000000000
|
||||
@ -249,29 +257,29 @@ END//
|
||||
set @test_var='Empty', @test_var2=0;
|
||||
Insert into tb3 (f120, f122, f136) values ('1', 'Test 3.5.8.5-if', 101);
|
||||
select f120, f122, f136, @test_var, @test_var2
|
||||
from tb3 where f122 = 'Test 3.5.8.5-if';
|
||||
from tb3 where f122 = 'Test 3.5.8.5-if' order by f136;
|
||||
f120 f122 f136 @test_var @test_var2
|
||||
D Test 3.5.8.5-if 00101 one 2nd else
|
||||
Insert into tb3 (f120, f122, f136) values ('2', 'Test 3.5.8.5-if', 102);
|
||||
select f120, f122, f136, @test_var, @test_var2
|
||||
from tb3 where f122 = 'Test 3.5.8.5-if';
|
||||
from tb3 where f122 = 'Test 3.5.8.5-if' order by f136;
|
||||
f120 f122 f136 @test_var @test_var2
|
||||
D Test 3.5.8.5-if 00101 two 2nd else
|
||||
D Test 3.5.8.5-if 00102 two 2nd else
|
||||
Insert into tb3 (f120, f122, f136) values ('3', 'Test 3.5.8.5-if', 10);
|
||||
select f120, f122, f136, @test_var, @test_var2
|
||||
from tb3 where f122 = 'Test 3.5.8.5-if';
|
||||
from tb3 where f122 = 'Test 3.5.8.5-if' order by f136;
|
||||
f120 f122 f136 @test_var @test_var2
|
||||
d Test 3.5.8.5-if 00010 three 2nd if
|
||||
D Test 3.5.8.5-if 00101 three 2nd if
|
||||
D Test 3.5.8.5-if 00102 three 2nd if
|
||||
d Test 3.5.8.5-if 00010 three 2nd if
|
||||
Insert into tb3 (f120, f122, f136) values ('3', 'Test 3.5.8.5-if', 103);
|
||||
select f120, f122, f136, @test_var, @test_var2
|
||||
from tb3 where f122 = 'Test 3.5.8.5-if';
|
||||
from tb3 where f122 = 'Test 3.5.8.5-if' order by f136;
|
||||
f120 f122 f136 @test_var @test_var2
|
||||
d Test 3.5.8.5-if 00010 three 2nd else
|
||||
D Test 3.5.8.5-if 00101 three 2nd else
|
||||
D Test 3.5.8.5-if 00102 three 2nd else
|
||||
d Test 3.5.8.5-if 00010 three 2nd else
|
||||
D Test 3.5.8.5-if 00103 three 2nd else
|
||||
create trigger trg3 before update on tb3 for each row
|
||||
BEGIN
|
||||
@ -331,20 +339,20 @@ set @test_var='Empty';
|
||||
Insert into tb3 (f120, f122, f136, f144)
|
||||
values ('a', 'Test 3.5.8.5-case', 5, 7);
|
||||
select f120, f122, f136, f144, @test_var
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case';
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
|
||||
f120 f122 f136 f144 @test_var
|
||||
A Test 3.5.8.5-case 00125 0000000007 A*seven
|
||||
Insert into tb3 (f120, f122, f136, f144)
|
||||
values ('b', 'Test 3.5.8.5-case', 71,16);
|
||||
select f120, f122, f136, f144, @test_var
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case';
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
|
||||
f120 f122 f136 f144 @test_var
|
||||
A Test 3.5.8.5-case 00125 0000000007 B*0000000016
|
||||
B Test 3.5.8.5-case 00191 0000000016 B*0000000016
|
||||
Insert into tb3 (f120, f122, f136, f144)
|
||||
values ('c', 'Test 3.5.8.5-case', 80,1);
|
||||
select f120, f122, f136, f144, @test_var
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case';
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
|
||||
f120 f122 f136 f144 @test_var
|
||||
A Test 3.5.8.5-case 00125 0000000007 C=one
|
||||
B Test 3.5.8.5-case 00191 0000000016 C=one
|
||||
@ -354,34 +362,34 @@ values ('d', 'Test 3.5.8.5-case', 152);
|
||||
Warnings:
|
||||
Warning 1265 Data truncated for column 'f120' at row 1
|
||||
select f120, f122, f136, f144, @test_var
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case';
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
|
||||
f120 f122 f136 f144 @test_var
|
||||
1 Test 3.5.8.5-case 00152 0000099999 1*0000099999
|
||||
A Test 3.5.8.5-case 00125 0000000007 1*0000099999
|
||||
B Test 3.5.8.5-case 00191 0000000016 1*0000099999
|
||||
C Test 3.5.8.5-case 00200 0000000001 1*0000099999
|
||||
1 Test 3.5.8.5-case 00152 0000099999 1*0000099999
|
||||
Insert into tb3 (f120, f122, f136, f144)
|
||||
values ('e', 'Test 3.5.8.5-case', 200, 8);
|
||||
Warnings:
|
||||
Warning 1265 Data truncated for column 'f120' at row 1
|
||||
select f120, f122, f136, f144, @test_var
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case';
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
|
||||
f120 f122 f136 f144 @test_var
|
||||
1 Test 3.5.8.5-case 00152 0000099999 1=eight
|
||||
1 Test 3.5.8.5-case 00200 0000000008 1=eight
|
||||
A Test 3.5.8.5-case 00125 0000000007 1=eight
|
||||
B Test 3.5.8.5-case 00191 0000000016 1=eight
|
||||
C Test 3.5.8.5-case 00200 0000000001 1=eight
|
||||
1 Test 3.5.8.5-case 00152 0000099999 1=eight
|
||||
1 Test 3.5.8.5-case 00200 0000000008 1=eight
|
||||
Insert into tb3 (f120, f122, f136, f144)
|
||||
values ('f', 'Test 3.5.8.5-case', 100, 8);
|
||||
select f120, f122, f136, f144, @test_var
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case';
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
|
||||
f120 f122 f136 f144 @test_var
|
||||
1 Test 3.5.8.5-case 00152 0000099999 1=eight
|
||||
1 Test 3.5.8.5-case 00200 0000000008 1=eight
|
||||
A Test 3.5.8.5-case 00125 0000000007 1=eight
|
||||
B Test 3.5.8.5-case 00191 0000000016 1=eight
|
||||
C Test 3.5.8.5-case 00200 0000000001 1=eight
|
||||
1 Test 3.5.8.5-case 00152 0000099999 1=eight
|
||||
1 Test 3.5.8.5-case 00200 0000000008 1=eight
|
||||
create trigger trg3a before update on tb3 for each row
|
||||
BEGIN
|
||||
CASE
|
||||
|
@ -116,7 +116,7 @@ set @tr_var_af_118=old.f118, @tr_var_af_121=old.f121,
|
||||
Insert into tb3 (f122, f136, f163)
|
||||
values ('Test 3.5.9.3', 7, 123.17);
|
||||
Update tb3 Set f136=8 where f122='Test 3.5.9.3';
|
||||
select f118, f121, f122, f136, f163 from tb3 where f122='Test 3.5.9.3';
|
||||
select f118, f121, f122, f136, f163 from tb3 where f122='Test 3.5.9.3' order by f136;
|
||||
f118 f121 f122 f136 f163
|
||||
a NULL Test 3.5.9.3 00008 123.170000000000000000000000000000
|
||||
select @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122,
|
||||
@ -132,7 +132,7 @@ a NULL Test 3.5.9.3 7 123.170000000000000000000000000000
|
||||
@tr_var_af_118 @tr_var_af_121 @tr_var_af_122 @tr_var_af_136 @tr_var_af_163
|
||||
0 0 0 0 0
|
||||
delete from tb3 where f122='Test 3.5.9.3';
|
||||
select f118, f121, f122, f136, f163 from tb3 where f122='Test 3.5.9.3';
|
||||
select f118, f121, f122, f136, f163 from tb3 where f122='Test 3.5.9.3' order by f136;
|
||||
f118 f121 f122 f136 f163
|
||||
select @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122,
|
||||
@tr_var_b4_136, @tr_var_b4_163;
|
||||
@ -172,7 +172,7 @@ set @tr_var_af_118=new.f118, @tr_var_af_121=new.f121,
|
||||
Insert into tb3 (f122, f136, f151, f163)
|
||||
values ('Test 3.5.9.4', 7, DEFAULT, 995.24);
|
||||
select f118, f121, f122, f136, f151, f163 from tb3
|
||||
where f122 like 'Test 3.5.9.4%';
|
||||
where f122 like 'Test 3.5.9.4%' order by f163;
|
||||
f118 f121 f122 f136 f151 f163
|
||||
a NULL Test 3.5.9.4 00007 999 995.240000000000000000000000000000
|
||||
select @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122,
|
||||
@ -190,9 +190,9 @@ a NULL Test 3.5.9.4 7 999 995.240000000000000000000000000000
|
||||
Update tb3 Set f122='Test 3.5.9.4-trig', f136=NULL, f151=DEFAULT, f163=NULL
|
||||
where f122='Test 3.5.9.4';
|
||||
Warnings:
|
||||
Warning 1263 Column was set to data type implicit default; NULL supplied for NOT NULL column 'f136' at row 11
|
||||
Warning 1048 Column 'f136' cannot be null
|
||||
select f118, f121, f122, f136, f151, f163 from tb3
|
||||
where f122 like 'Test 3.5.9.4-trig';
|
||||
where f122 like 'Test 3.5.9.4-trig' order by f163;
|
||||
f118 f121 f122 f136 f151 f163
|
||||
a NULL Test 3.5.9.4-trig 00000 999 NULL
|
||||
select @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122,
|
||||
|
@ -83,7 +83,7 @@ Insert into vw11 (f122, f151) values ('Test 3.5.10.1/2/3', 1);
|
||||
Insert into vw11 (f122, f151) values ('Test 3.5.10.1/2/3', 2);
|
||||
Insert into vw11 (f122, f151) values ('Not in View', 3);
|
||||
select f121, f122, f151, f163
|
||||
from tb3 where f122 like 'Test 3.5.10.1/2/3%';
|
||||
from tb3 where f122 like 'Test 3.5.10.1/2/3%' order by f151;
|
||||
f121 f122 f151 f163
|
||||
NULL Test 3.5.10.1/2/3 1 111.110000000000000000000000000000
|
||||
NULL Test 3.5.10.1/2/3 2 111.110000000000000000000000000000
|
||||
@ -97,7 +97,7 @@ f121 f122 f151 f163
|
||||
NULL Not in View 3 111.110000000000000000000000000000
|
||||
Update vw11 set f163=1;
|
||||
select f121, f122, f151, f163 from tb3
|
||||
where f122 like 'Test 3.5.10.1/2/3%';
|
||||
where f122 like 'Test 3.5.10.1/2/3%' order by f151;
|
||||
f121 f122 f151 f163
|
||||
Y Test 3.5.10.1/2/3-Update 1 1.000000000000000000000000000000
|
||||
Y Test 3.5.10.1/2/3-Update 2 1.000000000000000000000000000000
|
||||
@ -111,7 +111,7 @@ before delete
|
||||
0
|
||||
delete from vw11 where f151=1;
|
||||
select f121, f122, f151, f163 from tb3
|
||||
where f122 like 'Test 3.5.10.1/2/3%';
|
||||
where f122 like 'Test 3.5.10.1/2/3%' order by f151;
|
||||
f121 f122 f151 f163
|
||||
Y Test 3.5.10.1/2/3-Update 2 1.000000000000000000000000000000
|
||||
select f121, f122, f151, f163 from vw11;
|
||||
@ -142,7 +142,7 @@ load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t9.txt' into table tb_load;
|
||||
select @counter as 'Rows Loaded After';
|
||||
Rows Loaded After
|
||||
10
|
||||
Select * from tb_load limit 10;
|
||||
Select * from tb_load order by f1 limit 10;
|
||||
f1 f2 f3
|
||||
-5000 a` 1000
|
||||
-4999 aaa 999
|
||||
@ -237,7 +237,7 @@ insert into t3 (f1) values (new.f1+1000);
|
||||
create trigger tr2_4 after insert on t2_4 for each row
|
||||
insert into t3 (f1) values (new.f1+10000);
|
||||
insert into t1 values (1);
|
||||
select * from t3;
|
||||
select * from t3 order by f1;
|
||||
f1
|
||||
12
|
||||
102
|
||||
@ -272,17 +272,17 @@ create trigger tr4 after insert on t4
|
||||
for each row insert into t1 (f1) values (new.f4+1);
|
||||
insert into t1 values (1);
|
||||
ERROR HY000: Can't update table 't1' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
|
||||
select * from t1;
|
||||
select * from t1 order by f1;
|
||||
f1
|
||||
0
|
||||
1
|
||||
select * from t2;
|
||||
select * from t2 order by f2;
|
||||
f2
|
||||
2
|
||||
select * from t3;
|
||||
select * from t3 order by f3;
|
||||
f3
|
||||
3
|
||||
select * from t4;
|
||||
select * from t4 order by f4;
|
||||
f4
|
||||
4
|
||||
drop trigger tr1;
|
||||
@ -369,7 +369,7 @@ create table t4 (f4 tinyint) engine = memory;
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`f1` int(11) default NULL
|
||||
`f1` int(11) DEFAULT NULL
|
||||
) ENGINE=MEMORY DEFAULT CHARSET=latin1
|
||||
insert into t1 values (1);
|
||||
create trigger tr1 after insert on t1
|
||||
@ -381,16 +381,16 @@ for each row insert into t4 (f4) values (new.f3+1000);
|
||||
set autocommit=0;
|
||||
start transaction;
|
||||
insert into t1 values (1);
|
||||
ERROR 22003: Out of range value adjusted for column 'f4' at row 1
|
||||
ERROR 22003: Out of range value for column 'f4' at row 1
|
||||
commit;
|
||||
select * from t1;
|
||||
select * from t1 order by f1;
|
||||
f1
|
||||
1
|
||||
1
|
||||
select * from t2;
|
||||
select * from t2 order by f2;
|
||||
f2
|
||||
2
|
||||
select * from t3;
|
||||
select * from t3 order by f3;
|
||||
f3
|
||||
3
|
||||
drop trigger tr1;
|
||||
|
@ -1930,7 +1930,7 @@ f1 f2
|
||||
2 two
|
||||
4 four
|
||||
INSERT INTO v1 VALUES(2,'two');
|
||||
ERROR 23000: Duplicate entry '2' for key 1
|
||||
ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
|
||||
INSERT INTO v1 VALUES(3,'three');
|
||||
affected rows: 1
|
||||
INSERT INTO v1 VALUES(6,'six');
|
||||
@ -1949,7 +1949,7 @@ f1 f2
|
||||
3 three
|
||||
4 four
|
||||
UPDATE v1 SET f1 = 2 WHERE f1 = 3;
|
||||
ERROR 23000: Duplicate entry '2' for key 1
|
||||
ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
|
||||
UPDATE v1 SET f2 = 'number' WHERE f1 = 3;
|
||||
affected rows: 1
|
||||
info: Rows matched: 1 Changed: 1 Warnings: 0
|
||||
@ -1997,12 +1997,12 @@ DROP VIEW IF EXISTS test.v1;
|
||||
CREATE TABLE t1 (f1 ENUM('A', 'B', 'C') NOT NULL, f2 INTEGER)
|
||||
ENGINE = memory;
|
||||
INSERT INTO t1 VALUES ('A', 1);
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 order by f1, f2;
|
||||
f1 f2
|
||||
A 1
|
||||
CREATE VIEW v1 AS SELECT * FROM t1 WHERE f2 BETWEEN 1 AND 2
|
||||
WITH CASCADED CHECK OPTION ;
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by f1, f2;
|
||||
f1 f2
|
||||
A 1
|
||||
UPDATE v1 SET f2 = 2 WHERE f2 = 1;
|
||||
@ -2010,7 +2010,7 @@ affected rows: 1
|
||||
info: Rows matched: 1 Changed: 1 Warnings: 0
|
||||
INSERT INTO v1 VALUES('B',2);
|
||||
affected rows: 1
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by f1, f2;
|
||||
f1 f2
|
||||
A 2
|
||||
B 2
|
||||
@ -2018,7 +2018,7 @@ UPDATE v1 SET f2 = 4;
|
||||
ERROR HY000: CHECK OPTION failed 'test.v1'
|
||||
INSERT INTO v1 VALUES('B',3);
|
||||
ERROR HY000: CHECK OPTION failed 'test.v1'
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by f1, f2;
|
||||
f1 f2
|
||||
A 2
|
||||
B 2
|
||||
@ -10585,7 +10585,7 @@ f1 f2 f3 f4
|
||||
DELETE FROM t1;
|
||||
INSERT INTO v1 SET f2 = 'ABC';
|
||||
INSERT INTO v1 SET f2 = 'ABC';
|
||||
ERROR 23000: Duplicate entry '0' for key 1
|
||||
ERROR 23000: Duplicate entry '0' for key 'PRIMARY'
|
||||
SELECT * from t1;
|
||||
f1 f2 f3 f4
|
||||
0 ABC NULL NULL
|
||||
@ -10654,7 +10654,7 @@ DROP VIEW v1;
|
||||
CREATE VIEW v1 AS SELECT f2, f3 FROM t1;
|
||||
INSERT INTO v1 SET f2 = 'ABC';
|
||||
INSERT INTO v1 SET f2 = 'ABC';
|
||||
ERROR 23000: Duplicate entry '0' for key 1
|
||||
ERROR 23000: Duplicate entry '0' for key 'PRIMARY'
|
||||
SELECT * from t1;
|
||||
f1 f2 f3 f4
|
||||
0 ABC NULL NULL
|
||||
@ -10989,11 +10989,11 @@ f1 bigint(20) YES NULL
|
||||
f2 date YES NULL
|
||||
f4 char(5) YES NULL
|
||||
report char(10) YES NULL
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 order by f1, report;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by f1, report;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
@ -11013,12 +11013,12 @@ f4x char(5) YES NULL
|
||||
report char(10) YES NULL
|
||||
DESCRIBE v1;
|
||||
ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 order by f1, report;
|
||||
f1 f2 f4x report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
0 NULL ABC t1 1
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by f1, report;
|
||||
ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
|
||||
ALTER TABLE t1 CHANGE COLUMN f4x f4 CHAR(5);
|
||||
ALTER TABLE t1 CHANGE COLUMN f4 f4 CHAR(10);
|
||||
@ -11036,14 +11036,14 @@ f1 bigint(20) YES NULL
|
||||
f2 date YES NULL
|
||||
f4 char(10) YES NULL
|
||||
report char(10) YES NULL
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 order by f1, report;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
0 NULL ABC t1 1
|
||||
2 NULL <-- 10 --> t1 2
|
||||
2 NULL <-- 10 --> v1 2
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by f1, report;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
@ -11072,7 +11072,7 @@ f1 bigint(20) YES NULL
|
||||
f2 date YES NULL
|
||||
f4 char(8) YES NULL
|
||||
report char(10) YES NULL
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 order by f1, report;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
@ -11081,7 +11081,7 @@ f1 f2 f4 report
|
||||
2 NULL <-- 10 - v1 2
|
||||
3 NULL <-- 10 - t1 3
|
||||
3 NULL <-- 10 - v1 3
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by f1, report;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
@ -11105,7 +11105,7 @@ f1 bigint(20) YES NULL
|
||||
f2 date YES NULL
|
||||
f4 varchar(20) YES NULL
|
||||
report char(10) YES NULL
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 order by f1, report;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
@ -11116,7 +11116,7 @@ f1 f2 f4 report
|
||||
3 NULL <-- 10 - v1 3
|
||||
4 NULL <------ 20 --------> t1 4
|
||||
4 NULL <------ 20 --------> v1 4
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by f1, report;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
@ -11144,7 +11144,7 @@ f1 varchar(30) YES NULL
|
||||
f2 date YES NULL
|
||||
f4 varchar(20) YES NULL
|
||||
report char(10) YES NULL
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 order by f1, report;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
@ -11157,7 +11157,7 @@ f1 f2 f4 report
|
||||
4 NULL <------ 20 --------> v1 4
|
||||
<------------- 30 -----------> NULL <------ 20 --------> t1 5
|
||||
<------------- 30 -----------> NULL <------ 20 --------> v1 5
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by f1, report;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
@ -11181,7 +11181,7 @@ f4 varchar(20) YES NULL
|
||||
report char(10) YES NULL
|
||||
DESCRIBE v1;
|
||||
ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 order by f1, report;
|
||||
f1 f4 report
|
||||
-1 ABC t1 0
|
||||
-1 ABC v1 0
|
||||
@ -11195,7 +11195,7 @@ f1 f4 report
|
||||
<------------- 30 -----------> <------ 20 --------> t1 5
|
||||
<------------- 30 -----------> <------ 20 --------> v1 5
|
||||
ABC <------ 20 --------> t1 6
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by f1, report;
|
||||
ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
|
||||
ALTER TABLE t1 ADD COLUMN f2 DATE DEFAULT NULL;
|
||||
INSERT INTO t1 SET f1 = 'ABC', f2 = '1500-12-04',
|
||||
@ -11214,7 +11214,7 @@ f1 varchar(30) YES NULL
|
||||
f2 date YES NULL
|
||||
f4 varchar(20) YES NULL
|
||||
report char(10) YES NULL
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 order by f1, report;
|
||||
f1 f4 report f2
|
||||
-1 ABC t1 0 NULL
|
||||
-1 ABC v1 0 NULL
|
||||
@ -11230,7 +11230,7 @@ f1 f4 report f2
|
||||
ABC <------ 20 --------> t1 6 NULL
|
||||
ABC <------ 20 --------> t1 7 1500-12-04
|
||||
ABC <------ 20 --------> v1 7 1500-12-04
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by f1, report;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
@ -11264,7 +11264,7 @@ f1 varchar(30) YES NULL
|
||||
f2 float YES NULL
|
||||
f4 varchar(20) YES NULL
|
||||
report char(10) YES NULL
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 order by f1, report;
|
||||
f1 f4 report f2
|
||||
-1 ABC t1 0 NULL
|
||||
-1 ABC v1 0 NULL
|
||||
@ -11279,10 +11279,10 @@ f1 f4 report f2
|
||||
<------------- 30 -----------> <------ 20 --------> v1 5 NULL
|
||||
ABC <------ 20 --------> t1 6 NULL
|
||||
ABC <------ 20 --------> t1 7 NULL
|
||||
ABC <------ 20 --------> v1 7 NULL
|
||||
ABC <------ 20 --------> t1 8 -0.00033
|
||||
ABC <------ 20 --------> v1 7 NULL
|
||||
ABC <------ 20 --------> v1 8 -0.00033
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by f1, report;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
@ -11297,8 +11297,8 @@ f1 f2 f4 report
|
||||
<------------- 30 -----------> NULL <------ 20 --------> v1 5
|
||||
ABC NULL <------ 20 --------> t1 6
|
||||
ABC NULL <------ 20 --------> t1 7
|
||||
ABC NULL <------ 20 --------> v1 7
|
||||
ABC -0.00033 <------ 20 --------> t1 8
|
||||
ABC NULL <------ 20 --------> v1 7
|
||||
ABC -0.00033 <------ 20 --------> v1 8
|
||||
ALTER TABLE t1 ADD COLUMN f3 NUMERIC(7,2);
|
||||
INSERT INTO t1 SET f1 = 'ABC', f2 = -3.3E-4,
|
||||
@ -11321,7 +11321,7 @@ f1 varchar(30) YES NULL
|
||||
f2 float YES NULL
|
||||
f4 varchar(20) YES NULL
|
||||
report char(10) YES NULL
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 order by f1, report;
|
||||
f1 f4 report f2 f3
|
||||
-1 ABC t1 0 NULL NULL
|
||||
-1 ABC v1 0 NULL NULL
|
||||
@ -11336,12 +11336,12 @@ f1 f4 report f2 f3
|
||||
<------------- 30 -----------> <------ 20 --------> v1 5 NULL NULL
|
||||
ABC <------ 20 --------> t1 6 NULL NULL
|
||||
ABC <------ 20 --------> t1 7 NULL NULL
|
||||
ABC <------ 20 --------> v1 7 NULL NULL
|
||||
ABC <------ 20 --------> t1 8 -0.00033 NULL
|
||||
ABC <------ 20 --------> v1 8 -0.00033 NULL
|
||||
ABC <------ 20 --------> t1 9 -0.00033 -2.20
|
||||
ABC <------ 20 --------> v1 7 NULL NULL
|
||||
ABC <------ 20 --------> v1 8 -0.00033 NULL
|
||||
ABC <------ 20 --------> v1 9a -0.00033 NULL
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by f1, report;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
@ -11356,10 +11356,10 @@ f1 f2 f4 report
|
||||
<------------- 30 -----------> NULL <------ 20 --------> v1 5
|
||||
ABC NULL <------ 20 --------> t1 6
|
||||
ABC NULL <------ 20 --------> t1 7
|
||||
ABC NULL <------ 20 --------> v1 7
|
||||
ABC -0.00033 <------ 20 --------> t1 8
|
||||
ABC -0.00033 <------ 20 --------> v1 8
|
||||
ABC -0.00033 <------ 20 --------> t1 9
|
||||
ABC NULL <------ 20 --------> v1 7
|
||||
ABC -0.00033 <------ 20 --------> v1 8
|
||||
ABC -0.00033 <------ 20 --------> v1 9a
|
||||
DROP TABLE t1;
|
||||
DROP VIEW v1;
|
||||
@ -11374,10 +11374,10 @@ DESCRIBE v1;
|
||||
Field Type Null Key Default Extra
|
||||
f1 char(10) YES NULL
|
||||
my_sqrt double YES NULL
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 order by f1, f2;
|
||||
f1 f2
|
||||
ABC 3
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by 2;
|
||||
f1 my_sqrt
|
||||
ABC 1.7320508075689
|
||||
ALTER TABLE t1 CHANGE COLUMN f2 f2 VARCHAR(30);
|
||||
@ -11390,21 +11390,21 @@ DESCRIBE v1;
|
||||
Field Type Null Key Default Extra
|
||||
f1 char(10) YES NULL
|
||||
my_sqrt double YES NULL
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 order by f1, f2;
|
||||
f1 f2
|
||||
ABC 3
|
||||
ABC DEF
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by 2;
|
||||
f1 my_sqrt
|
||||
ABC 1.7320508075689
|
||||
ABC 0
|
||||
ABC 1.7320508075689
|
||||
SELECT SQRT('DEF');
|
||||
SQRT('DEF')
|
||||
0
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect DOUBLE value: 'DEF'
|
||||
CREATE VIEW v2 AS SELECT SQRT('DEF');
|
||||
SELECT * FROM v2;
|
||||
SELECT * FROM v2 order by 1;
|
||||
SQRT('DEF')
|
||||
0
|
||||
Warnings:
|
||||
@ -11414,27 +11414,27 @@ DESCRIBE v2;
|
||||
Field Type Null Key Default Extra
|
||||
f1 char(10) YES NULL
|
||||
my_sqrt double YES NULL
|
||||
SELECT * FROM v2;
|
||||
SELECT * FROM v2 order by 2;
|
||||
f1 my_sqrt
|
||||
ABC 0
|
||||
ABC 1.7320508075689
|
||||
ABC 0
|
||||
CREATE TABLE t2 AS SELECT f1, SQRT(f2) my_sqrt FROM t1;
|
||||
SELECT * FROM t2;
|
||||
SELECT * FROM t2 order by 2;
|
||||
f1 my_sqrt
|
||||
ABC 1.73205080756888
|
||||
ABC 0
|
||||
ABC 1.73205080756888
|
||||
DROP TABLE t2;
|
||||
CREATE TABLE t2 AS SELECT * FROM v1;
|
||||
SELECT * FROM t2;
|
||||
SELECT * FROM t2 order by 2;
|
||||
f1 my_sqrt
|
||||
ABC 1.73205080756888
|
||||
ABC 0
|
||||
ABC 1.73205080756888
|
||||
DROP TABLE t2;
|
||||
CREATE TABLE t2 AS SELECT * FROM v2;
|
||||
SELECT * FROM t2;
|
||||
SELECT * FROM t2 order by 2;
|
||||
f1 my_sqrt
|
||||
ABC 1.73205080756888
|
||||
ABC 0
|
||||
ABC 1.73205080756888
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
||||
DROP VIEW v1;
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -166,7 +166,7 @@ declare y integer default 1;
|
||||
set @x = x;
|
||||
set @y = y;
|
||||
set @z = 234;
|
||||
SELECT f1, f2 into @x, @y from t2 limit 1;
|
||||
SELECT f1, f2 into @x, @y from t2 where f1='a`' and f2='a`' limit 1;
|
||||
SELECT @x, @y, @z, invar;
|
||||
BEGIN
|
||||
set @x = 2;
|
||||
@ -209,7 +209,7 @@ BEGIN
|
||||
declare x integer; declare y integer;
|
||||
set @x=x;
|
||||
set @y=y;
|
||||
SELECT f4, f3 into @x, @y from t2 limit 1;
|
||||
SELECT f4, f3 into @x, @y from t2 where f4=-5000 and f3='1000-01-01' limit 1;
|
||||
SELECT @x, @y;
|
||||
END//
|
||||
CALL sp1();
|
||||
@ -544,6 +544,9 @@ exit handler 2
|
||||
exit handler 2
|
||||
exit handler 1
|
||||
exit handler 1
|
||||
Warnings:
|
||||
Note 1051 Unknown table 'tqq'
|
||||
Note 1051 Unknown table 'tqq'
|
||||
create table res_t1(w char unique, x char);
|
||||
insert into res_t1 values ('a', 'b');
|
||||
CREATE PROCEDURE h1 ()
|
||||
@ -1084,7 +1087,8 @@ declare f2_value char(20);
|
||||
declare f5_value char(20);
|
||||
declare f4_value integer;
|
||||
declare f6_value integer;
|
||||
declare cur1 cursor for SELECT f1, f2, f4, f5, f6 from t2 limit 3;
|
||||
declare cur1 cursor for SELECT f1, f2, f4, f5, f6 from t2
|
||||
where f4 >=-5000 order by f4 limit 3;
|
||||
open cur1;
|
||||
while proceed do
|
||||
SELECT count AS 'loop';
|
||||
@ -1167,7 +1171,7 @@ of a compound statement ends.
|
||||
DROP TABLE IF EXISTS temp1;
|
||||
DROP PROCEDURE IF EXISTS sp1;
|
||||
create table temp1( f0 char(20), f1 char(20), f2 char(20), f3 int, f4 char(20) );
|
||||
SELECT f1, f2, f4, f5 from t2;
|
||||
SELECT f1, f2, f4, f5 from t2 order by f4;
|
||||
f1 f2 f4 f5
|
||||
a` a` -5000 a`
|
||||
aaa aaa -4999 aaa
|
||||
@ -1187,21 +1191,21 @@ declare newf1 char(20);
|
||||
declare newf2 char(20);
|
||||
declare newf5 char(20);
|
||||
declare newf4 integer;
|
||||
declare cur1 cursor for SELECT f1, f2, f4, f5 from t2 limit 5;
|
||||
declare cur2 cursor for SELECT f1, f2, f4, f5 from t2 limit 5;
|
||||
declare cur1 cursor for SELECT f1, f2, f4, f5 from t2 where f4 >= -5000 order by f4 limit 5;
|
||||
declare cur2 cursor for SELECT f1, f2, f4, f5 from t2 where f4 >= -5000 order by f4 limit 5;
|
||||
open cur1;
|
||||
open cur2;
|
||||
BEGIN
|
||||
declare continue handler for sqlstate '02000' set count = 1;
|
||||
declare continue handler for sqlstate '02000' set count=1;
|
||||
fetch cur1 into newf1, newf2, newf4, newf5;
|
||||
SELECT '-1-', count, newf1, newf2, newf4, newf5;
|
||||
insert into temp1 values ('cur1_out', newf1, newf2, newf4, newf5);
|
||||
set count = 4;
|
||||
set count= 4;
|
||||
BEGIN
|
||||
while count > 0 do
|
||||
while count> 0 do
|
||||
fetch cur1 into newf1, newf2, newf4, newf5;
|
||||
SELECT '-2-', count, newf1, newf2, newf4, newf5;
|
||||
set count = count - 1;
|
||||
set count = count- 1;
|
||||
END while;
|
||||
SELECT '-3-', count, newf1, newf2, newf4, newf4;
|
||||
END;
|
||||
@ -1270,8 +1274,10 @@ declare i_newf11 char(20);
|
||||
declare i_newf12 char(20);
|
||||
declare i_newf13 date;
|
||||
declare i_newf14 integer;
|
||||
declare cur1 cursor for SELECT f1, f2, f3, f4 from t2 limit 4;
|
||||
declare cur2 cursor for SELECT f1, f2, f3, f4 from t2 limit 3;
|
||||
declare cur1 cursor for SELECT f1, f2, f3, f4 from t2
|
||||
where f4>=-5000 order by f4 limit 4;
|
||||
declare cur2 cursor for SELECT f1, f2, f3, f4 from t2
|
||||
where f4>=-5000 order by f4 limit 3;
|
||||
declare continue handler for sqlstate '02000' set proceed=0;
|
||||
open cur1;
|
||||
open cur2;
|
||||
@ -1302,8 +1308,10 @@ DECLARE o_newf11 CHAR(20);
|
||||
DECLARE o_newf12 CHAR(20);
|
||||
DECLARE o_newf13 DATE;
|
||||
DECLARE o_newf14 INTEGER;
|
||||
DECLARE cur1 CURSOR FOR SELECT f1, f2, f3, f4 FROM t2 LIMIT 5;
|
||||
DECLARE cur2 CURSOR FOR SELECT f1, f2, f3, f4 FROM t2 LIMIT 5;
|
||||
DECLARE cur1 CURSOR FOR SELECT f1, f2, f3, f4 FROM t2
|
||||
WHERE f4>=-5000 ORDER BY f4 LIMIT 5;
|
||||
DECLARE cur2 CURSOR FOR SELECT f1, f2, f3, f4 FROM t2
|
||||
WHERE f4>=-5000 ORDER BY f4 LIMIT 5;
|
||||
DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET proceed=0;
|
||||
OPEN cur1;
|
||||
OPEN cur2;
|
||||
|
@ -80,7 +80,7 @@ connect(localhost,user_1,,db_storedproc,MYSQL_PORT,MYSQL_SOCK);
|
||||
user_1@localhost db_storedproc
|
||||
CREATE PROCEDURE sp31102 () SQL SECURITY INVOKER
|
||||
BEGIN
|
||||
SELECT * FROM db_storedproc.t1 LIMIT 1;
|
||||
SELECT * FROM db_storedproc.t1 WHERE f4=-5000 LIMIT 1;
|
||||
END//
|
||||
CREATE FUNCTION fn31105(n INT) RETURNS INT
|
||||
BEGIN
|
||||
@ -209,7 +209,7 @@ CALL sp_ins_1();
|
||||
SELECT row_count();
|
||||
row_count()
|
||||
1
|
||||
SELECT * FROM temp;
|
||||
SELECT * FROM temp ORDER BY f4;
|
||||
f1 f2 f3 f4 f5 f6
|
||||
a` a` 1000-01-01 -5000 a` -5000
|
||||
aaa aaa 1000-01-02 -4999 aaa -4999
|
||||
@ -226,7 +226,7 @@ CALL sp_ins_3();
|
||||
SELECT row_count();
|
||||
row_count()
|
||||
1
|
||||
SELECT * FROM temp;
|
||||
SELECT * FROM temp ORDER BY f4;
|
||||
f1 f2 f3 f4 f5 f6
|
||||
a` a` 1000-01-01 -5000 a` -5000
|
||||
aaa aaa 1000-01-02 -4999 aaa -4999
|
||||
@ -246,7 +246,7 @@ CALL sp_upd();
|
||||
SELECT row_count();
|
||||
row_count()
|
||||
4
|
||||
SELECT * FROM temp;
|
||||
SELECT * FROM temp ORDER BY f4;
|
||||
f1 f2 f3 f4 f5 f6
|
||||
a` a` 1000-01-01 -5000 a` -5000
|
||||
aaa aaa 1000-01-02 -4999 aaa -4999
|
||||
@ -279,7 +279,7 @@ COUNT( f1 ) f1
|
||||
SELECT row_count();
|
||||
row_count()
|
||||
3
|
||||
SELECT * FROM temp;
|
||||
SELECT * FROM temp ORDER BY f4;
|
||||
f1 f2 f3 f4 f5 f6
|
||||
a` a` 1000-01-01 -5000 a` -5000
|
||||
aaa aaa 1000-01-02 -4999 aaa -4999
|
||||
|
@ -199,6 +199,9 @@ CREATE TRIGGER trg5_1 BEFORE INSERT on test.t1
|
||||
for each row set new.f3 = '14';
|
||||
CREATE TRIGGER trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ
|
||||
BEFORE UPDATE on test.t1 for each row set new.f3 = '42';
|
||||
ERROR 42000: Identifier name 'trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ' is too long
|
||||
CREATE TRIGGER trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWX
|
||||
BEFORE UPDATE on test.t1 for each row set new.f3 = '42';
|
||||
insert into t1 (f2) values ('insert 3.5.1.7');
|
||||
select * from t1;
|
||||
f1 f2 f3
|
||||
@ -207,12 +210,14 @@ update t1 set f2='update 3.5.1.7';
|
||||
select * from t1;
|
||||
f1 f2 f3
|
||||
NULL update 3.5.1.7 42
|
||||
select trigger_name from information_schema.triggers;
|
||||
select trigger_name from information_schema.triggers order by trigger_name;
|
||||
trigger_name
|
||||
trg5_1
|
||||
trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWX
|
||||
drop trigger trg5_1;
|
||||
drop trigger trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ;
|
||||
ERROR 42000: Identifier name 'trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ' is too long
|
||||
drop trigger trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWX;
|
||||
drop table t1;
|
||||
|
||||
Testcase 3.5.1.8:
|
||||
@ -314,7 +319,7 @@ insert into trig_db3.t1 (f1,f2) values ('insert to db3 t1 from db1',4);
|
||||
select @test_var1, @test_var2, @test_var3;
|
||||
@test_var1 @test_var2 @test_var3
|
||||
trig1 trig2 trig3
|
||||
select * from t1;
|
||||
select * from t1 order by f2;
|
||||
f1 f2
|
||||
trig1 1
|
||||
trig1 2
|
||||
@ -324,7 +329,7 @@ trig2 3
|
||||
select * from trig_db3.t1;
|
||||
f1 f2
|
||||
trig3 4
|
||||
select * from t1;
|
||||
select * from t1 order by f2;
|
||||
f1 f2
|
||||
trig1 1
|
||||
trig1 2
|
||||
@ -349,10 +354,10 @@ for each row set @test_var2='trig1_a';
|
||||
create trigger trig_db2.trig2 before insert on trig_db2.t1
|
||||
for each row set @test_var3='trig2';
|
||||
select trigger_schema, trigger_name, event_object_table
|
||||
from information_schema.triggers;
|
||||
from information_schema.triggers order by trigger_name;
|
||||
trigger_schema trigger_name event_object_table
|
||||
trig_db1 trig1_b t1
|
||||
trig_db1 trig1_a t1
|
||||
trig_db1 trig1_b t1
|
||||
trig_db2 trig2 t1
|
||||
set @test_var1= '', @test_var2= '', @test_var3= '';
|
||||
insert into t1 (f1,f2) values ('insert to db1 t1 from db1',352);
|
||||
|
@ -82,16 +82,16 @@ 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;
|
||||
revoke TRIGGER on *.* from test_noprivs@localhost;
|
||||
show grants for test_noprivs@localhost;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT 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'
|
||||
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 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 TRIGGER 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@localhost
|
||||
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER 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);
|
||||
@ -104,10 +104,10 @@ test_noprivs@localhost
|
||||
use priv_db;
|
||||
create trigger trg1_1 before INSERT on t1 for each row
|
||||
set new.f1 = 'trig 3.5.3.2_1-no';
|
||||
ERROR 42000: Access denied; you need the SUPER privilege for this operation
|
||||
Got one of the listed errors
|
||||
use priv_db;
|
||||
insert into t1 (f1) values ('insert 3.5.3.2-no');
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
select current_user;
|
||||
@ -122,15 +122,12 @@ root@localhost
|
||||
use 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;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
grant UPDATE on priv_db.t1 to test_yesprivs@localhost;
|
||||
|
||||
note: once 15166 is fixed a similar case for SELECT needs to be added
|
||||
---------------------------------------------------------------------
|
||||
insert into t1 (f1) values ('insert 3.5.3.2-yes');
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
trig 3.5.3.2_2-yes
|
||||
@ -139,10 +136,10 @@ Testcase 3.5.3.6:
|
||||
-----------------
|
||||
use priv_db;
|
||||
drop trigger trg1_2;
|
||||
ERROR 42000: Access denied; you need the SUPER privilege for this operation
|
||||
Got one of the listed errors
|
||||
use priv_db;
|
||||
insert into t1 (f1) values ('insert 3.5.3.6-yes');
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
trig 3.5.3.2_2-yes
|
||||
@ -151,12 +148,12 @@ use priv_db;
|
||||
drop trigger trg1_2;
|
||||
use priv_db;
|
||||
insert into t1 (f1) values ('insert 3.5.3.6-no');
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
insert 3.5.3.6-no
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
drop trigger trg1_2;
|
||||
|
||||
Testcase 3.5.3.7a:
|
||||
@ -166,12 +163,12 @@ grant ALL on *.* to test_noprivs@localhost;
|
||||
revoke UPDATE on *.* from test_noprivs@localhost;
|
||||
show grants for test_noprivs@localhost;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT 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'
|
||||
GRANT 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, EVENT, TRIGGER 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;
|
||||
grant TRIGGER, UPDATE on *.* to test_yesprivs@localhost;
|
||||
show grants for test_yesprivs@localhost;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT UPDATE, SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT UPDATE, TRIGGER 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;
|
||||
@ -180,24 +177,24 @@ test_noprivs@localhost
|
||||
use priv_db;
|
||||
show grants;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT 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;
|
||||
GRANT 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, EVENT, TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
insert 3.5.3.6-no
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
|
||||
Trigger create disabled - should fail - Bug 8884
|
||||
------------------------------------------------
|
||||
insert into t1 (f1) values ('insert 3.5.3.7-1a');
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
insert 3.5.3.6-no
|
||||
insert 3.5.3.7-1a
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
drop trigger trg4a_1;
|
||||
use priv_db;
|
||||
select current_user;
|
||||
@ -205,236 +202,220 @@ current_user
|
||||
test_yesprivs@localhost
|
||||
show grants;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT UPDATE, SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT UPDATE, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
create trigger trg4a_2 before INSERT on t1 for each row
|
||||
set new.f1 = 'trig 3.5.3.7-2a';
|
||||
|
||||
SELECT priv added to bypass bug 15166
|
||||
-------------------------------------
|
||||
grant SELECT on *.* to test_yesprivs@localhost;
|
||||
insert into t1 (f1) values ('insert 3.5.3.7-2b');
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
insert 3.5.3.6-no
|
||||
insert 3.5.3.7-1a
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.7-2a
|
||||
drop trigger trg4a_2;
|
||||
|
||||
Testcase 3.5.3.7b:
|
||||
------------------
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
|
||||
grant SUPER on *.* to test_noprivs;
|
||||
grant TRIGGER 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'@'%'
|
||||
GRANT TRIGGER ON *.* TO 'test_noprivs'@'%'
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
|
||||
grant SUPER on *.* to test_yesprivs@localhost;
|
||||
grant TRIGGER on *.* to test_yesprivs@localhost;
|
||||
grant UPDATE on priv_db.* to test_yesprivs@localhost;
|
||||
show grants for test_yesprivs@localhost;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER 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@localhost
|
||||
GRANT 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'
|
||||
GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER ON `priv_db`.* TO 'test_noprivs'@'localhost'
|
||||
use priv_db;
|
||||
|
||||
Trigger create disabled - should fail - Bug 8884
|
||||
------------------------------------------------
|
||||
insert into t1 (f1) values ('insert 3.5.3.7-1b');
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
insert 3.5.3.6-no
|
||||
insert 3.5.3.7-1a
|
||||
trig 3.5.3.7-2a
|
||||
insert 3.5.3.7-1b
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.7-2a
|
||||
update t1 set f1 = 'update 3.5.3.7-1b' where f1 = 'insert 3.5.3.7-1b';
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
insert 3.5.3.6-no
|
||||
insert 3.5.3.7-1a
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.7-2a
|
||||
update 3.5.3.7-1b
|
||||
drop trigger trg4b_1;
|
||||
show grants;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER 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 row
|
||||
set new.f1 = 'trig 3.5.3.7-2b';
|
||||
|
||||
SELECT priv added to bypass bug 15166
|
||||
-------------------------------------
|
||||
grant SELECT on priv_db.* to test_yesprivs@localhost;
|
||||
insert into t1 (f1) values ('insert 3.5.3.7-2b');
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
insert 3.5.3.6-no
|
||||
insert 3.5.3.7-1a
|
||||
trig 3.5.3.7-2a
|
||||
update 3.5.3.7-1b
|
||||
insert 3.5.3.7-2b
|
||||
update t1 set f1 = 'update 3.5.3.7-2b' where f1 = 'insert 3.5.3.7-2b';
|
||||
select f1 from t1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
insert 3.5.3.6-no
|
||||
insert 3.5.3.7-1a
|
||||
trig 3.5.3.7-2a
|
||||
update 3.5.3.7-1b
|
||||
update t1 set f1 = 'update 3.5.3.7-2b' where f1 = 'insert 3.5.3.7-2b';
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
insert 3.5.3.6-no
|
||||
insert 3.5.3.7-1a
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.7-2a
|
||||
trig 3.5.3.7-2b
|
||||
update 3.5.3.7-1b
|
||||
drop 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 TRIGGER 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'@'%'
|
||||
GRANT TRIGGER ON *.* TO 'test_noprivs'@'%'
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
|
||||
grant SUPER on *.* to test_yesprivs@localhost;
|
||||
grant TRIGGER 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@localhost
|
||||
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER 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@localhost
|
||||
GRANT 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'
|
||||
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
|
||||
use priv_db;
|
||||
|
||||
Trigger create disabled - should fail - Bug 8884
|
||||
------------------------------------------------
|
||||
insert into t1 (f1) values ('insert 3.5.3.7-1c');
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
insert 3.5.3.6-no
|
||||
insert 3.5.3.7-1a
|
||||
trig 3.5.3.7-2a
|
||||
update 3.5.3.7-1b
|
||||
trig 3.5.3.7-2b
|
||||
insert 3.5.3.7-1c
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.7-2a
|
||||
trig 3.5.3.7-2b
|
||||
update 3.5.3.7-1b
|
||||
drop trigger trg4c_1;
|
||||
show grants;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER 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 row
|
||||
set new.f1 = 'trig 3.5.3.7-2c';
|
||||
|
||||
SELECT priv added to bypass bug 15166
|
||||
-------------------------------------
|
||||
grant SELECT on priv_db.t1 to test_yesprivs@localhost;
|
||||
insert into t1 (f1) values ('insert 3.5.3.7-2c');
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
insert 3.5.3.6-no
|
||||
insert 3.5.3.7-1a
|
||||
trig 3.5.3.7-2a
|
||||
update 3.5.3.7-1b
|
||||
trig 3.5.3.7-2b
|
||||
insert 3.5.3.7-1c
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.7-2a
|
||||
trig 3.5.3.7-2b
|
||||
trig 3.5.3.7-2c
|
||||
update 3.5.3.7-1b
|
||||
drop 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 TRIGGER 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'@'%'
|
||||
GRANT TRIGGER ON *.* TO 'test_noprivs'@'%'
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
|
||||
grant SUPER on *.* to test_yesprivs@localhost;
|
||||
grant TRIGGER on *.* to test_yesprivs@localhost;
|
||||
grant UPDATE (f1) on priv_db.t1 to test_yesprivs@localhost;
|
||||
show grants for test_noprivs;
|
||||
Grants for test_noprivs@%
|
||||
GRANT SUPER ON *.* TO 'test_noprivs'@'%'
|
||||
GRANT TRIGGER ON *.* TO 'test_noprivs'@'%'
|
||||
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@localhost
|
||||
GRANT SUPER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT (f1), INSERT (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
|
||||
use priv_db;
|
||||
|
||||
Trigger create disabled - should fail - Bug 8884
|
||||
------------------------------------------------
|
||||
insert into t1 (f1) values ('insert 3.5.3.7-1d');
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
insert 3.5.3.6-no
|
||||
insert 3.5.3.7-1a
|
||||
trig 3.5.3.7-2a
|
||||
update 3.5.3.7-1b
|
||||
trig 3.5.3.7-2b
|
||||
insert 3.5.3.7-1c
|
||||
trig 3.5.3.7-2c
|
||||
insert 3.5.3.7-1d
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.7-2a
|
||||
trig 3.5.3.7-2b
|
||||
trig 3.5.3.7-2c
|
||||
update 3.5.3.7-1b
|
||||
drop trigger trg4d_1;
|
||||
show grants;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT UPDATE (f1) ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
|
||||
use priv_db;
|
||||
create trigger trg4d_2 before INSERT on t1 for each row
|
||||
set new.f1 = 'trig 3.5.3.7-2d';
|
||||
|
||||
SELECT priv added to bypass bug 15166
|
||||
-------------------------------------
|
||||
grant SELECT (f1) on priv_db.t1 to test_yesprivs@localhost;
|
||||
insert into t1 (f1) values ('insert 3.5.3.7-2d');
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
insert 3.5.3.6-no
|
||||
insert 3.5.3.7-1a
|
||||
trig 3.5.3.7-2a
|
||||
update 3.5.3.7-1b
|
||||
trig 3.5.3.7-2b
|
||||
insert 3.5.3.7-1c
|
||||
trig 3.5.3.7-2c
|
||||
insert 3.5.3.7-1d
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.7-2a
|
||||
trig 3.5.3.7-2b
|
||||
trig 3.5.3.7-2c
|
||||
trig 3.5.3.7-2d
|
||||
update 3.5.3.7-1b
|
||||
drop trigger trg4d_2;
|
||||
|
||||
Testcase 3.5.3.8a:
|
||||
@ -444,12 +425,12 @@ grant ALL on *.* to test_noprivs@localhost;
|
||||
revoke SELECT on *.* from test_noprivs@localhost;
|
||||
show grants for test_noprivs@localhost;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT 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 ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT 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, TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
|
||||
grant SUPER, SELECT on *.* to test_yesprivs@localhost;
|
||||
grant TRIGGER, SELECT on *.* to test_yesprivs@localhost;
|
||||
show grants for test_yesprivs@localhost;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT SELECT, SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT, TRIGGER 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;
|
||||
@ -458,7 +439,7 @@ test_noprivs@localhost
|
||||
use priv_db;
|
||||
show grants;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT 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 ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT 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, TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
|
||||
Trigger create disabled - should fail - Bug 8887
|
||||
------------------------------------------------
|
||||
@ -477,17 +458,13 @@ current_user
|
||||
test_yesprivs@localhost
|
||||
show grants;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT SELECT, SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
create trigger trg5a_2 before INSERT on t1 for each row
|
||||
set @test_var= new.f1;
|
||||
set @test_var= 'before trig 3.5.3.8-2a';
|
||||
select @test_var;
|
||||
@test_var
|
||||
before trig 3.5.3.8-2a
|
||||
|
||||
UPDATE priv added to bypass bug 15166
|
||||
-------------------------------------
|
||||
grant UPDATE on *.* to test_yesprivs@localhost;
|
||||
insert into t1 (f1) values ('insert 3.5.3.8-2a');
|
||||
select @test_var;
|
||||
@test_var
|
||||
@ -497,26 +474,26 @@ drop trigger trg5a_2;
|
||||
Testcase: 3.5.3.8b
|
||||
------------------
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
|
||||
grant SUPER on *.* to test_noprivs@localhost;
|
||||
grant TRIGGER on *.* to test_noprivs@localhost;
|
||||
grant ALL on priv_db.* to test_noprivs@localhost;
|
||||
revoke SELECT on priv_db.* from test_noprivs@localhost;
|
||||
show grants for test_noprivs@localhost;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT INSERT, UPDATE, 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'
|
||||
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER ON `priv_db`.* TO 'test_noprivs'@'localhost'
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
|
||||
grant SUPER on *.* to test_yesprivs@localhost;
|
||||
grant TRIGGER on *.* to test_yesprivs@localhost;
|
||||
grant SELECT on priv_db.* to test_yesprivs@localhost;
|
||||
show grants for test_yesprivs@localhost;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT 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@localhost
|
||||
GRANT SUPER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT INSERT, UPDATE, 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'
|
||||
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER ON `priv_db`.* TO 'test_noprivs'@'localhost'
|
||||
use priv_db;
|
||||
|
||||
Trigger create disabled - should fail - Bug 8887
|
||||
@ -533,7 +510,7 @@ before trig 3.5.3.8-1b
|
||||
drop trigger trg5b_1;
|
||||
show grants;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT ON `priv_db`.* TO 'test_yesprivs'@'localhost'
|
||||
use priv_db;
|
||||
create trigger trg5b_2 before UPDATE on t1 for each row
|
||||
@ -543,10 +520,6 @@ insert into t1 (f1) values ('insert 3.5.3.8-2b');
|
||||
select @test_var;
|
||||
@test_var
|
||||
before trig 3.5.3.8-2b
|
||||
|
||||
UPDATE priv added to bypass bug 15166
|
||||
-------------------------------------
|
||||
grant UPDATE on priv_db.* to test_yesprivs@localhost;
|
||||
update t1 set f1= 'update 3.5.3.8-2b' where f1 = 'insert 3.5.3.8-2b';
|
||||
select @test_var;
|
||||
@test_var
|
||||
@ -556,26 +529,26 @@ drop trigger trg5b_2;
|
||||
Testcase 3.5.3.8c:
|
||||
------------------
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
|
||||
grant SUPER on *.* to test_noprivs@localhost;
|
||||
grant TRIGGER on *.* to test_noprivs@localhost;
|
||||
grant ALL on priv_db.t1 to test_noprivs@localhost;
|
||||
revoke SELECT on priv_db.t1 from test_noprivs@localhost;
|
||||
show grants for test_noprivs@localhost;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
|
||||
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
|
||||
grant SUPER on *.* to test_yesprivs@localhost;
|
||||
grant TRIGGER 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@localhost
|
||||
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER 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);
|
||||
show grants;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
|
||||
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
|
||||
use priv_db;
|
||||
|
||||
Trigger create disabled - should fail - Bug 8887
|
||||
@ -588,16 +561,12 @@ before trig 3.5.3.8-1c
|
||||
drop trigger trg5c_1;
|
||||
show grants;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
|
||||
use priv_db;
|
||||
create trigger trg5c_2 before INSERT on t1 for each row
|
||||
set @test_var= new.f1;
|
||||
set @test_var='before trig 3.5.3.8-2c';
|
||||
|
||||
UPDATE priv added to bypass bug 15166
|
||||
-------------------------------------
|
||||
grant UPDATE on priv_db.t1 to test_yesprivs@localhost;
|
||||
insert into t1 (f1) values ('insert 3.5.3.8-2c');
|
||||
select @test_var;
|
||||
@test_var
|
||||
@ -607,24 +576,24 @@ drop trigger trg5c_2;
|
||||
Testcase: 3.5.3.8d:
|
||||
-------------------
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
|
||||
grant SUPER on *.* to test_noprivs@localhost;
|
||||
grant TRIGGER on *.* to test_noprivs@localhost;
|
||||
grant UPDATE (f1), INSERT (f1) on priv_db.t1 to test_noprivs@localhost;
|
||||
show grants for test_noprivs@localhost;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
|
||||
grant SUPER on *.* to test_yesprivs@localhost;
|
||||
grant TRIGGER on *.* to test_yesprivs@localhost;
|
||||
grant SELECT (f1) on priv_db.t1 to test_yesprivs@localhost;
|
||||
show grants for test_noprivs@localhost;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'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@localhost
|
||||
GRANT SUPER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
|
||||
use priv_db;
|
||||
|
||||
@ -638,16 +607,12 @@ before trig 3.5.3.8-1d
|
||||
drop trigger trg5d_1;
|
||||
show grants;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT (f1) ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
|
||||
use priv_db;
|
||||
create trigger trg5d_2 before INSERT on t1 for each row
|
||||
set @test_var= new.f1;
|
||||
set @test_var='before trig 3.5.3.8-2d';
|
||||
|
||||
UPDATE priv added to bypass bug 15166
|
||||
-------------------------------------
|
||||
grant UPDATE (f1) on priv_db.t1 to test_yesprivs@localhost;
|
||||
insert into t1 (f1) values ('insert 3.5.3.8-2d');
|
||||
select @test_var;
|
||||
@test_var
|
||||
@ -662,12 +627,12 @@ drop table if exists t2;
|
||||
create table t1 (f1 int) engine= myisam;
|
||||
create table t2 (f2 int) engine= myisam;
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
|
||||
grant SUPER on *.* to test_yesprivs@localhost;
|
||||
grant TRIGGER on *.* to test_yesprivs@localhost;
|
||||
grant SELECT, UPDATE on priv_db.t1 to test_yesprivs@localhost;
|
||||
grant SELECT on priv_db.t2 to test_yesprivs@localhost;
|
||||
show grants for test_yesprivs@localhost;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT ON `priv_db`.`t2` TO 'test_yesprivs'@'localhost'
|
||||
GRANT SELECT, UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
|
||||
connect(localhost,test_yesprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
|
||||
@ -683,10 +648,10 @@ ERROR 42000: INSERT command denied to user 'test_yesprivs'@'localhost' for table
|
||||
revoke SELECT on priv_db.t2 from test_yesprivs@localhost;
|
||||
grant INSERT on priv_db.t2 to test_yesprivs@localhost;
|
||||
insert into t1 (f1) values (4);
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
4
|
||||
select f2 from t2;
|
||||
select f2 from t2 order by f2;
|
||||
f2
|
||||
4
|
||||
use priv_db;
|
||||
@ -699,11 +664,11 @@ ERROR 42000: UPDATE command denied to user 'test_yesprivs'@'localhost' for table
|
||||
revoke INSERT on priv_db.t2 from test_yesprivs@localhost;
|
||||
grant UPDATE on priv_db.t2 to test_yesprivs@localhost;
|
||||
insert into t1 (f1) values (2);
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
4
|
||||
2
|
||||
select f2 from t2;
|
||||
4
|
||||
select f2 from t2 order by f2;
|
||||
f2
|
||||
1
|
||||
use priv_db;
|
||||
@ -716,12 +681,12 @@ ERROR 42000: SELECT command denied to user 'test_yesprivs'@'localhost' for table
|
||||
revoke UPDATE on priv_db.t2 from test_yesprivs@localhost;
|
||||
grant SELECT on priv_db.t2 to test_yesprivs@localhost;
|
||||
insert into t1 (f1) values (1);
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
4
|
||||
2
|
||||
1
|
||||
select f2 from t2;
|
||||
2
|
||||
4
|
||||
select f2 from t2 order by f2;
|
||||
f2
|
||||
1
|
||||
select @aaa;
|
||||
@ -737,13 +702,13 @@ ERROR 42000: DELETE command denied to user 'test_yesprivs'@'localhost' for table
|
||||
revoke SELECT on priv_db.t2 from test_yesprivs@localhost;
|
||||
grant DELETE on priv_db.t2 to test_yesprivs@localhost;
|
||||
insert into t1 (f1) values (1);
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
4
|
||||
1
|
||||
1
|
||||
2
|
||||
1
|
||||
1
|
||||
select f2 from t2;
|
||||
4
|
||||
select f2 from t2 order by f2;
|
||||
f2
|
||||
drop database if exists priv_db;
|
||||
drop user test_yesprivs@localhost;
|
||||
|
@ -93,18 +93,18 @@ Create trigger trg1 BEFORE INSERT on t1
|
||||
for each row set new.f1='Trigger 3.5.4.1';
|
||||
Use db_drop;
|
||||
Insert into t1 values ('Insert error 3.5.4.1');
|
||||
Select * from t1;
|
||||
Select * from t1 order by f1;
|
||||
f1
|
||||
Trigger 3.5.4.1
|
||||
drop trigger trg1;
|
||||
select trigger_schema, trigger_name, event_object_table
|
||||
from information_schema.triggers;
|
||||
from information_schema.triggers order by trigger_name;
|
||||
trigger_schema trigger_name event_object_table
|
||||
Insert into t1 values ('Insert no trigger 3.5.4.1');
|
||||
Select * from t1;
|
||||
Select * from t1 order by f1;
|
||||
f1
|
||||
Trigger 3.5.4.1
|
||||
Insert no trigger 3.5.4.1
|
||||
Trigger 3.5.4.1
|
||||
drop trigger trg1;
|
||||
drop database if exists db_drop;
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM 'test_general'@'localhost';
|
||||
@ -258,7 +258,7 @@ use dbtest_one;
|
||||
Insert into dbtest_two.t2 values ('2nd Insert 3.5.5.4');
|
||||
Warnings:
|
||||
Warning 1265 Data truncated for column 'f1' at row 1
|
||||
Select * from dbtest_two.t2;
|
||||
Select * from dbtest_two.t2 order by f1;
|
||||
f1
|
||||
1st Insert 3.5.
|
||||
2nd Insert 3.5.
|
||||
|
@ -139,10 +139,10 @@ values ('1', 'Test 3.5.8.4', 222, 23456, 1.05);
|
||||
Select f120, f122, f136, f144, f163 from tb3 where f122= 'Test 3.5.8.4';
|
||||
f120 f122 f136 f144 f163
|
||||
1 Test 3.5.8.4 00222 0000023456 1.050000000000000000000000000000
|
||||
select * from db_test.t1_i;
|
||||
select * from db_test.t1_i order by i120;
|
||||
i120 i136 i144 i163
|
||||
1 00222 0000023456 1.050000000000000000000000000000
|
||||
select * from db_test.t1_u;
|
||||
select * from db_test.t1_u order by u120;
|
||||
u120 u136 u144 u163
|
||||
a 00111 0000099999 999.990000000000000000000000000000
|
||||
b 00222 0000023456 1.050000000000000000000000000000
|
||||
@ -150,7 +150,7 @@ c 00333 0000099999 999.990000000000000000000000000000
|
||||
d 00222 0000023456 1.050000000000000000000000000000
|
||||
e 00222 0000023456 1.050000000000000000000000000000
|
||||
f 00333 0000099999 999.990000000000000000000000000000
|
||||
select * from db_test.t1_d;
|
||||
select * from db_test.t1_d order by d120;
|
||||
d120 d136 d144 d163
|
||||
a 00111 0000099999 999.990000000000000000000000000000
|
||||
c 00333 0000099999 999.990000000000000000000000000000
|
||||
@ -162,14 +162,22 @@ select @test_var;
|
||||
3.5.8.4 - single SQL - insert
|
||||
-----------------------------
|
||||
Create trigger trg2 BEFORE UPDATE on tb3 for each row
|
||||
BEGIN
|
||||
insert into db_test.t1_i
|
||||
values (new.f120, new.f136, new.f144, new.f163);
|
||||
END//
|
||||
Select f120, f122, f136, f144, f163 from tb3 where f122 like 'Test 3.5.8.4%';
|
||||
f120 f122 f136 f144 f163
|
||||
1 Test 3.5.8.4 00222 0000023456 1.050000000000000000000000000000
|
||||
select * from db_test.t1_i order by i120;
|
||||
i120 i136 i144 i163
|
||||
1 00222 0000023456 1.050000000000000000000000000000
|
||||
update tb3 set f120='I', f122='Test 3.5.8.4-Single Insert'
|
||||
where f122='Test 3.5.8.4';
|
||||
Select f120, f122, f136, f144, f163 from tb3 where f122 like 'Test 3.5.8.4%';
|
||||
f120 f122 f136 f144 f163
|
||||
I Test 3.5.8.4-Single Insert 00222 0000023456 1.050000000000000000000000000000
|
||||
select * from db_test.t1_i;
|
||||
select * from db_test.t1_i order by i120;
|
||||
i120 i136 i144 i163
|
||||
1 00222 0000023456 1.050000000000000000000000000000
|
||||
I 00222 0000023456 1.050000000000000000000000000000
|
||||
@ -186,14 +194,14 @@ update tb3 set f120='U', f122='Test 3.5.8.4-Single Update'
|
||||
Select f120, f122, f136, f144, f163 from tb3 where f122 like 'Test 3.5.8.4%';
|
||||
f120 f122 f136 f144 f163
|
||||
U Test 3.5.8.4-Single Update 00222 0000023456 1.050000000000000000000000000000
|
||||
select * from db_test.t1_u;
|
||||
select * from db_test.t1_u order by u120;
|
||||
u120 u136 u144 u163
|
||||
a 00111 0000099999 999.990000000000000000000000000000
|
||||
U 00222 0000023456 1.050000000000000000000000000000
|
||||
c 00333 0000099999 999.990000000000000000000000000000
|
||||
U 00222 0000023456 1.050000000000000000000000000000
|
||||
U 00222 0000023456 1.050000000000000000000000000000
|
||||
f 00333 0000099999 999.990000000000000000000000000000
|
||||
U 00222 0000023456 1.050000000000000000000000000000
|
||||
U 00222 0000023456 1.050000000000000000000000000000
|
||||
U 00222 0000023456 1.050000000000000000000000000000
|
||||
|
||||
3.5.8.3/4 - single SQL - delete
|
||||
-------------------------------
|
||||
@ -206,7 +214,7 @@ f122='Test 3.5.8.4-Single Delete'
|
||||
Select f120, f122, f136, f144, f163 from tb3 where f122 like 'Test 3.5.8.4%';
|
||||
f120 f122 f136 f144 f163
|
||||
D Test 3.5.8.4-Single Delete 00444 0000023456 1.050000000000000000000000000000
|
||||
select * from db_test.t1_d;
|
||||
select * from db_test.t1_d order by d120;
|
||||
d120 d136 d144 d163
|
||||
a 00111 0000099999 999.990000000000000000000000000000
|
||||
c 00333 0000099999 999.990000000000000000000000000000
|
||||
@ -253,29 +261,29 @@ END//
|
||||
set @test_var='Empty', @test_var2=0;
|
||||
Insert into tb3 (f120, f122, f136) values ('1', 'Test 3.5.8.5-if', 101);
|
||||
select f120, f122, f136, @test_var, @test_var2
|
||||
from tb3 where f122 = 'Test 3.5.8.5-if';
|
||||
from tb3 where f122 = 'Test 3.5.8.5-if' order by f136;
|
||||
f120 f122 f136 @test_var @test_var2
|
||||
D Test 3.5.8.5-if 00101 one 2nd else
|
||||
Insert into tb3 (f120, f122, f136) values ('2', 'Test 3.5.8.5-if', 102);
|
||||
select f120, f122, f136, @test_var, @test_var2
|
||||
from tb3 where f122 = 'Test 3.5.8.5-if';
|
||||
from tb3 where f122 = 'Test 3.5.8.5-if' order by f136;
|
||||
f120 f122 f136 @test_var @test_var2
|
||||
D Test 3.5.8.5-if 00101 two 2nd else
|
||||
D Test 3.5.8.5-if 00102 two 2nd else
|
||||
Insert into tb3 (f120, f122, f136) values ('3', 'Test 3.5.8.5-if', 10);
|
||||
select f120, f122, f136, @test_var, @test_var2
|
||||
from tb3 where f122 = 'Test 3.5.8.5-if';
|
||||
from tb3 where f122 = 'Test 3.5.8.5-if' order by f136;
|
||||
f120 f122 f136 @test_var @test_var2
|
||||
d Test 3.5.8.5-if 00010 three 2nd if
|
||||
D Test 3.5.8.5-if 00101 three 2nd if
|
||||
D Test 3.5.8.5-if 00102 three 2nd if
|
||||
d Test 3.5.8.5-if 00010 three 2nd if
|
||||
Insert into tb3 (f120, f122, f136) values ('3', 'Test 3.5.8.5-if', 103);
|
||||
select f120, f122, f136, @test_var, @test_var2
|
||||
from tb3 where f122 = 'Test 3.5.8.5-if';
|
||||
from tb3 where f122 = 'Test 3.5.8.5-if' order by f136;
|
||||
f120 f122 f136 @test_var @test_var2
|
||||
d Test 3.5.8.5-if 00010 three 2nd else
|
||||
D Test 3.5.8.5-if 00101 three 2nd else
|
||||
D Test 3.5.8.5-if 00102 three 2nd else
|
||||
d Test 3.5.8.5-if 00010 three 2nd else
|
||||
D Test 3.5.8.5-if 00103 three 2nd else
|
||||
create trigger trg3 before update on tb3 for each row
|
||||
BEGIN
|
||||
@ -335,20 +343,20 @@ set @test_var='Empty';
|
||||
Insert into tb3 (f120, f122, f136, f144)
|
||||
values ('a', 'Test 3.5.8.5-case', 5, 7);
|
||||
select f120, f122, f136, f144, @test_var
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case';
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
|
||||
f120 f122 f136 f144 @test_var
|
||||
A Test 3.5.8.5-case 00125 0000000007 A*seven
|
||||
Insert into tb3 (f120, f122, f136, f144)
|
||||
values ('b', 'Test 3.5.8.5-case', 71,16);
|
||||
select f120, f122, f136, f144, @test_var
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case';
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
|
||||
f120 f122 f136 f144 @test_var
|
||||
A Test 3.5.8.5-case 00125 0000000007 B*0000000016
|
||||
B Test 3.5.8.5-case 00191 0000000016 B*0000000016
|
||||
Insert into tb3 (f120, f122, f136, f144)
|
||||
values ('c', 'Test 3.5.8.5-case', 80,1);
|
||||
select f120, f122, f136, f144, @test_var
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case';
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
|
||||
f120 f122 f136 f144 @test_var
|
||||
A Test 3.5.8.5-case 00125 0000000007 C=one
|
||||
B Test 3.5.8.5-case 00191 0000000016 C=one
|
||||
@ -358,34 +366,34 @@ values ('d', 'Test 3.5.8.5-case', 152);
|
||||
Warnings:
|
||||
Warning 1265 Data truncated for column 'f120' at row 1
|
||||
select f120, f122, f136, f144, @test_var
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case';
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
|
||||
f120 f122 f136 f144 @test_var
|
||||
1 Test 3.5.8.5-case 00152 0000099999 1*0000099999
|
||||
A Test 3.5.8.5-case 00125 0000000007 1*0000099999
|
||||
B Test 3.5.8.5-case 00191 0000000016 1*0000099999
|
||||
C Test 3.5.8.5-case 00200 0000000001 1*0000099999
|
||||
1 Test 3.5.8.5-case 00152 0000099999 1*0000099999
|
||||
Insert into tb3 (f120, f122, f136, f144)
|
||||
values ('e', 'Test 3.5.8.5-case', 200, 8);
|
||||
Warnings:
|
||||
Warning 1265 Data truncated for column 'f120' at row 1
|
||||
select f120, f122, f136, f144, @test_var
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case';
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
|
||||
f120 f122 f136 f144 @test_var
|
||||
1 Test 3.5.8.5-case 00152 0000099999 1=eight
|
||||
1 Test 3.5.8.5-case 00200 0000000008 1=eight
|
||||
A Test 3.5.8.5-case 00125 0000000007 1=eight
|
||||
B Test 3.5.8.5-case 00191 0000000016 1=eight
|
||||
C Test 3.5.8.5-case 00200 0000000001 1=eight
|
||||
1 Test 3.5.8.5-case 00152 0000099999 1=eight
|
||||
1 Test 3.5.8.5-case 00200 0000000008 1=eight
|
||||
Insert into tb3 (f120, f122, f136, f144)
|
||||
values ('f', 'Test 3.5.8.5-case', 100, 8);
|
||||
select f120, f122, f136, f144, @test_var
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case';
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
|
||||
f120 f122 f136 f144 @test_var
|
||||
1 Test 3.5.8.5-case 00152 0000099999 1=eight
|
||||
1 Test 3.5.8.5-case 00200 0000000008 1=eight
|
||||
A Test 3.5.8.5-case 00125 0000000007 1=eight
|
||||
B Test 3.5.8.5-case 00191 0000000016 1=eight
|
||||
C Test 3.5.8.5-case 00200 0000000001 1=eight
|
||||
1 Test 3.5.8.5-case 00152 0000099999 1=eight
|
||||
1 Test 3.5.8.5-case 00200 0000000008 1=eight
|
||||
create trigger trg3a before update on tb3 for each row
|
||||
BEGIN
|
||||
CASE
|
||||
|
@ -120,7 +120,7 @@ set @tr_var_af_118=old.f118, @tr_var_af_121=old.f121,
|
||||
Insert into tb3 (f122, f136, f163)
|
||||
values ('Test 3.5.9.3', 7, 123.17);
|
||||
Update tb3 Set f136=8 where f122='Test 3.5.9.3';
|
||||
select f118, f121, f122, f136, f163 from tb3 where f122='Test 3.5.9.3';
|
||||
select f118, f121, f122, f136, f163 from tb3 where f122='Test 3.5.9.3' order by f136;
|
||||
f118 f121 f122 f136 f163
|
||||
a NULL Test 3.5.9.3 00008 123.170000000000000000000000000000
|
||||
select @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122,
|
||||
@ -136,7 +136,7 @@ a NULL Test 3.5.9.3 7 123.170000000000000000000000000000
|
||||
@tr_var_af_118 @tr_var_af_121 @tr_var_af_122 @tr_var_af_136 @tr_var_af_163
|
||||
0 0 0 0 0
|
||||
delete from tb3 where f122='Test 3.5.9.3';
|
||||
select f118, f121, f122, f136, f163 from tb3 where f122='Test 3.5.9.3';
|
||||
select f118, f121, f122, f136, f163 from tb3 where f122='Test 3.5.9.3' order by f136;
|
||||
f118 f121 f122 f136 f163
|
||||
select @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122,
|
||||
@tr_var_b4_136, @tr_var_b4_163;
|
||||
@ -176,7 +176,7 @@ set @tr_var_af_118=new.f118, @tr_var_af_121=new.f121,
|
||||
Insert into tb3 (f122, f136, f151, f163)
|
||||
values ('Test 3.5.9.4', 7, DEFAULT, 995.24);
|
||||
select f118, f121, f122, f136, f151, f163 from tb3
|
||||
where f122 like 'Test 3.5.9.4%';
|
||||
where f122 like 'Test 3.5.9.4%' order by f163;
|
||||
f118 f121 f122 f136 f151 f163
|
||||
a NULL Test 3.5.9.4 00007 999 995.240000000000000000000000000000
|
||||
select @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122,
|
||||
@ -194,9 +194,9 @@ a NULL Test 3.5.9.4 7 999 995.240000000000000000000000000000
|
||||
Update tb3 Set f122='Test 3.5.9.4-trig', f136=NULL, f151=DEFAULT, f163=NULL
|
||||
where f122='Test 3.5.9.4';
|
||||
Warnings:
|
||||
Warning 1263 Column was set to data type implicit default; NULL supplied for NOT NULL column 'f136' at row 11
|
||||
Warning 1048 Column 'f136' cannot be null
|
||||
select f118, f121, f122, f136, f151, f163 from tb3
|
||||
where f122 like 'Test 3.5.9.4-trig';
|
||||
where f122 like 'Test 3.5.9.4-trig' order by f163;
|
||||
f118 f121 f122 f136 f151 f163
|
||||
a NULL Test 3.5.9.4-trig 00000 999 NULL
|
||||
select @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122,
|
||||
|
@ -87,7 +87,7 @@ Insert into vw11 (f122, f151) values ('Test 3.5.10.1/2/3', 1);
|
||||
Insert into vw11 (f122, f151) values ('Test 3.5.10.1/2/3', 2);
|
||||
Insert into vw11 (f122, f151) values ('Not in View', 3);
|
||||
select f121, f122, f151, f163
|
||||
from tb3 where f122 like 'Test 3.5.10.1/2/3%';
|
||||
from tb3 where f122 like 'Test 3.5.10.1/2/3%' order by f151;
|
||||
f121 f122 f151 f163
|
||||
NULL Test 3.5.10.1/2/3 1 111.110000000000000000000000000000
|
||||
NULL Test 3.5.10.1/2/3 2 111.110000000000000000000000000000
|
||||
@ -101,7 +101,7 @@ f121 f122 f151 f163
|
||||
NULL Not in View 3 111.110000000000000000000000000000
|
||||
Update vw11 set f163=1;
|
||||
select f121, f122, f151, f163 from tb3
|
||||
where f122 like 'Test 3.5.10.1/2/3%';
|
||||
where f122 like 'Test 3.5.10.1/2/3%' order by f151;
|
||||
f121 f122 f151 f163
|
||||
Y Test 3.5.10.1/2/3-Update 1 1.000000000000000000000000000000
|
||||
Y Test 3.5.10.1/2/3-Update 2 1.000000000000000000000000000000
|
||||
@ -115,7 +115,7 @@ before delete
|
||||
0
|
||||
delete from vw11 where f151=1;
|
||||
select f121, f122, f151, f163 from tb3
|
||||
where f122 like 'Test 3.5.10.1/2/3%';
|
||||
where f122 like 'Test 3.5.10.1/2/3%' order by f151;
|
||||
f121 f122 f151 f163
|
||||
Y Test 3.5.10.1/2/3-Update 2 1.000000000000000000000000000000
|
||||
select f121, f122, f151, f163 from vw11;
|
||||
@ -146,7 +146,7 @@ load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t9.txt' into table tb_load;
|
||||
select @counter as 'Rows Loaded After';
|
||||
Rows Loaded After
|
||||
10
|
||||
Select * from tb_load limit 10;
|
||||
Select * from tb_load order by f1 limit 10;
|
||||
f1 f2 f3
|
||||
-5000 a` 1000
|
||||
-4999 aaa 999
|
||||
@ -241,7 +241,7 @@ insert into t3 (f1) values (new.f1+1000);
|
||||
create trigger tr2_4 after insert on t2_4 for each row
|
||||
insert into t3 (f1) values (new.f1+10000);
|
||||
insert into t1 values (1);
|
||||
select * from t3;
|
||||
select * from t3 order by f1;
|
||||
f1
|
||||
12
|
||||
102
|
||||
@ -276,17 +276,17 @@ create trigger tr4 after insert on t4
|
||||
for each row insert into t1 (f1) values (new.f4+1);
|
||||
insert into t1 values (1);
|
||||
ERROR HY000: Can't update table 't1' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
|
||||
select * from t1;
|
||||
select * from t1 order by f1;
|
||||
f1
|
||||
0
|
||||
1
|
||||
select * from t2;
|
||||
select * from t2 order by f2;
|
||||
f2
|
||||
2
|
||||
select * from t3;
|
||||
select * from t3 order by f3;
|
||||
f3
|
||||
3
|
||||
select * from t4;
|
||||
select * from t4 order by f4;
|
||||
f4
|
||||
4
|
||||
drop trigger tr1;
|
||||
@ -373,7 +373,7 @@ create table t4 (f4 tinyint) engine = myisam;
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`f1` int(11) default NULL
|
||||
`f1` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
insert into t1 values (1);
|
||||
create trigger tr1 after insert on t1
|
||||
@ -385,16 +385,16 @@ for each row insert into t4 (f4) values (new.f3+1000);
|
||||
set autocommit=0;
|
||||
start transaction;
|
||||
insert into t1 values (1);
|
||||
ERROR 22003: Out of range value adjusted for column 'f4' at row 1
|
||||
ERROR 22003: Out of range value for column 'f4' at row 1
|
||||
commit;
|
||||
select * from t1;
|
||||
select * from t1 order by f1;
|
||||
f1
|
||||
1
|
||||
1
|
||||
select * from t2;
|
||||
select * from t2 order by f2;
|
||||
f2
|
||||
2
|
||||
select * from t3;
|
||||
select * from t3 order by f3;
|
||||
f3
|
||||
3
|
||||
drop trigger tr1;
|
||||
|
@ -470,7 +470,8 @@ SET @x=0;
|
||||
CREATE or REPLACE VIEW v1 AS Select 1 INTO @x;
|
||||
ERROR HY000: View's SELECT contains a 'INTO' clause
|
||||
Select @x;
|
||||
ERROR HY000: View's SELECT contains a variable or parameter
|
||||
@x
|
||||
0
|
||||
CREATE or REPLACE VIEW v1 AS Select 1
|
||||
FROM (SELECT 1 FROM t1) my_table;
|
||||
ERROR HY000: View's SELECT contains a subquery in the FROM clause
|
||||
@ -607,7 +608,9 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
|
||||
CREATE or REPLACE view v1 as Select f59, f60
|
||||
from tb2 by group f59 ;
|
||||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'by group f59' at line 2
|
||||
ERROR HY000: View's SELECT contains a variable or parameter
|
||||
|
||||
Testcase 3.3.1.5
|
||||
--------------------------------------------------------------------------------
|
||||
DROP VIEW IF EXISTS v1 ;
|
||||
CREATE VIEW v1 SELECT * FROM tb2 limit 100 ;
|
||||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT * FROM tb2 limit 100' at line 1
|
||||
@ -627,7 +630,9 @@ CREATE VIEW v1 SELECT 1;
|
||||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT 1' at line 1
|
||||
CREATE VIEW v1 AS ;
|
||||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
|
||||
ERROR HY000: View's SELECT contains a variable or parameter
|
||||
|
||||
Testcase 3.3.1.6
|
||||
--------------------------------------------------------------------------------
|
||||
DROP VIEW IF EXISTS v1 ;
|
||||
CREATE or REPLACE VIEW v1
|
||||
as SELECT * from tb2 limit 100 ;
|
||||
@ -1812,7 +1817,9 @@ ERROR HY000: View's SELECT contains a subquery in the FROM clause
|
||||
SELECT * FROM test.v1 ;
|
||||
ERROR 42S02: Table 'test.v1' doesn't exist
|
||||
Drop view if exists test.v1 ;
|
||||
ERROR HY000: View's SELECT contains a variable or parameter
|
||||
|
||||
Testcase 3.3.1.40
|
||||
--------------------------------------------------------------------------------
|
||||
Drop view if exists test.v1 ;
|
||||
Set @var1 = 'ABC' ;
|
||||
Set @var2 = 'XYZ' ;
|
||||
@ -1821,7 +1828,9 @@ ERROR HY000: View's SELECT contains a variable or parameter
|
||||
CREATE VIEW test.v1 AS SELECT @@global.sort_buffer_size;
|
||||
ERROR HY000: View's SELECT contains a variable or parameter
|
||||
Drop view if exists test.v1 ;
|
||||
ERROR HY000: View's SELECT contains a variable or parameter
|
||||
|
||||
Testcase 3.3.1.41
|
||||
--------------------------------------------------------------------------------
|
||||
Drop view if exists test.v1 ;
|
||||
Drop procedure if exists sp1 ;
|
||||
Create procedure sp1() DETERMINISTIC
|
||||
@ -1838,7 +1847,9 @@ Warnings:
|
||||
Note 1051 Unknown table 'test.v1'
|
||||
Drop procedure sp1 ;
|
||||
ERROR 42000: PROCEDURE test.sp1 does not exist
|
||||
ERROR HY000: View's SELECT contains a variable or parameter
|
||||
|
||||
Testcase 3.3.1.42
|
||||
--------------------------------------------------------------------------------
|
||||
Drop VIEW if exists test.v1 ;
|
||||
CREATE TEMPORARY VIEW test.v1 AS
|
||||
SELECT * FROM test.tb2 limit 2 ;
|
||||
@ -1850,7 +1861,9 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
|
||||
SELECT * FROM test.tb2 limit 2' at line 1
|
||||
Drop view if exists test.v1 ;
|
||||
Use test;
|
||||
ERROR HY000: View's SELECT contains a variable or parameter
|
||||
|
||||
Testcase 3.3.1.43
|
||||
--------------------------------------------------------------------------------
|
||||
Drop view if exists test.v1 ;
|
||||
CREATE VIEW test.v1 AS SELECT f59,f60 FROM test.tb2;
|
||||
INSERT INTO test.v1 values(122,432);
|
||||
@ -1935,7 +1948,7 @@ f1 f2
|
||||
2 two
|
||||
4 four
|
||||
INSERT INTO v1 VALUES(2,'two');
|
||||
ERROR 23000: Duplicate entry '2' for key 1
|
||||
ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
|
||||
INSERT INTO v1 VALUES(3,'three');
|
||||
affected rows: 1
|
||||
INSERT INTO v1 VALUES(6,'six');
|
||||
@ -1954,7 +1967,7 @@ f1 f2
|
||||
3 three
|
||||
4 four
|
||||
UPDATE v1 SET f1 = 2 WHERE f1 = 3;
|
||||
ERROR 23000: Duplicate entry '2' for key 1
|
||||
ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
|
||||
UPDATE v1 SET f2 = 'number' WHERE f1 = 3;
|
||||
affected rows: 1
|
||||
info: Rows matched: 1 Changed: 1 Warnings: 0
|
||||
@ -2001,12 +2014,12 @@ DROP VIEW IF EXISTS test.v1;
|
||||
CREATE TABLE t1 (f1 ENUM('A', 'B', 'C') NOT NULL, f2 INTEGER)
|
||||
ENGINE = myisam;
|
||||
INSERT INTO t1 VALUES ('A', 1);
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 order by f1, f2;
|
||||
f1 f2
|
||||
A 1
|
||||
CREATE VIEW v1 AS SELECT * FROM t1 WHERE f2 BETWEEN 1 AND 2
|
||||
WITH CASCADED CHECK OPTION ;
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by f1, f2;
|
||||
f1 f2
|
||||
A 1
|
||||
UPDATE v1 SET f2 = 2 WHERE f2 = 1;
|
||||
@ -2014,7 +2027,7 @@ affected rows: 1
|
||||
info: Rows matched: 1 Changed: 1 Warnings: 0
|
||||
INSERT INTO v1 VALUES('B',2);
|
||||
affected rows: 1
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by f1, f2;
|
||||
f1 f2
|
||||
A 2
|
||||
B 2
|
||||
@ -2022,7 +2035,7 @@ UPDATE v1 SET f2 = 4;
|
||||
ERROR HY000: CHECK OPTION failed 'test.v1'
|
||||
INSERT INTO v1 VALUES('B',3);
|
||||
ERROR HY000: CHECK OPTION failed 'test.v1'
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by f1, f2;
|
||||
f1 f2
|
||||
A 2
|
||||
B 2
|
||||
@ -10562,7 +10575,7 @@ f1 f2 f3 f4
|
||||
DELETE FROM t1;
|
||||
INSERT INTO v1 SET f2 = 'ABC';
|
||||
INSERT INTO v1 SET f2 = 'ABC';
|
||||
ERROR 23000: Duplicate entry '0' for key 1
|
||||
ERROR 23000: Duplicate entry '0' for key 'PRIMARY'
|
||||
SELECT * from t1;
|
||||
f1 f2 f3 f4
|
||||
0 ABC NULL NULL
|
||||
@ -10631,7 +10644,7 @@ DROP VIEW v1;
|
||||
CREATE VIEW v1 AS SELECT f2, f3 FROM t1;
|
||||
INSERT INTO v1 SET f2 = 'ABC';
|
||||
INSERT INTO v1 SET f2 = 'ABC';
|
||||
ERROR 23000: Duplicate entry '0' for key 1
|
||||
ERROR 23000: Duplicate entry '0' for key 'PRIMARY'
|
||||
SELECT * from t1;
|
||||
f1 f2 f3 f4
|
||||
0 ABC NULL NULL
|
||||
@ -10966,11 +10979,11 @@ f1 bigint(20) YES NULL
|
||||
f2 date YES NULL
|
||||
f4 char(5) YES NULL
|
||||
report char(10) YES NULL
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 order by f1, report;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by f1, report;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
@ -10990,12 +11003,12 @@ f4x char(5) YES NULL
|
||||
report char(10) YES NULL
|
||||
DESCRIBE v1;
|
||||
ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 order by f1, report;
|
||||
f1 f2 f4x report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
0 NULL ABC t1 1
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by f1, report;
|
||||
ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
|
||||
ALTER TABLE t1 CHANGE COLUMN f4x f4 CHAR(5);
|
||||
ALTER TABLE t1 CHANGE COLUMN f4 f4 CHAR(10);
|
||||
@ -11013,14 +11026,14 @@ f1 bigint(20) YES NULL
|
||||
f2 date YES NULL
|
||||
f4 char(10) YES NULL
|
||||
report char(10) YES NULL
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 order by f1, report;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
0 NULL ABC t1 1
|
||||
2 NULL <-- 10 --> t1 2
|
||||
2 NULL <-- 10 --> v1 2
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by f1, report;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
@ -11049,7 +11062,7 @@ f1 bigint(20) YES NULL
|
||||
f2 date YES NULL
|
||||
f4 char(8) YES NULL
|
||||
report char(10) YES NULL
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 order by f1, report;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
@ -11058,7 +11071,7 @@ f1 f2 f4 report
|
||||
2 NULL <-- 10 - v1 2
|
||||
3 NULL <-- 10 - t1 3
|
||||
3 NULL <-- 10 - v1 3
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by f1, report;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
@ -11082,7 +11095,7 @@ f1 bigint(20) YES NULL
|
||||
f2 date YES NULL
|
||||
f4 varchar(20) YES NULL
|
||||
report char(10) YES NULL
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 order by f1, report;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
@ -11093,7 +11106,7 @@ f1 f2 f4 report
|
||||
3 NULL <-- 10 - v1 3
|
||||
4 NULL <------ 20 --------> t1 4
|
||||
4 NULL <------ 20 --------> v1 4
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by f1, report;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
@ -11121,7 +11134,7 @@ f1 varchar(30) YES NULL
|
||||
f2 date YES NULL
|
||||
f4 varchar(20) YES NULL
|
||||
report char(10) YES NULL
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 order by f1, report;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
@ -11134,7 +11147,7 @@ f1 f2 f4 report
|
||||
4 NULL <------ 20 --------> v1 4
|
||||
<------------- 30 -----------> NULL <------ 20 --------> t1 5
|
||||
<------------- 30 -----------> NULL <------ 20 --------> v1 5
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by f1, report;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
@ -11158,7 +11171,7 @@ f4 varchar(20) YES NULL
|
||||
report char(10) YES NULL
|
||||
DESCRIBE v1;
|
||||
ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 order by f1, report;
|
||||
f1 f4 report
|
||||
-1 ABC t1 0
|
||||
-1 ABC v1 0
|
||||
@ -11172,7 +11185,7 @@ f1 f4 report
|
||||
<------------- 30 -----------> <------ 20 --------> t1 5
|
||||
<------------- 30 -----------> <------ 20 --------> v1 5
|
||||
ABC <------ 20 --------> t1 6
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by f1, report;
|
||||
ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
|
||||
ALTER TABLE t1 ADD COLUMN f2 DATE DEFAULT NULL;
|
||||
INSERT INTO t1 SET f1 = 'ABC', f2 = '1500-12-04',
|
||||
@ -11191,7 +11204,7 @@ f1 varchar(30) YES NULL
|
||||
f2 date YES NULL
|
||||
f4 varchar(20) YES NULL
|
||||
report char(10) YES NULL
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 order by f1, report;
|
||||
f1 f4 report f2
|
||||
-1 ABC t1 0 NULL
|
||||
-1 ABC v1 0 NULL
|
||||
@ -11207,7 +11220,7 @@ f1 f4 report f2
|
||||
ABC <------ 20 --------> t1 6 NULL
|
||||
ABC <------ 20 --------> t1 7 1500-12-04
|
||||
ABC <------ 20 --------> v1 7 1500-12-04
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by f1, report;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
@ -11241,7 +11254,7 @@ f1 varchar(30) YES NULL
|
||||
f2 float YES NULL
|
||||
f4 varchar(20) YES NULL
|
||||
report char(10) YES NULL
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 order by f1, report;
|
||||
f1 f4 report f2
|
||||
-1 ABC t1 0 NULL
|
||||
-1 ABC v1 0 NULL
|
||||
@ -11256,10 +11269,10 @@ f1 f4 report f2
|
||||
<------------- 30 -----------> <------ 20 --------> v1 5 NULL
|
||||
ABC <------ 20 --------> t1 6 NULL
|
||||
ABC <------ 20 --------> t1 7 NULL
|
||||
ABC <------ 20 --------> v1 7 NULL
|
||||
ABC <------ 20 --------> t1 8 -0.00033
|
||||
ABC <------ 20 --------> v1 7 NULL
|
||||
ABC <------ 20 --------> v1 8 -0.00033
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by f1, report;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
@ -11274,8 +11287,8 @@ f1 f2 f4 report
|
||||
<------------- 30 -----------> NULL <------ 20 --------> v1 5
|
||||
ABC NULL <------ 20 --------> t1 6
|
||||
ABC NULL <------ 20 --------> t1 7
|
||||
ABC NULL <------ 20 --------> v1 7
|
||||
ABC -0.00033 <------ 20 --------> t1 8
|
||||
ABC NULL <------ 20 --------> v1 7
|
||||
ABC -0.00033 <------ 20 --------> v1 8
|
||||
ALTER TABLE t1 ADD COLUMN f3 NUMERIC(7,2);
|
||||
INSERT INTO t1 SET f1 = 'ABC', f2 = -3.3E-4,
|
||||
@ -11298,7 +11311,7 @@ f1 varchar(30) YES NULL
|
||||
f2 float YES NULL
|
||||
f4 varchar(20) YES NULL
|
||||
report char(10) YES NULL
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 order by f1, report;
|
||||
f1 f4 report f2 f3
|
||||
-1 ABC t1 0 NULL NULL
|
||||
-1 ABC v1 0 NULL NULL
|
||||
@ -11313,12 +11326,12 @@ f1 f4 report f2 f3
|
||||
<------------- 30 -----------> <------ 20 --------> v1 5 NULL NULL
|
||||
ABC <------ 20 --------> t1 6 NULL NULL
|
||||
ABC <------ 20 --------> t1 7 NULL NULL
|
||||
ABC <------ 20 --------> v1 7 NULL NULL
|
||||
ABC <------ 20 --------> t1 8 -0.00033 NULL
|
||||
ABC <------ 20 --------> v1 8 -0.00033 NULL
|
||||
ABC <------ 20 --------> t1 9 -0.00033 -2.20
|
||||
ABC <------ 20 --------> v1 7 NULL NULL
|
||||
ABC <------ 20 --------> v1 8 -0.00033 NULL
|
||||
ABC <------ 20 --------> v1 9a -0.00033 NULL
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by f1, report;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
@ -11333,10 +11346,10 @@ f1 f2 f4 report
|
||||
<------------- 30 -----------> NULL <------ 20 --------> v1 5
|
||||
ABC NULL <------ 20 --------> t1 6
|
||||
ABC NULL <------ 20 --------> t1 7
|
||||
ABC NULL <------ 20 --------> v1 7
|
||||
ABC -0.00033 <------ 20 --------> t1 8
|
||||
ABC -0.00033 <------ 20 --------> v1 8
|
||||
ABC -0.00033 <------ 20 --------> t1 9
|
||||
ABC NULL <------ 20 --------> v1 7
|
||||
ABC -0.00033 <------ 20 --------> v1 8
|
||||
ABC -0.00033 <------ 20 --------> v1 9a
|
||||
DROP TABLE t1;
|
||||
DROP VIEW v1;
|
||||
@ -11351,10 +11364,10 @@ DESCRIBE v1;
|
||||
Field Type Null Key Default Extra
|
||||
f1 char(10) YES NULL
|
||||
my_sqrt double YES NULL
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 order by f1, f2;
|
||||
f1 f2
|
||||
ABC 3
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by 2;
|
||||
f1 my_sqrt
|
||||
ABC 1.7320508075689
|
||||
ALTER TABLE t1 CHANGE COLUMN f2 f2 VARCHAR(30);
|
||||
@ -11367,21 +11380,21 @@ DESCRIBE v1;
|
||||
Field Type Null Key Default Extra
|
||||
f1 char(10) YES NULL
|
||||
my_sqrt double YES NULL
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 order by f1, f2;
|
||||
f1 f2
|
||||
ABC 3
|
||||
ABC DEF
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by 2;
|
||||
f1 my_sqrt
|
||||
ABC 1.7320508075689
|
||||
ABC 0
|
||||
ABC 1.7320508075689
|
||||
SELECT SQRT('DEF');
|
||||
SQRT('DEF')
|
||||
0
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect DOUBLE value: 'DEF'
|
||||
CREATE VIEW v2 AS SELECT SQRT('DEF');
|
||||
SELECT * FROM v2;
|
||||
SELECT * FROM v2 order by 1;
|
||||
SQRT('DEF')
|
||||
0
|
||||
Warnings:
|
||||
@ -11391,27 +11404,27 @@ DESCRIBE v2;
|
||||
Field Type Null Key Default Extra
|
||||
f1 char(10) YES NULL
|
||||
my_sqrt double YES NULL
|
||||
SELECT * FROM v2;
|
||||
SELECT * FROM v2 order by 2;
|
||||
f1 my_sqrt
|
||||
ABC 0
|
||||
ABC 1.7320508075689
|
||||
ABC 0
|
||||
CREATE TABLE t2 AS SELECT f1, SQRT(f2) my_sqrt FROM t1;
|
||||
SELECT * FROM t2;
|
||||
SELECT * FROM t2 order by 2;
|
||||
f1 my_sqrt
|
||||
ABC 1.73205080756888
|
||||
ABC 0
|
||||
ABC 1.73205080756888
|
||||
DROP TABLE t2;
|
||||
CREATE TABLE t2 AS SELECT * FROM v1;
|
||||
SELECT * FROM t2;
|
||||
SELECT * FROM t2 order by 2;
|
||||
f1 my_sqrt
|
||||
ABC 1.73205080756888
|
||||
ABC 0
|
||||
ABC 1.73205080756888
|
||||
DROP TABLE t2;
|
||||
CREATE TABLE t2 AS SELECT * FROM v2;
|
||||
SELECT * FROM t2;
|
||||
SELECT * FROM t2 order by 2;
|
||||
f1 my_sqrt
|
||||
ABC 1.73205080756888
|
||||
ABC 0
|
||||
ABC 1.73205080756888
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
||||
DROP VIEW v1;
|
||||
|
Reference in New Issue
Block a user