1
0
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:

The files below "mysql-test/suite/funcs_1" in version 5.1
did not depend on the equivalent ones in 5.0,
probably because they had been checked in independent of each other
in both versions.

Step 1:
Foreach file F in the suite that has a "deleted" counterpart D, use
    bk rm $F
    bk mv $D $F
to get those files into the 5.1 suite that (for BK) depend on 5.0.
This commit is contained in:
joerg@debian.(none)
2007-07-27 13:32:32 +02:00
parent 8b5f22a0c3
commit c80ced4111
84 changed files with 6990 additions and 12418 deletions

View File

@ -1,3 +1,4 @@
#### suite/funcs_1/cursors/cursors_master.test
let $message= NOT YET IMPLEMENTED: cursor tests;
--source include/show_msg80.inc

View File

@ -3881,11 +3881,11 @@ let $message= Testcase 3.2.20.1:;
let $is_table= referential_constraints;
# when table is implemented remove this and the next 4 lines and "enable" 5th line:
# and don't forget to add the test description to QATestPlanV50func
#let $message= checking a table that will be implemented later;
#--source include/show_msg.inc
#--error 1109
let $message= checking a table that will be implemented later;
--source include/show_msg.inc
--error 1109
eval DESC $is_table;
--source suite/funcs_1/datadict/datadict_show_table_design.inc
#--source suite/funcs_1/datadict/datadict_show_table_design.inc
# -------------------------------------------------------------------------------------------------------

View File

@ -58,5 +58,5 @@ eval $dd_part1 triggers $dd_part2;
--error 1109
eval $dd_part1 parameters $dd_part2;
--error 0,1109
--error 1109
eval $dd_part1 referential_constraints $dd_part2;

View File

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

36
mysql-test/suite/funcs_1/r/innodb_storedproc_02.result Normal file → Executable file
View File

@ -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 where f1='a`' and f2='a`' limit 1;
SELECT f1, f2 into @x, @y from t2 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 where f4=-5000 and f3='1000-01-01' limit 1;
SELECT f4, f3 into @x, @y from t2 limit 1;
SELECT @x, @y;
END//
CALL sp1();
@ -544,9 +544,6 @@ 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 ()
@ -1087,8 +1084,7 @@ 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
where f4 >=-5000 order by f4 limit 3;
declare cur1 cursor for SELECT f1, f2, f4, f5, f6 from t2 limit 3;
open cur1;
while proceed do
SELECT count AS 'loop';
@ -1171,7 +1167,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 order by f4;
SELECT f1, f2, f4, f5 from t2;
f1 f2 f4 f5
a` a` -5000 a`
aaa aaa -4999 aaa
@ -1191,21 +1187,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 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;
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;
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;
@ -1274,10 +1270,8 @@ 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
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 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 continue handler for sqlstate '02000' set proceed=0;
open cur1;
open cur2;
@ -1308,10 +1302,8 @@ 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
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 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 CONTINUE HANDLER FOR SQLSTATE '02000' SET proceed=0;
OPEN cur1;
OPEN cur2;

0
mysql-test/suite/funcs_1/r/innodb_storedproc_03.result Normal file → Executable file
View File

0
mysql-test/suite/funcs_1/r/innodb_storedproc_07.result Normal file → Executable file
View File

0
mysql-test/suite/funcs_1/r/innodb_storedproc_08.result Normal file → Executable file
View File

10
mysql-test/suite/funcs_1/r/innodb_storedproc_10.result Normal file → Executable file
View File

@ -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 WHERE f4=-5000 LIMIT 1;
SELECT * FROM db_storedproc.t1 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 ORDER BY f4;
SELECT * FROM temp;
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 ORDER BY f4;
SELECT * FROM temp;
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 ORDER BY f4;
SELECT * FROM temp;
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 ORDER BY f4;
SELECT * FROM temp;
f1 f2 f3 f4 f5 f6
a` a` 1000-01-01 -5000 a` -5000
aaa aaa 1000-01-02 -4999 aaa -4999

View File

@ -199,9 +199,6 @@ 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
@ -210,14 +207,12 @@ 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 order by trigger_name;
select trigger_name from information_schema.triggers;
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:
@ -319,7 +314,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 order by f2;
select * from t1;
f1 f2
trig1 1
trig1 2
@ -329,7 +324,7 @@ trig2 3
select * from trig_db3.t1;
f1 f2
trig3 4
select * from t1 order by f2;
select * from t1;
f1 f2
trig1 1
trig1 2
@ -354,10 +349,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 order by trigger_name;
from information_schema.triggers;
trigger_schema trigger_name event_object_table
trig_db1 trig1_a t1
trig_db1 trig1_b t1
trig_db1 trig1_a 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);

View File

@ -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 TRIGGER on *.* from test_noprivs@localhost;
revoke SUPER 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, 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'
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'
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant SUPER on *.* to test_yesprivs@localhost;
grant SELECT on priv_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
connect(localhost,test_noprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
connect(localhost,test_yesprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
@ -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';
Got one of the listed errors
ERROR 42000: Access denied; you need the SUPER privilege for this operation
use priv_db;
insert into t1 (f1) values ('insert 3.5.3.2-no');
select f1 from t1 order by f1;
select f1 from t1;
f1
insert 3.5.3.2-no
select current_user;
@ -122,12 +122,15 @@ 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 order by f1;
select f1 from t1;
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 order by f1;
select f1 from t1;
f1
insert 3.5.3.2-no
trig 3.5.3.2_2-yes
@ -136,10 +139,10 @@ Testcase 3.5.3.6:
-----------------
use priv_db;
drop trigger trg1_2;
Got one of the listed errors
ERROR 42000: Access denied; you need the SUPER privilege for this operation
use priv_db;
insert into t1 (f1) values ('insert 3.5.3.6-yes');
select f1 from t1 order by f1;
select f1 from t1;
f1
insert 3.5.3.2-no
trig 3.5.3.2_2-yes
@ -148,12 +151,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 order by f1;
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
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
drop trigger trg1_2;
Testcase 3.5.3.7a:
@ -163,12 +166,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, EVENT, TRIGGER 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 ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER, UPDATE on *.* to test_yesprivs@localhost;
grant SUPER, UPDATE on *.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT UPDATE, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT UPDATE, SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
connect(localhost,test_noprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
connect(localhost,test_yesprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
select current_user;
@ -177,24 +180,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, EVENT, TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
select f1 from t1 order by f1;
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;
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 order by f1;
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.2_2-yes
trig 3.5.3.2_2-yes
drop trigger trg4a_1;
use priv_db;
select current_user;
@ -202,220 +205,236 @@ current_user
test_yesprivs@localhost
show grants;
Grants for test_yesprivs@localhost
GRANT UPDATE, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT UPDATE, SUPER 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 order by f1;
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.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 TRIGGER on *.* to test_noprivs;
grant SUPER on *.* to test_noprivs;
grant ALL on priv_db.* to test_noprivs@localhost;
revoke UPDATE on priv_db.* from test_noprivs@localhost;
show grants for test_noprivs;
Grants for test_noprivs@%
GRANT TRIGGER ON *.* TO 'test_noprivs'@'%'
GRANT SUPER ON *.* TO 'test_noprivs'@'%'
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant SUPER on *.* to test_yesprivs@localhost;
grant UPDATE on priv_db.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT UPDATE ON `priv_db`.* TO 'test_yesprivs'@'localhost'
connect(localhost,test_noprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
connect(localhost,test_yesprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
show grants;
Grants for test_noprivs@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, EVENT, TRIGGER 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 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 order by f1;
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
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
insert 3.5.3.7-1b
update t1 set f1 = 'update 3.5.3.7-1b' where f1 = 'insert 3.5.3.7-1b';
select f1 from t1 order by f1;
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.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 TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT UPDATE ON `priv_db`.* TO 'test_yesprivs'@'localhost'
use priv_db;
create trigger trg4b_2 before UPDATE on t1 for each 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 order by f1;
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
insert 3.5.3.7-2b
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
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;
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.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
trig 3.5.3.7-2b
drop trigger trg4b_2;
Testcase 3.5.3.7c
-----------------
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
grant TRIGGER on *.* to test_noprivs@localhost;
grant SUPER on *.* to test_noprivs@localhost;
grant ALL on priv_db.t1 to test_noprivs@localhost;
revoke UPDATE on priv_db.t1 from test_noprivs@localhost;
show grants for test_noprivs;
Grants for test_noprivs@%
GRANT TRIGGER ON *.* TO 'test_noprivs'@'%'
GRANT SUPER ON *.* TO 'test_noprivs'@'%'
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant SUPER on *.* to test_yesprivs@localhost;
grant UPDATE on priv_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
connect(localhost,test_noprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
connect(localhost,test_yesprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
show grants;
Grants for test_noprivs@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'
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'
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 order by f1;
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
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
trig 3.5.3.7-2b
insert 3.5.3.7-1c
drop trigger trg4c_1;
show grants;
Grants for test_yesprivs@localhost
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
use priv_db;
create trigger trg4c_2 before INSERT on t1 for each 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 order by f1;
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
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
trig 3.5.3.7-2b
insert 3.5.3.7-1c
trig 3.5.3.7-2c
drop trigger trg4c_2;
Testcase 3.5.3.7d:
------------------
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
grant TRIGGER on *.* to test_noprivs@localhost;
grant SUPER on *.* to test_noprivs@localhost;
grant SELECT (f1), INSERT (f1) on priv_db.t1 to test_noprivs@localhost;
show grants for test_noprivs;
Grants for test_noprivs@%
GRANT TRIGGER ON *.* TO 'test_noprivs'@'%'
GRANT SUPER ON *.* TO 'test_noprivs'@'%'
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant SUPER 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 TRIGGER ON *.* TO 'test_noprivs'@'%'
GRANT SUPER 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 TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SUPER 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 order by f1;
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
insert 3.5.3.7-1c
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
trig 3.5.3.7-2b
insert 3.5.3.7-1c
trig 3.5.3.7-2c
insert 3.5.3.7-1d
drop trigger trg4d_1;
show grants;
Grants for test_yesprivs@localhost
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SUPER 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 order by f1;
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
insert 3.5.3.7-1c
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
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.7-2d
drop trigger trg4d_2;
Testcase 3.5.3.8a:
@ -425,12 +444,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, EVENT, TRIGGER 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 ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER, SELECT on *.* to test_yesprivs@localhost;
grant SUPER, SELECT on *.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT SELECT, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT, SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
connect(localhost,test_noprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
connect(localhost,test_yesprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
select current_user;
@ -439,7 +458,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, EVENT, TRIGGER 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 ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
Trigger create disabled - should fail - Bug 8887
------------------------------------------------
@ -458,13 +477,17 @@ current_user
test_yesprivs@localhost
show grants;
Grants for test_yesprivs@localhost
GRANT SELECT, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT, SUPER 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
@ -474,26 +497,26 @@ drop trigger trg5a_2;
Testcase: 3.5.3.8b
------------------
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
grant TRIGGER on *.* to test_noprivs@localhost;
grant SUPER 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 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'
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'
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant SUPER 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 TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SUPER 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 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'
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'
use priv_db;
Trigger create disabled - should fail - Bug 8887
@ -510,7 +533,7 @@ before trig 3.5.3.8-1b
drop trigger trg5b_1;
show grants;
Grants for test_yesprivs@localhost
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SUPER 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
@ -520,6 +543,10 @@ 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
@ -529,26 +556,26 @@ drop trigger trg5b_2;
Testcase 3.5.3.8c:
------------------
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
grant TRIGGER on *.* to test_noprivs@localhost;
grant SUPER 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 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'
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'
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant SUPER on *.* to test_yesprivs@localhost;
grant SELECT on priv_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
connect(localhost,test_noprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
connect(localhost,test_yesprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
show grants;
Grants for 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'
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'
use priv_db;
Trigger create disabled - should fail - Bug 8887
@ -561,12 +588,16 @@ before trig 3.5.3.8-1c
drop trigger trg5c_1;
show grants;
Grants for test_yesprivs@localhost
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SUPER 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
@ -576,24 +607,24 @@ drop trigger trg5c_2;
Testcase: 3.5.3.8d:
-------------------
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
grant TRIGGER on *.* to test_noprivs@localhost;
grant SUPER 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 TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SUPER 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 TRIGGER on *.* to test_yesprivs@localhost;
grant SUPER 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 TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SUPER 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 TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SUPER 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;
@ -607,12 +638,16 @@ before trig 3.5.3.8-1d
drop trigger trg5d_1;
show grants;
Grants for test_yesprivs@localhost
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SUPER 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
@ -627,12 +662,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 TRIGGER on *.* to test_yesprivs@localhost;
grant SUPER 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 TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SUPER 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);
@ -648,10 +683,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 order by f1;
select f1 from t1;
f1
4
select f2 from t2 order by f2;
select f2 from t2;
f2
4
use priv_db;
@ -664,11 +699,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 order by f1;
select f1 from t1;
f1
2
4
select f2 from t2 order by f2;
2
select f2 from t2;
f2
1
use priv_db;
@ -681,12 +716,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 order by f1;
select f1 from t1;
f1
1
2
4
select f2 from t2 order by f2;
2
1
select f2 from t2;
f2
1
select @aaa;
@ -702,13 +737,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 order by f1;
select f1 from t1;
f1
1
1
2
4
select f2 from t2 order by f2;
2
1
1
select f2 from t2;
f2
drop database if exists priv_db;
drop user test_yesprivs@localhost;

View File

@ -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 order by f1;
Select * from t1;
f1
Trigger 3.5.4.1
drop trigger trg1;
select trigger_schema, trigger_name, event_object_table
from information_schema.triggers order by trigger_name;
from information_schema.triggers;
trigger_schema trigger_name event_object_table
Insert into t1 values ('Insert no trigger 3.5.4.1');
Select * from t1 order by f1;
Select * from t1;
f1
Insert no trigger 3.5.4.1
Trigger 3.5.4.1
Insert no 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 order by f1;
Select * from dbtest_two.t2;
f1
1st Insert 3.5.
2nd Insert 3.5.

View File

@ -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 order by i120;
select * from db_test.t1_i;
i120 i136 i144 i163
1 00222 0000023456 1.050000000000000000000000000000
select * from db_test.t1_u order by u120;
select * from db_test.t1_u;
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 order by d120;
select * from db_test.t1_d;
d120 d136 d144 d163
a 00111 0000099999 999.990000000000000000000000000000
c 00333 0000099999 999.990000000000000000000000000000
@ -162,22 +162,14 @@ 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 order by i120;
select * from db_test.t1_i;
i120 i136 i144 i163
1 00222 0000023456 1.050000000000000000000000000000
I 00222 0000023456 1.050000000000000000000000000000
@ -194,14 +186,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 order by u120;
select * from db_test.t1_u;
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
-------------------------------
@ -214,7 +206,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 order by d120;
select * from db_test.t1_d;
d120 d136 d144 d163
a 00111 0000099999 999.990000000000000000000000000000
c 00333 0000099999 999.990000000000000000000000000000
@ -261,29 +253,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' order by f136;
from tb3 where f122 = 'Test 3.5.8.5-if';
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' order by f136;
from tb3 where f122 = 'Test 3.5.8.5-if';
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' order by f136;
from tb3 where f122 = 'Test 3.5.8.5-if';
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' order by f136;
from tb3 where f122 = 'Test 3.5.8.5-if';
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
@ -343,20 +335,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' order by f120;
from tb3 where f122 = 'Test 3.5.8.5-case';
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' order by f120;
from tb3 where f122 = 'Test 3.5.8.5-case';
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' order by f120;
from tb3 where f122 = 'Test 3.5.8.5-case';
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
@ -366,34 +358,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' order by f120;
from tb3 where f122 = 'Test 3.5.8.5-case';
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' order by f120;
from tb3 where f122 = 'Test 3.5.8.5-case';
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' order by f120;
from tb3 where f122 = 'Test 3.5.8.5-case';
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

View File

@ -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' order by f136;
select f118, f121, f122, f136, f163 from tb3 where f122='Test 3.5.9.3';
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' order by f136;
select f118, f121, f122, f136, f163 from tb3 where f122='Test 3.5.9.3';
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%' order by f163;
where f122 like 'Test 3.5.9.4%';
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 1048 Column 'f136' cannot be null
Warning 1263 Column was set to data type implicit default; NULL supplied for NOT NULL column 'f136' at row 11
select f118, f121, f122, f136, f151, f163 from tb3
where f122 like 'Test 3.5.9.4-trig' order by f163;
where f122 like 'Test 3.5.9.4-trig';
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,

View File

@ -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%' order by f151;
from tb3 where f122 like 'Test 3.5.10.1/2/3%';
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%' order by f151;
where f122 like 'Test 3.5.10.1/2/3%';
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%' order by f151;
where f122 like 'Test 3.5.10.1/2/3%';
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 order by f1 limit 10;
Select * from tb_load 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 order by f1;
select * from t3;
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 order by f1;
select * from t1;
f1
0
select * from t2 order by f2;
select * from t2;
f2
select * from t3 order by f3;
select * from t3;
f3
select * from t4 order by f4;
select * from t4;
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 for column 'f4' at row 1
ERROR 22003: Out of range value adjusted for column 'f4' at row 1
commit;
select * from t1 order by f1;
select * from t1;
f1
1
select * from t2 order by f2;
select * from t2;
f2
select * from t3 order by f3;
select * from t3;
f3
drop trigger tr1;
drop trigger tr2;

View File

@ -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;

View File

@ -1926,7 +1926,7 @@ f1 f2
2 two
4 four
INSERT INTO v1 VALUES(2,'two');
ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
ERROR 23000: Duplicate entry '2' for key 1
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 'PRIMARY'
ERROR 23000: Duplicate entry '2' for key 1
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 order by f1, f2;
SELECT * FROM t1;
f1 f2
A 1
CREATE VIEW v1 AS SELECT * FROM t1 WHERE f2 BETWEEN 1 AND 2
WITH CASCADED CHECK OPTION ;
SELECT * FROM v1 order by f1, f2;
SELECT * FROM v1;
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 order by f1, f2;
SELECT * FROM v1;
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 order by f1, f2;
SELECT * FROM v1;
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 'PRIMARY'
ERROR 23000: Duplicate entry '0' for key 1
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 'PRIMARY'
ERROR 23000: Duplicate entry '0' for key 1
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 order by f1, report;
SELECT * FROM t1;
f1 f2 f4 report
-1 NULL ABC t1 0
-1 NULL ABC v1 0
SELECT * FROM v1 order by f1, report;
SELECT * FROM v1;
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 order by f1, report;
SELECT * FROM t1;
f1 f2 f4x report
-1 NULL ABC t1 0
-1 NULL ABC v1 0
0 NULL ABC t1 1
SELECT * FROM v1 order by f1, report;
SELECT * FROM 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
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 order by f1, report;
SELECT * FROM t1;
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 order by f1, report;
SELECT * FROM v1;
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 order by f1, report;
SELECT * FROM t1;
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 order by f1, report;
SELECT * FROM v1;
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 order by f1, report;
SELECT * FROM t1;
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 order by f1, report;
SELECT * FROM v1;
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 order by f1, report;
SELECT * FROM t1;
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 order by f1, report;
SELECT * FROM v1;
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 order by f1, report;
SELECT * FROM t1;
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 order by f1, report;
SELECT * FROM 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
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 order by f1, report;
SELECT * FROM t1;
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 order by f1, report;
SELECT * FROM v1;
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 order by f1, report;
SELECT * FROM t1;
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 --------> t1 8 -0.00033
ABC <------ 20 --------> v1 7 NULL
ABC <------ 20 --------> t1 8 -0.00033
ABC <------ 20 --------> v1 8 -0.00033
SELECT * FROM v1 order by f1, report;
SELECT * FROM v1;
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 -0.00033 <------ 20 --------> t1 8
ABC NULL <------ 20 --------> v1 7
ABC -0.00033 <------ 20 --------> t1 8
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 order by f1, report;
SELECT * FROM t1;
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 --------> t1 8 -0.00033 NULL
ABC <------ 20 --------> t1 9 -0.00033 -2.20
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 9a -0.00033 NULL
SELECT * FROM v1 order by f1, report;
SELECT * FROM v1;
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 -0.00033 <------ 20 --------> t1 8
ABC -0.00033 <------ 20 --------> t1 9
ABC NULL <------ 20 --------> v1 7
ABC -0.00033 <------ 20 --------> t1 8
ABC -0.00033 <------ 20 --------> v1 8
ABC -0.00033 <------ 20 --------> t1 9
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 order by f1, f2;
SELECT * FROM t1;
f1 f2
ABC 3
SELECT * FROM v1 order by 2;
SELECT * FROM v1;
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 order by f1, f2;
SELECT * FROM t1;
f1 f2
ABC 3
ABC DEF
SELECT * FROM v1 order by 2;
SELECT * FROM v1;
f1 my_sqrt
ABC 0
ABC 1.7320508075689
ABC 0
SELECT SQRT('DEF');
SQRT('DEF')
0
Warnings:
Warning 1292 Truncated incorrect DOUBLE value: 'DEF'
CREATE VIEW v2 AS SELECT SQRT('DEF');
SELECT * FROM v2 order by 1;
SELECT * FROM v2;
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 order by 2;
SELECT * FROM v2;
f1 my_sqrt
ABC 0
ABC 1.7320508075689
CREATE TABLE t2 AS SELECT f1, SQRT(f2) my_sqrt FROM t1;
SELECT * FROM t2 order by 2;
f1 my_sqrt
ABC 0
CREATE TABLE t2 AS SELECT f1, SQRT(f2) my_sqrt FROM t1;
SELECT * FROM t2;
f1 my_sqrt
ABC 1.73205080756888
ABC 0
DROP TABLE t2;
CREATE TABLE t2 AS SELECT * FROM v1;
SELECT * FROM t2 order by 2;
SELECT * FROM t2;
f1 my_sqrt
ABC 0
ABC 1.73205080756888
ABC 0
DROP TABLE t2;
CREATE TABLE t2 AS SELECT * FROM v2;
SELECT * FROM t2 order by 2;
SELECT * FROM t2;
f1 my_sqrt
ABC 0
ABC 1.73205080756888
ABC 0
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

36
mysql-test/suite/funcs_1/r/memory_storedproc_02.result Normal file → Executable file
View File

@ -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 where f1='a`' and f2='a`' limit 1;
SELECT f1, f2 into @x, @y from t2 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 where f4=-5000 and f3='1000-01-01' limit 1;
SELECT f4, f3 into @x, @y from t2 limit 1;
SELECT @x, @y;
END//
CALL sp1();
@ -544,9 +544,6 @@ 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 ()
@ -1087,8 +1084,7 @@ 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
where f4 >=-5000 order by f4 limit 3;
declare cur1 cursor for SELECT f1, f2, f4, f5, f6 from t2 limit 3;
open cur1;
while proceed do
SELECT count AS 'loop';
@ -1171,7 +1167,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 order by f4;
SELECT f1, f2, f4, f5 from t2;
f1 f2 f4 f5
a` a` -5000 a`
aaa aaa -4999 aaa
@ -1191,21 +1187,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 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;
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;
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;
@ -1274,10 +1270,8 @@ 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
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 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 continue handler for sqlstate '02000' set proceed=0;
open cur1;
open cur2;
@ -1308,10 +1302,8 @@ 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
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 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 CONTINUE HANDLER FOR SQLSTATE '02000' SET proceed=0;
OPEN cur1;
OPEN cur2;

0
mysql-test/suite/funcs_1/r/memory_storedproc_03.result Normal file → Executable file
View File

0
mysql-test/suite/funcs_1/r/memory_storedproc_07.result Normal file → Executable file
View File

0
mysql-test/suite/funcs_1/r/memory_storedproc_08.result Normal file → Executable file
View File

10
mysql-test/suite/funcs_1/r/memory_storedproc_10.result Normal file → Executable file
View File

@ -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 WHERE f4=-5000 LIMIT 1;
SELECT * FROM db_storedproc.t1 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 ORDER BY f4;
SELECT * FROM temp;
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 ORDER BY f4;
SELECT * FROM temp;
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 ORDER BY f4;
SELECT * FROM temp;
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 ORDER BY f4;
SELECT * FROM temp;
f1 f2 f3 f4 f5 f6
a` a` 1000-01-01 -5000 a` -5000
aaa aaa 1000-01-02 -4999 aaa -4999

View File

@ -195,9 +195,6 @@ 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
@ -206,14 +203,12 @@ 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 order by trigger_name;
select trigger_name from information_schema.triggers;
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:
@ -315,7 +310,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 order by f2;
select * from t1;
f1 f2
trig1 1
trig1 2
@ -325,7 +320,7 @@ trig2 3
select * from trig_db3.t1;
f1 f2
trig3 4
select * from t1 order by f2;
select * from t1;
f1 f2
trig1 1
trig1 2
@ -350,10 +345,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 order by trigger_name;
from information_schema.triggers;
trigger_schema trigger_name event_object_table
trig_db1 trig1_a t1
trig_db1 trig1_b t1
trig_db1 trig1_a 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);

View File

@ -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 TRIGGER on *.* from test_noprivs@localhost;
revoke SUPER 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, 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'
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'
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant SUPER on *.* to test_yesprivs@localhost;
grant SELECT on priv_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
connect(localhost,test_noprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
connect(localhost,test_yesprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
@ -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';
Got one of the listed errors
ERROR 42000: Access denied; you need the SUPER privilege for this operation
use priv_db;
insert into t1 (f1) values ('insert 3.5.3.2-no');
select f1 from t1 order by f1;
select f1 from t1;
f1
insert 3.5.3.2-no
select current_user;
@ -118,12 +118,15 @@ 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 order by f1;
select f1 from t1;
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 order by f1;
select f1 from t1;
f1
insert 3.5.3.2-no
trig 3.5.3.2_2-yes
@ -132,10 +135,10 @@ Testcase 3.5.3.6:
-----------------
use priv_db;
drop trigger trg1_2;
Got one of the listed errors
ERROR 42000: Access denied; you need the SUPER privilege for this operation
use priv_db;
insert into t1 (f1) values ('insert 3.5.3.6-yes');
select f1 from t1 order by f1;
select f1 from t1;
f1
insert 3.5.3.2-no
trig 3.5.3.2_2-yes
@ -144,12 +147,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 order by f1;
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
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
drop trigger trg1_2;
Testcase 3.5.3.7a:
@ -159,12 +162,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, EVENT, TRIGGER 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 ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER, UPDATE on *.* to test_yesprivs@localhost;
grant SUPER, UPDATE on *.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT UPDATE, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT UPDATE, SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
connect(localhost,test_noprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
connect(localhost,test_yesprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
select current_user;
@ -173,24 +176,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, EVENT, TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
select f1 from t1 order by f1;
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;
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 order by f1;
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.2_2-yes
trig 3.5.3.2_2-yes
drop trigger trg4a_1;
use priv_db;
select current_user;
@ -198,220 +201,236 @@ current_user
test_yesprivs@localhost
show grants;
Grants for test_yesprivs@localhost
GRANT UPDATE, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT UPDATE, SUPER 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 order by f1;
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.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 TRIGGER on *.* to test_noprivs;
grant SUPER on *.* to test_noprivs;
grant ALL on priv_db.* to test_noprivs@localhost;
revoke UPDATE on priv_db.* from test_noprivs@localhost;
show grants for test_noprivs;
Grants for test_noprivs@%
GRANT TRIGGER ON *.* TO 'test_noprivs'@'%'
GRANT SUPER ON *.* TO 'test_noprivs'@'%'
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant SUPER on *.* to test_yesprivs@localhost;
grant UPDATE on priv_db.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT UPDATE ON `priv_db`.* TO 'test_yesprivs'@'localhost'
connect(localhost,test_noprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
connect(localhost,test_yesprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
show grants;
Grants for test_noprivs@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, EVENT, TRIGGER 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 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 order by f1;
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
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
insert 3.5.3.7-1b
update t1 set f1 = 'update 3.5.3.7-1b' where f1 = 'insert 3.5.3.7-1b';
select f1 from t1 order by f1;
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.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 TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT UPDATE ON `priv_db`.* TO 'test_yesprivs'@'localhost'
use priv_db;
create trigger trg4b_2 before UPDATE on t1 for each 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 order by f1;
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
insert 3.5.3.7-2b
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
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;
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.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
trig 3.5.3.7-2b
drop trigger trg4b_2;
Testcase 3.5.3.7c
-----------------
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
grant TRIGGER on *.* to test_noprivs@localhost;
grant SUPER on *.* to test_noprivs@localhost;
grant ALL on priv_db.t1 to test_noprivs@localhost;
revoke UPDATE on priv_db.t1 from test_noprivs@localhost;
show grants for test_noprivs;
Grants for test_noprivs@%
GRANT TRIGGER ON *.* TO 'test_noprivs'@'%'
GRANT SUPER ON *.* TO 'test_noprivs'@'%'
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant SUPER on *.* to test_yesprivs@localhost;
grant UPDATE on priv_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
connect(localhost,test_noprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
connect(localhost,test_yesprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
show grants;
Grants for test_noprivs@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'
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'
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 order by f1;
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
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
trig 3.5.3.7-2b
insert 3.5.3.7-1c
drop trigger trg4c_1;
show grants;
Grants for test_yesprivs@localhost
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
use priv_db;
create trigger trg4c_2 before INSERT on t1 for each 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 order by f1;
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
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
trig 3.5.3.7-2b
insert 3.5.3.7-1c
trig 3.5.3.7-2c
drop trigger trg4c_2;
Testcase 3.5.3.7d:
------------------
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
grant TRIGGER on *.* to test_noprivs@localhost;
grant SUPER on *.* to test_noprivs@localhost;
grant SELECT (f1), INSERT (f1) on priv_db.t1 to test_noprivs@localhost;
show grants for test_noprivs;
Grants for test_noprivs@%
GRANT TRIGGER ON *.* TO 'test_noprivs'@'%'
GRANT SUPER ON *.* TO 'test_noprivs'@'%'
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant SUPER 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 TRIGGER ON *.* TO 'test_noprivs'@'%'
GRANT SUPER 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 TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SUPER 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 order by f1;
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
insert 3.5.3.7-1c
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
trig 3.5.3.7-2b
insert 3.5.3.7-1c
trig 3.5.3.7-2c
insert 3.5.3.7-1d
drop trigger trg4d_1;
show grants;
Grants for test_yesprivs@localhost
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SUPER 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 order by f1;
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
insert 3.5.3.7-1c
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
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.7-2d
drop trigger trg4d_2;
Testcase 3.5.3.8a:
@ -421,12 +440,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, EVENT, TRIGGER 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 ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER, SELECT on *.* to test_yesprivs@localhost;
grant SUPER, SELECT on *.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT SELECT, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT, SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
connect(localhost,test_noprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
connect(localhost,test_yesprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
select current_user;
@ -435,7 +454,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, EVENT, TRIGGER 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 ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
Trigger create disabled - should fail - Bug 8887
------------------------------------------------
@ -454,13 +473,17 @@ current_user
test_yesprivs@localhost
show grants;
Grants for test_yesprivs@localhost
GRANT SELECT, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT, SUPER 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
@ -470,26 +493,26 @@ drop trigger trg5a_2;
Testcase: 3.5.3.8b
------------------
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
grant TRIGGER on *.* to test_noprivs@localhost;
grant SUPER 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 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'
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'
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant SUPER 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 TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SUPER 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 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'
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'
use priv_db;
Trigger create disabled - should fail - Bug 8887
@ -506,7 +529,7 @@ before trig 3.5.3.8-1b
drop trigger trg5b_1;
show grants;
Grants for test_yesprivs@localhost
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SUPER 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
@ -516,6 +539,10 @@ 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
@ -525,26 +552,26 @@ drop trigger trg5b_2;
Testcase 3.5.3.8c:
------------------
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
grant TRIGGER on *.* to test_noprivs@localhost;
grant SUPER 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 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'
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'
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant SUPER on *.* to test_yesprivs@localhost;
grant SELECT on priv_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
connect(localhost,test_noprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
connect(localhost,test_yesprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
show grants;
Grants for 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'
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'
use priv_db;
Trigger create disabled - should fail - Bug 8887
@ -557,12 +584,16 @@ before trig 3.5.3.8-1c
drop trigger trg5c_1;
show grants;
Grants for test_yesprivs@localhost
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SUPER 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
@ -572,24 +603,24 @@ drop trigger trg5c_2;
Testcase: 3.5.3.8d:
-------------------
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
grant TRIGGER on *.* to test_noprivs@localhost;
grant SUPER 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 TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SUPER 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 TRIGGER on *.* to test_yesprivs@localhost;
grant SUPER 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 TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SUPER 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 TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SUPER 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;
@ -603,12 +634,16 @@ before trig 3.5.3.8-1d
drop trigger trg5d_1;
show grants;
Grants for test_yesprivs@localhost
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SUPER 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
@ -623,12 +658,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 TRIGGER on *.* to test_yesprivs@localhost;
grant SUPER 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 TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SUPER 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);
@ -644,10 +679,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 order by f1;
select f1 from t1;
f1
4
select f2 from t2 order by f2;
select f2 from t2;
f2
4
use priv_db;
@ -660,11 +695,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 order by f1;
select f1 from t1;
f1
2
4
select f2 from t2 order by f2;
2
select f2 from t2;
f2
1
use priv_db;
@ -677,12 +712,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 order by f1;
select f1 from t1;
f1
1
2
4
select f2 from t2 order by f2;
2
1
select f2 from t2;
f2
1
select @aaa;
@ -698,13 +733,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 order by f1;
select f1 from t1;
f1
1
1
2
4
select f2 from t2 order by f2;
2
1
1
select f2 from t2;
f2
drop database if exists priv_db;
drop user test_yesprivs@localhost;

View File

@ -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 order by f1;
Select * from t1;
f1
Trigger 3.5.4.1
drop trigger trg1;
select trigger_schema, trigger_name, event_object_table
from information_schema.triggers order by trigger_name;
from information_schema.triggers;
trigger_schema trigger_name event_object_table
Insert into t1 values ('Insert no trigger 3.5.4.1');
Select * from t1 order by f1;
Select * from t1;
f1
Insert no trigger 3.5.4.1
Trigger 3.5.4.1
Insert no 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 order by f1;
Select * from dbtest_two.t2;
f1
1st Insert 3.5.
2nd Insert 3.5.

View File

@ -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 order by i120;
select * from db_test.t1_i;
i120 i136 i144 i163
1 00222 0000023456 1.050000000000000000000000000000
select * from db_test.t1_u order by u120;
select * from db_test.t1_u;
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 order by d120;
select * from db_test.t1_d;
d120 d136 d144 d163
a 00111 0000099999 999.990000000000000000000000000000
c 00333 0000099999 999.990000000000000000000000000000
@ -158,22 +158,14 @@ 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 order by i120;
select * from db_test.t1_i;
i120 i136 i144 i163
1 00222 0000023456 1.050000000000000000000000000000
I 00222 0000023456 1.050000000000000000000000000000
@ -190,14 +182,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 order by u120;
select * from db_test.t1_u;
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
-------------------------------
@ -210,7 +202,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 order by d120;
select * from db_test.t1_d;
d120 d136 d144 d163
a 00111 0000099999 999.990000000000000000000000000000
c 00333 0000099999 999.990000000000000000000000000000
@ -257,29 +249,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' order by f136;
from tb3 where f122 = 'Test 3.5.8.5-if';
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' order by f136;
from tb3 where f122 = 'Test 3.5.8.5-if';
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' order by f136;
from tb3 where f122 = 'Test 3.5.8.5-if';
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' order by f136;
from tb3 where f122 = 'Test 3.5.8.5-if';
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
@ -339,20 +331,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' order by f120;
from tb3 where f122 = 'Test 3.5.8.5-case';
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' order by f120;
from tb3 where f122 = 'Test 3.5.8.5-case';
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' order by f120;
from tb3 where f122 = 'Test 3.5.8.5-case';
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
@ -362,34 +354,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' order by f120;
from tb3 where f122 = 'Test 3.5.8.5-case';
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' order by f120;
from tb3 where f122 = 'Test 3.5.8.5-case';
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' order by f120;
from tb3 where f122 = 'Test 3.5.8.5-case';
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

View File

@ -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' order by f136;
select f118, f121, f122, f136, f163 from tb3 where f122='Test 3.5.9.3';
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' order by f136;
select f118, f121, f122, f136, f163 from tb3 where f122='Test 3.5.9.3';
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%' order by f163;
where f122 like 'Test 3.5.9.4%';
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 1048 Column 'f136' cannot be null
Warning 1263 Column was set to data type implicit default; NULL supplied for NOT NULL column 'f136' at row 11
select f118, f121, f122, f136, f151, f163 from tb3
where f122 like 'Test 3.5.9.4-trig' order by f163;
where f122 like 'Test 3.5.9.4-trig';
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,

View File

@ -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%' order by f151;
from tb3 where f122 like 'Test 3.5.10.1/2/3%';
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%' order by f151;
where f122 like 'Test 3.5.10.1/2/3%';
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%' order by f151;
where f122 like 'Test 3.5.10.1/2/3%';
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 order by f1 limit 10;
Select * from tb_load 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 order by f1;
select * from t3;
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 order by f1;
select * from t1;
f1
0
1
select * from t2 order by f2;
select * from t2;
f2
2
select * from t3 order by f3;
select * from t3;
f3
3
select * from t4 order by f4;
select * from t4;
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 for column 'f4' at row 1
ERROR 22003: Out of range value adjusted for column 'f4' at row 1
commit;
select * from t1 order by f1;
select * from t1;
f1
1
1
select * from t2 order by f2;
select * from t2;
f2
2
select * from t3 order by f3;
select * from t3;
f3
3
drop trigger tr1;

View File

@ -1930,7 +1930,7 @@ f1 f2
2 two
4 four
INSERT INTO v1 VALUES(2,'two');
ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
ERROR 23000: Duplicate entry '2' for key 1
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 'PRIMARY'
ERROR 23000: Duplicate entry '2' for key 1
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 order by f1, f2;
SELECT * FROM t1;
f1 f2
A 1
CREATE VIEW v1 AS SELECT * FROM t1 WHERE f2 BETWEEN 1 AND 2
WITH CASCADED CHECK OPTION ;
SELECT * FROM v1 order by f1, f2;
SELECT * FROM v1;
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 order by f1, f2;
SELECT * FROM v1;
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 order by f1, f2;
SELECT * FROM v1;
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 'PRIMARY'
ERROR 23000: Duplicate entry '0' for key 1
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 'PRIMARY'
ERROR 23000: Duplicate entry '0' for key 1
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 order by f1, report;
SELECT * FROM t1;
f1 f2 f4 report
-1 NULL ABC t1 0
-1 NULL ABC v1 0
SELECT * FROM v1 order by f1, report;
SELECT * FROM v1;
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 order by f1, report;
SELECT * FROM t1;
f1 f2 f4x report
-1 NULL ABC t1 0
-1 NULL ABC v1 0
0 NULL ABC t1 1
SELECT * FROM v1 order by f1, report;
SELECT * FROM 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
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 order by f1, report;
SELECT * FROM t1;
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 order by f1, report;
SELECT * FROM v1;
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 order by f1, report;
SELECT * FROM t1;
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 order by f1, report;
SELECT * FROM v1;
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 order by f1, report;
SELECT * FROM t1;
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 order by f1, report;
SELECT * FROM v1;
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 order by f1, report;
SELECT * FROM t1;
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 order by f1, report;
SELECT * FROM v1;
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 order by f1, report;
SELECT * FROM t1;
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 order by f1, report;
SELECT * FROM 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
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 order by f1, report;
SELECT * FROM t1;
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 order by f1, report;
SELECT * FROM v1;
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 order by f1, report;
SELECT * FROM t1;
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 --------> t1 8 -0.00033
ABC <------ 20 --------> v1 7 NULL
ABC <------ 20 --------> t1 8 -0.00033
ABC <------ 20 --------> v1 8 -0.00033
SELECT * FROM v1 order by f1, report;
SELECT * FROM v1;
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 -0.00033 <------ 20 --------> t1 8
ABC NULL <------ 20 --------> v1 7
ABC -0.00033 <------ 20 --------> t1 8
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 order by f1, report;
SELECT * FROM t1;
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 --------> t1 8 -0.00033 NULL
ABC <------ 20 --------> t1 9 -0.00033 -2.20
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 9a -0.00033 NULL
SELECT * FROM v1 order by f1, report;
SELECT * FROM v1;
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 -0.00033 <------ 20 --------> t1 8
ABC -0.00033 <------ 20 --------> t1 9
ABC NULL <------ 20 --------> v1 7
ABC -0.00033 <------ 20 --------> t1 8
ABC -0.00033 <------ 20 --------> v1 8
ABC -0.00033 <------ 20 --------> t1 9
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 order by f1, f2;
SELECT * FROM t1;
f1 f2
ABC 3
SELECT * FROM v1 order by 2;
SELECT * FROM v1;
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 order by f1, f2;
SELECT * FROM t1;
f1 f2
ABC 3
ABC DEF
SELECT * FROM v1 order by 2;
SELECT * FROM v1;
f1 my_sqrt
ABC 0
ABC 1.7320508075689
ABC 0
SELECT SQRT('DEF');
SQRT('DEF')
0
Warnings:
Warning 1292 Truncated incorrect DOUBLE value: 'DEF'
CREATE VIEW v2 AS SELECT SQRT('DEF');
SELECT * FROM v2 order by 1;
SELECT * FROM v2;
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 order by 2;
SELECT * FROM v2;
f1 my_sqrt
ABC 0
ABC 1.7320508075689
CREATE TABLE t2 AS SELECT f1, SQRT(f2) my_sqrt FROM t1;
SELECT * FROM t2 order by 2;
f1 my_sqrt
ABC 0
CREATE TABLE t2 AS SELECT f1, SQRT(f2) my_sqrt FROM t1;
SELECT * FROM t2;
f1 my_sqrt
ABC 1.73205080756888
ABC 0
DROP TABLE t2;
CREATE TABLE t2 AS SELECT * FROM v1;
SELECT * FROM t2 order by 2;
SELECT * FROM t2;
f1 my_sqrt
ABC 0
ABC 1.73205080756888
ABC 0
DROP TABLE t2;
CREATE TABLE t2 AS SELECT * FROM v2;
SELECT * FROM t2 order by 2;
SELECT * FROM t2;
f1 my_sqrt
ABC 0
ABC 1.73205080756888
ABC 0
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

36
mysql-test/suite/funcs_1/r/myisam_storedproc_02.result Normal file → Executable file
View File

@ -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 where f1='a`' and f2='a`' limit 1;
SELECT f1, f2 into @x, @y from t2 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 where f4=-5000 and f3='1000-01-01' limit 1;
SELECT f4, f3 into @x, @y from t2 limit 1;
SELECT @x, @y;
END//
CALL sp1();
@ -544,9 +544,6 @@ 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 ()
@ -1087,8 +1084,7 @@ 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
where f4 >=-5000 order by f4 limit 3;
declare cur1 cursor for SELECT f1, f2, f4, f5, f6 from t2 limit 3;
open cur1;
while proceed do
SELECT count AS 'loop';
@ -1171,7 +1167,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 order by f4;
SELECT f1, f2, f4, f5 from t2;
f1 f2 f4 f5
a` a` -5000 a`
aaa aaa -4999 aaa
@ -1191,21 +1187,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 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;
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;
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;
@ -1274,10 +1270,8 @@ 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
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 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 continue handler for sqlstate '02000' set proceed=0;
open cur1;
open cur2;
@ -1308,10 +1302,8 @@ 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
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 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 CONTINUE HANDLER FOR SQLSTATE '02000' SET proceed=0;
OPEN cur1;
OPEN cur2;

0
mysql-test/suite/funcs_1/r/myisam_storedproc_03.result Normal file → Executable file
View File

0
mysql-test/suite/funcs_1/r/myisam_storedproc_07.result Normal file → Executable file
View File

0
mysql-test/suite/funcs_1/r/myisam_storedproc_08.result Normal file → Executable file
View File

10
mysql-test/suite/funcs_1/r/myisam_storedproc_10.result Normal file → Executable file
View File

@ -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 WHERE f4=-5000 LIMIT 1;
SELECT * FROM db_storedproc.t1 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 ORDER BY f4;
SELECT * FROM temp;
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 ORDER BY f4;
SELECT * FROM temp;
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 ORDER BY f4;
SELECT * FROM temp;
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 ORDER BY f4;
SELECT * FROM temp;
f1 f2 f3 f4 f5 f6
a` a` 1000-01-01 -5000 a` -5000
aaa aaa 1000-01-02 -4999 aaa -4999

View File

@ -199,9 +199,6 @@ 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
@ -210,14 +207,12 @@ 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 order by trigger_name;
select trigger_name from information_schema.triggers;
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:
@ -319,7 +314,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 order by f2;
select * from t1;
f1 f2
trig1 1
trig1 2
@ -329,7 +324,7 @@ trig2 3
select * from trig_db3.t1;
f1 f2
trig3 4
select * from t1 order by f2;
select * from t1;
f1 f2
trig1 1
trig1 2
@ -354,10 +349,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 order by trigger_name;
from information_schema.triggers;
trigger_schema trigger_name event_object_table
trig_db1 trig1_a t1
trig_db1 trig1_b t1
trig_db1 trig1_a 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);

View File

@ -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 TRIGGER on *.* from test_noprivs@localhost;
revoke SUPER 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, 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'
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'
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant SUPER on *.* to test_yesprivs@localhost;
grant SELECT on priv_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
connect(localhost,test_noprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
connect(localhost,test_yesprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
@ -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';
Got one of the listed errors
ERROR 42000: Access denied; you need the SUPER privilege for this operation
use priv_db;
insert into t1 (f1) values ('insert 3.5.3.2-no');
select f1 from t1 order by f1;
select f1 from t1;
f1
insert 3.5.3.2-no
select current_user;
@ -122,12 +122,15 @@ 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 order by f1;
select f1 from t1;
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 order by f1;
select f1 from t1;
f1
insert 3.5.3.2-no
trig 3.5.3.2_2-yes
@ -136,10 +139,10 @@ Testcase 3.5.3.6:
-----------------
use priv_db;
drop trigger trg1_2;
Got one of the listed errors
ERROR 42000: Access denied; you need the SUPER privilege for this operation
use priv_db;
insert into t1 (f1) values ('insert 3.5.3.6-yes');
select f1 from t1 order by f1;
select f1 from t1;
f1
insert 3.5.3.2-no
trig 3.5.3.2_2-yes
@ -148,12 +151,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 order by f1;
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
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
drop trigger trg1_2;
Testcase 3.5.3.7a:
@ -163,12 +166,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, EVENT, TRIGGER 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 ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER, UPDATE on *.* to test_yesprivs@localhost;
grant SUPER, UPDATE on *.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT UPDATE, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT UPDATE, SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
connect(localhost,test_noprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
connect(localhost,test_yesprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
select current_user;
@ -177,24 +180,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, EVENT, TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
select f1 from t1 order by f1;
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;
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 order by f1;
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.2_2-yes
trig 3.5.3.2_2-yes
drop trigger trg4a_1;
use priv_db;
select current_user;
@ -202,220 +205,236 @@ current_user
test_yesprivs@localhost
show grants;
Grants for test_yesprivs@localhost
GRANT UPDATE, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT UPDATE, SUPER 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 order by f1;
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.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 TRIGGER on *.* to test_noprivs;
grant SUPER on *.* to test_noprivs;
grant ALL on priv_db.* to test_noprivs@localhost;
revoke UPDATE on priv_db.* from test_noprivs@localhost;
show grants for test_noprivs;
Grants for test_noprivs@%
GRANT TRIGGER ON *.* TO 'test_noprivs'@'%'
GRANT SUPER ON *.* TO 'test_noprivs'@'%'
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant SUPER on *.* to test_yesprivs@localhost;
grant UPDATE on priv_db.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT UPDATE ON `priv_db`.* TO 'test_yesprivs'@'localhost'
connect(localhost,test_noprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
connect(localhost,test_yesprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
show grants;
Grants for test_noprivs@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, EVENT, TRIGGER 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 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 order by f1;
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
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
insert 3.5.3.7-1b
update t1 set f1 = 'update 3.5.3.7-1b' where f1 = 'insert 3.5.3.7-1b';
select f1 from t1 order by f1;
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.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 TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT UPDATE ON `priv_db`.* TO 'test_yesprivs'@'localhost'
use priv_db;
create trigger trg4b_2 before UPDATE on t1 for each 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 order by f1;
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
insert 3.5.3.7-2b
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
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;
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.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
trig 3.5.3.7-2b
drop trigger trg4b_2;
Testcase 3.5.3.7c
-----------------
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
grant TRIGGER on *.* to test_noprivs@localhost;
grant SUPER on *.* to test_noprivs@localhost;
grant ALL on priv_db.t1 to test_noprivs@localhost;
revoke UPDATE on priv_db.t1 from test_noprivs@localhost;
show grants for test_noprivs;
Grants for test_noprivs@%
GRANT TRIGGER ON *.* TO 'test_noprivs'@'%'
GRANT SUPER ON *.* TO 'test_noprivs'@'%'
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant SUPER on *.* to test_yesprivs@localhost;
grant UPDATE on priv_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
connect(localhost,test_noprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
connect(localhost,test_yesprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
show grants;
Grants for test_noprivs@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'
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'
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 order by f1;
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
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
trig 3.5.3.7-2b
insert 3.5.3.7-1c
drop trigger trg4c_1;
show grants;
Grants for test_yesprivs@localhost
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
use priv_db;
create trigger trg4c_2 before INSERT on t1 for each 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 order by f1;
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
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
trig 3.5.3.7-2b
insert 3.5.3.7-1c
trig 3.5.3.7-2c
drop trigger trg4c_2;
Testcase 3.5.3.7d:
------------------
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
grant TRIGGER on *.* to test_noprivs@localhost;
grant SUPER on *.* to test_noprivs@localhost;
grant SELECT (f1), INSERT (f1) on priv_db.t1 to test_noprivs@localhost;
show grants for test_noprivs;
Grants for test_noprivs@%
GRANT TRIGGER ON *.* TO 'test_noprivs'@'%'
GRANT SUPER ON *.* TO 'test_noprivs'@'%'
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant SUPER 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 TRIGGER ON *.* TO 'test_noprivs'@'%'
GRANT SUPER 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 TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SUPER 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 order by f1;
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
insert 3.5.3.7-1c
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
trig 3.5.3.7-2b
insert 3.5.3.7-1c
trig 3.5.3.7-2c
insert 3.5.3.7-1d
drop trigger trg4d_1;
show grants;
Grants for test_yesprivs@localhost
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SUPER 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 order by f1;
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
insert 3.5.3.7-1c
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
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.7-2d
drop trigger trg4d_2;
Testcase 3.5.3.8a:
@ -425,12 +444,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, EVENT, TRIGGER 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 ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER, SELECT on *.* to test_yesprivs@localhost;
grant SUPER, SELECT on *.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT SELECT, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT, SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
connect(localhost,test_noprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
connect(localhost,test_yesprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
select current_user;
@ -439,7 +458,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, EVENT, TRIGGER 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 ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
Trigger create disabled - should fail - Bug 8887
------------------------------------------------
@ -458,13 +477,17 @@ current_user
test_yesprivs@localhost
show grants;
Grants for test_yesprivs@localhost
GRANT SELECT, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT, SUPER 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
@ -474,26 +497,26 @@ drop trigger trg5a_2;
Testcase: 3.5.3.8b
------------------
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
grant TRIGGER on *.* to test_noprivs@localhost;
grant SUPER 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 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'
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'
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant SUPER 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 TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SUPER 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 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'
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'
use priv_db;
Trigger create disabled - should fail - Bug 8887
@ -510,7 +533,7 @@ before trig 3.5.3.8-1b
drop trigger trg5b_1;
show grants;
Grants for test_yesprivs@localhost
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SUPER 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
@ -520,6 +543,10 @@ 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
@ -529,26 +556,26 @@ drop trigger trg5b_2;
Testcase 3.5.3.8c:
------------------
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
grant TRIGGER on *.* to test_noprivs@localhost;
grant SUPER 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 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'
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'
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant SUPER on *.* to test_yesprivs@localhost;
grant SELECT on priv_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
connect(localhost,test_noprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
connect(localhost,test_yesprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
show grants;
Grants for 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'
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'
use priv_db;
Trigger create disabled - should fail - Bug 8887
@ -561,12 +588,16 @@ before trig 3.5.3.8-1c
drop trigger trg5c_1;
show grants;
Grants for test_yesprivs@localhost
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SUPER 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
@ -576,24 +607,24 @@ drop trigger trg5c_2;
Testcase: 3.5.3.8d:
-------------------
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
grant TRIGGER on *.* to test_noprivs@localhost;
grant SUPER 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 TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SUPER 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 TRIGGER on *.* to test_yesprivs@localhost;
grant SUPER 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 TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SUPER 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 TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SUPER 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;
@ -607,12 +638,16 @@ before trig 3.5.3.8-1d
drop trigger trg5d_1;
show grants;
Grants for test_yesprivs@localhost
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SUPER 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
@ -627,12 +662,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 TRIGGER on *.* to test_yesprivs@localhost;
grant SUPER 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 TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SUPER 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);
@ -648,10 +683,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 order by f1;
select f1 from t1;
f1
4
select f2 from t2 order by f2;
select f2 from t2;
f2
4
use priv_db;
@ -664,11 +699,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 order by f1;
select f1 from t1;
f1
2
4
select f2 from t2 order by f2;
2
select f2 from t2;
f2
1
use priv_db;
@ -681,12 +716,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 order by f1;
select f1 from t1;
f1
1
2
4
select f2 from t2 order by f2;
2
1
select f2 from t2;
f2
1
select @aaa;
@ -702,13 +737,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 order by f1;
select f1 from t1;
f1
1
1
2
4
select f2 from t2 order by f2;
2
1
1
select f2 from t2;
f2
drop database if exists priv_db;
drop user test_yesprivs@localhost;

View File

@ -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 order by f1;
Select * from t1;
f1
Trigger 3.5.4.1
drop trigger trg1;
select trigger_schema, trigger_name, event_object_table
from information_schema.triggers order by trigger_name;
from information_schema.triggers;
trigger_schema trigger_name event_object_table
Insert into t1 values ('Insert no trigger 3.5.4.1');
Select * from t1 order by f1;
Select * from t1;
f1
Insert no trigger 3.5.4.1
Trigger 3.5.4.1
Insert no 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 order by f1;
Select * from dbtest_two.t2;
f1
1st Insert 3.5.
2nd Insert 3.5.

View File

@ -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 order by i120;
select * from db_test.t1_i;
i120 i136 i144 i163
1 00222 0000023456 1.050000000000000000000000000000
select * from db_test.t1_u order by u120;
select * from db_test.t1_u;
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 order by d120;
select * from db_test.t1_d;
d120 d136 d144 d163
a 00111 0000099999 999.990000000000000000000000000000
c 00333 0000099999 999.990000000000000000000000000000
@ -162,22 +162,14 @@ 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 order by i120;
select * from db_test.t1_i;
i120 i136 i144 i163
1 00222 0000023456 1.050000000000000000000000000000
I 00222 0000023456 1.050000000000000000000000000000
@ -194,14 +186,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 order by u120;
select * from db_test.t1_u;
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
-------------------------------
@ -214,7 +206,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 order by d120;
select * from db_test.t1_d;
d120 d136 d144 d163
a 00111 0000099999 999.990000000000000000000000000000
c 00333 0000099999 999.990000000000000000000000000000
@ -261,29 +253,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' order by f136;
from tb3 where f122 = 'Test 3.5.8.5-if';
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' order by f136;
from tb3 where f122 = 'Test 3.5.8.5-if';
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' order by f136;
from tb3 where f122 = 'Test 3.5.8.5-if';
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' order by f136;
from tb3 where f122 = 'Test 3.5.8.5-if';
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
@ -343,20 +335,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' order by f120;
from tb3 where f122 = 'Test 3.5.8.5-case';
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' order by f120;
from tb3 where f122 = 'Test 3.5.8.5-case';
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' order by f120;
from tb3 where f122 = 'Test 3.5.8.5-case';
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
@ -366,34 +358,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' order by f120;
from tb3 where f122 = 'Test 3.5.8.5-case';
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' order by f120;
from tb3 where f122 = 'Test 3.5.8.5-case';
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' order by f120;
from tb3 where f122 = 'Test 3.5.8.5-case';
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

View File

@ -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' order by f136;
select f118, f121, f122, f136, f163 from tb3 where f122='Test 3.5.9.3';
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' order by f136;
select f118, f121, f122, f136, f163 from tb3 where f122='Test 3.5.9.3';
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%' order by f163;
where f122 like 'Test 3.5.9.4%';
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 1048 Column 'f136' cannot be null
Warning 1263 Column was set to data type implicit default; NULL supplied for NOT NULL column 'f136' at row 11
select f118, f121, f122, f136, f151, f163 from tb3
where f122 like 'Test 3.5.9.4-trig' order by f163;
where f122 like 'Test 3.5.9.4-trig';
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,

View File

@ -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%' order by f151;
from tb3 where f122 like 'Test 3.5.10.1/2/3%';
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%' order by f151;
where f122 like 'Test 3.5.10.1/2/3%';
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%' order by f151;
where f122 like 'Test 3.5.10.1/2/3%';
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 order by f1 limit 10;
Select * from tb_load 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 order by f1;
select * from t3;
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 order by f1;
select * from t1;
f1
0
1
select * from t2 order by f2;
select * from t2;
f2
2
select * from t3 order by f3;
select * from t3;
f3
3
select * from t4 order by f4;
select * from t4;
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 for column 'f4' at row 1
ERROR 22003: Out of range value adjusted for column 'f4' at row 1
commit;
select * from t1 order by f1;
select * from t1;
f1
1
1
select * from t2 order by f2;
select * from t2;
f2
2
select * from t3 order by f3;
select * from t3;
f3
3
drop trigger tr1;

View File

@ -470,8 +470,7 @@ SET @x=0;
CREATE or REPLACE VIEW v1 AS Select 1 INTO @x;
ERROR HY000: View's SELECT contains a 'INTO' clause
Select @x;
@x
0
ERROR HY000: View's SELECT contains a variable or parameter
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
@ -608,9 +607,7 @@ 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
Testcase 3.3.1.5
--------------------------------------------------------------------------------
ERROR HY000: View's SELECT contains a variable or parameter
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
@ -630,9 +627,7 @@ 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
Testcase 3.3.1.6
--------------------------------------------------------------------------------
ERROR HY000: View's SELECT contains a variable or parameter
DROP VIEW IF EXISTS v1 ;
CREATE or REPLACE VIEW v1
as SELECT * from tb2 limit 100 ;
@ -1817,9 +1812,7 @@ 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 ;
Testcase 3.3.1.40
--------------------------------------------------------------------------------
ERROR HY000: View's SELECT contains a variable or parameter
Drop view if exists test.v1 ;
Set @var1 = 'ABC' ;
Set @var2 = 'XYZ' ;
@ -1828,9 +1821,7 @@ 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 ;
Testcase 3.3.1.41
--------------------------------------------------------------------------------
ERROR HY000: View's SELECT contains a variable or parameter
Drop view if exists test.v1 ;
Drop procedure if exists sp1 ;
Create procedure sp1() DETERMINISTIC
@ -1847,9 +1838,7 @@ Warnings:
Note 1051 Unknown table 'test.v1'
Drop procedure sp1 ;
ERROR 42000: PROCEDURE test.sp1 does not exist
Testcase 3.3.1.42
--------------------------------------------------------------------------------
ERROR HY000: View's SELECT contains a variable or parameter
Drop VIEW if exists test.v1 ;
CREATE TEMPORARY VIEW test.v1 AS
SELECT * FROM test.tb2 limit 2 ;
@ -1861,9 +1850,7 @@ 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;
Testcase 3.3.1.43
--------------------------------------------------------------------------------
ERROR HY000: View's SELECT contains a variable or parameter
Drop view if exists test.v1 ;
CREATE VIEW test.v1 AS SELECT f59,f60 FROM test.tb2;
INSERT INTO test.v1 values(122,432);
@ -1948,7 +1935,7 @@ f1 f2
2 two
4 four
INSERT INTO v1 VALUES(2,'two');
ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
ERROR 23000: Duplicate entry '2' for key 1
INSERT INTO v1 VALUES(3,'three');
affected rows: 1
INSERT INTO v1 VALUES(6,'six');
@ -1967,7 +1954,7 @@ f1 f2
3 three
4 four
UPDATE v1 SET f1 = 2 WHERE f1 = 3;
ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
ERROR 23000: Duplicate entry '2' for key 1
UPDATE v1 SET f2 = 'number' WHERE f1 = 3;
affected rows: 1
info: Rows matched: 1 Changed: 1 Warnings: 0
@ -2014,12 +2001,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 order by f1, f2;
SELECT * FROM t1;
f1 f2
A 1
CREATE VIEW v1 AS SELECT * FROM t1 WHERE f2 BETWEEN 1 AND 2
WITH CASCADED CHECK OPTION ;
SELECT * FROM v1 order by f1, f2;
SELECT * FROM v1;
f1 f2
A 1
UPDATE v1 SET f2 = 2 WHERE f2 = 1;
@ -2027,7 +2014,7 @@ affected rows: 1
info: Rows matched: 1 Changed: 1 Warnings: 0
INSERT INTO v1 VALUES('B',2);
affected rows: 1
SELECT * FROM v1 order by f1, f2;
SELECT * FROM v1;
f1 f2
A 2
B 2
@ -2035,7 +2022,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 order by f1, f2;
SELECT * FROM v1;
f1 f2
A 2
B 2
@ -10575,7 +10562,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 'PRIMARY'
ERROR 23000: Duplicate entry '0' for key 1
SELECT * from t1;
f1 f2 f3 f4
0 ABC NULL NULL
@ -10644,7 +10631,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 'PRIMARY'
ERROR 23000: Duplicate entry '0' for key 1
SELECT * from t1;
f1 f2 f3 f4
0 ABC NULL NULL
@ -10979,11 +10966,11 @@ f1 bigint(20) YES NULL
f2 date YES NULL
f4 char(5) YES NULL
report char(10) YES NULL
SELECT * FROM t1 order by f1, report;
SELECT * FROM t1;
f1 f2 f4 report
-1 NULL ABC t1 0
-1 NULL ABC v1 0
SELECT * FROM v1 order by f1, report;
SELECT * FROM v1;
f1 f2 f4 report
-1 NULL ABC t1 0
-1 NULL ABC v1 0
@ -11003,12 +10990,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 order by f1, report;
SELECT * FROM t1;
f1 f2 f4x report
-1 NULL ABC t1 0
-1 NULL ABC v1 0
0 NULL ABC t1 1
SELECT * FROM v1 order by f1, report;
SELECT * FROM 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
ALTER TABLE t1 CHANGE COLUMN f4x f4 CHAR(5);
ALTER TABLE t1 CHANGE COLUMN f4 f4 CHAR(10);
@ -11026,14 +11013,14 @@ f1 bigint(20) YES NULL
f2 date YES NULL
f4 char(10) YES NULL
report char(10) YES NULL
SELECT * FROM t1 order by f1, report;
SELECT * FROM t1;
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 order by f1, report;
SELECT * FROM v1;
f1 f2 f4 report
-1 NULL ABC t1 0
-1 NULL ABC v1 0
@ -11062,7 +11049,7 @@ f1 bigint(20) YES NULL
f2 date YES NULL
f4 char(8) YES NULL
report char(10) YES NULL
SELECT * FROM t1 order by f1, report;
SELECT * FROM t1;
f1 f2 f4 report
-1 NULL ABC t1 0
-1 NULL ABC v1 0
@ -11071,7 +11058,7 @@ f1 f2 f4 report
2 NULL <-- 10 - v1 2
3 NULL <-- 10 - t1 3
3 NULL <-- 10 - v1 3
SELECT * FROM v1 order by f1, report;
SELECT * FROM v1;
f1 f2 f4 report
-1 NULL ABC t1 0
-1 NULL ABC v1 0
@ -11095,7 +11082,7 @@ f1 bigint(20) YES NULL
f2 date YES NULL
f4 varchar(20) YES NULL
report char(10) YES NULL
SELECT * FROM t1 order by f1, report;
SELECT * FROM t1;
f1 f2 f4 report
-1 NULL ABC t1 0
-1 NULL ABC v1 0
@ -11106,7 +11093,7 @@ f1 f2 f4 report
3 NULL <-- 10 - v1 3
4 NULL <------ 20 --------> t1 4
4 NULL <------ 20 --------> v1 4
SELECT * FROM v1 order by f1, report;
SELECT * FROM v1;
f1 f2 f4 report
-1 NULL ABC t1 0
-1 NULL ABC v1 0
@ -11134,7 +11121,7 @@ f1 varchar(30) YES NULL
f2 date YES NULL
f4 varchar(20) YES NULL
report char(10) YES NULL
SELECT * FROM t1 order by f1, report;
SELECT * FROM t1;
f1 f2 f4 report
-1 NULL ABC t1 0
-1 NULL ABC v1 0
@ -11147,7 +11134,7 @@ f1 f2 f4 report
4 NULL <------ 20 --------> v1 4
<------------- 30 -----------> NULL <------ 20 --------> t1 5
<------------- 30 -----------> NULL <------ 20 --------> v1 5
SELECT * FROM v1 order by f1, report;
SELECT * FROM v1;
f1 f2 f4 report
-1 NULL ABC t1 0
-1 NULL ABC v1 0
@ -11171,7 +11158,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 order by f1, report;
SELECT * FROM t1;
f1 f4 report
-1 ABC t1 0
-1 ABC v1 0
@ -11185,7 +11172,7 @@ f1 f4 report
<------------- 30 -----------> <------ 20 --------> t1 5
<------------- 30 -----------> <------ 20 --------> v1 5
ABC <------ 20 --------> t1 6
SELECT * FROM v1 order by f1, report;
SELECT * FROM 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
ALTER TABLE t1 ADD COLUMN f2 DATE DEFAULT NULL;
INSERT INTO t1 SET f1 = 'ABC', f2 = '1500-12-04',
@ -11204,7 +11191,7 @@ f1 varchar(30) YES NULL
f2 date YES NULL
f4 varchar(20) YES NULL
report char(10) YES NULL
SELECT * FROM t1 order by f1, report;
SELECT * FROM t1;
f1 f4 report f2
-1 ABC t1 0 NULL
-1 ABC v1 0 NULL
@ -11220,7 +11207,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 order by f1, report;
SELECT * FROM v1;
f1 f2 f4 report
-1 NULL ABC t1 0
-1 NULL ABC v1 0
@ -11254,7 +11241,7 @@ f1 varchar(30) YES NULL
f2 float YES NULL
f4 varchar(20) YES NULL
report char(10) YES NULL
SELECT * FROM t1 order by f1, report;
SELECT * FROM t1;
f1 f4 report f2
-1 ABC t1 0 NULL
-1 ABC v1 0 NULL
@ -11269,10 +11256,10 @@ f1 f4 report f2
<------------- 30 -----------> <------ 20 --------> v1 5 NULL
ABC <------ 20 --------> t1 6 NULL
ABC <------ 20 --------> t1 7 NULL
ABC <------ 20 --------> t1 8 -0.00033
ABC <------ 20 --------> v1 7 NULL
ABC <------ 20 --------> t1 8 -0.00033
ABC <------ 20 --------> v1 8 -0.00033
SELECT * FROM v1 order by f1, report;
SELECT * FROM v1;
f1 f2 f4 report
-1 NULL ABC t1 0
-1 NULL ABC v1 0
@ -11287,8 +11274,8 @@ f1 f2 f4 report
<------------- 30 -----------> NULL <------ 20 --------> v1 5
ABC NULL <------ 20 --------> t1 6
ABC NULL <------ 20 --------> t1 7
ABC -0.00033 <------ 20 --------> t1 8
ABC NULL <------ 20 --------> v1 7
ABC -0.00033 <------ 20 --------> t1 8
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,
@ -11311,7 +11298,7 @@ f1 varchar(30) YES NULL
f2 float YES NULL
f4 varchar(20) YES NULL
report char(10) YES NULL
SELECT * FROM t1 order by f1, report;
SELECT * FROM t1;
f1 f4 report f2 f3
-1 ABC t1 0 NULL NULL
-1 ABC v1 0 NULL NULL
@ -11326,12 +11313,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 --------> t1 8 -0.00033 NULL
ABC <------ 20 --------> t1 9 -0.00033 -2.20
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 9a -0.00033 NULL
SELECT * FROM v1 order by f1, report;
SELECT * FROM v1;
f1 f2 f4 report
-1 NULL ABC t1 0
-1 NULL ABC v1 0
@ -11346,10 +11333,10 @@ f1 f2 f4 report
<------------- 30 -----------> NULL <------ 20 --------> v1 5
ABC NULL <------ 20 --------> t1 6
ABC NULL <------ 20 --------> t1 7
ABC -0.00033 <------ 20 --------> t1 8
ABC -0.00033 <------ 20 --------> t1 9
ABC NULL <------ 20 --------> v1 7
ABC -0.00033 <------ 20 --------> t1 8
ABC -0.00033 <------ 20 --------> v1 8
ABC -0.00033 <------ 20 --------> t1 9
ABC -0.00033 <------ 20 --------> v1 9a
DROP TABLE t1;
DROP VIEW v1;
@ -11364,10 +11351,10 @@ DESCRIBE v1;
Field Type Null Key Default Extra
f1 char(10) YES NULL
my_sqrt double YES NULL
SELECT * FROM t1 order by f1, f2;
SELECT * FROM t1;
f1 f2
ABC 3
SELECT * FROM v1 order by 2;
SELECT * FROM v1;
f1 my_sqrt
ABC 1.7320508075689
ALTER TABLE t1 CHANGE COLUMN f2 f2 VARCHAR(30);
@ -11380,21 +11367,21 @@ DESCRIBE v1;
Field Type Null Key Default Extra
f1 char(10) YES NULL
my_sqrt double YES NULL
SELECT * FROM t1 order by f1, f2;
SELECT * FROM t1;
f1 f2
ABC 3
ABC DEF
SELECT * FROM v1 order by 2;
SELECT * FROM v1;
f1 my_sqrt
ABC 0
ABC 1.7320508075689
ABC 0
SELECT SQRT('DEF');
SQRT('DEF')
0
Warnings:
Warning 1292 Truncated incorrect DOUBLE value: 'DEF'
CREATE VIEW v2 AS SELECT SQRT('DEF');
SELECT * FROM v2 order by 1;
SELECT * FROM v2;
SQRT('DEF')
0
Warnings:
@ -11404,27 +11391,27 @@ DESCRIBE v2;
Field Type Null Key Default Extra
f1 char(10) YES NULL
my_sqrt double YES NULL
SELECT * FROM v2 order by 2;
SELECT * FROM v2;
f1 my_sqrt
ABC 0
ABC 1.7320508075689
CREATE TABLE t2 AS SELECT f1, SQRT(f2) my_sqrt FROM t1;
SELECT * FROM t2 order by 2;
f1 my_sqrt
ABC 0
CREATE TABLE t2 AS SELECT f1, SQRT(f2) my_sqrt FROM t1;
SELECT * FROM t2;
f1 my_sqrt
ABC 1.73205080756888
ABC 0
DROP TABLE t2;
CREATE TABLE t2 AS SELECT * FROM v1;
SELECT * FROM t2 order by 2;
SELECT * FROM t2;
f1 my_sqrt
ABC 0
ABC 1.73205080756888
ABC 0
DROP TABLE t2;
CREATE TABLE t2 AS SELECT * FROM v2;
SELECT * FROM t2 order by 2;
SELECT * FROM t2;
f1 my_sqrt
ABC 0
ABC 1.73205080756888
ABC 0
DROP TABLE t1;
DROP TABLE t2;
DROP VIEW v1;

33
mysql-test/suite/funcs_1/storedproc/storedproc_02.inc Normal file → Executable file
View File

@ -209,7 +209,7 @@ BEGIN
set @x = x;
set @y = y;
set @z = 234;
SELECT f1, f2 into @x, @y from t2 where f1='a`' and f2='a`' limit 1;
SELECT f1, f2 into @x, @y from t2 limit 1;
SELECT @x, @y, @z, invar;
BEGIN
set @x = 2;
@ -257,7 +257,7 @@ BEGIN
declare x integer; declare y integer;
set @x=x;
set @y=y;
SELECT f4, f3 into @x, @y from t2 where f4=-5000 and f3='1000-01-01' limit 1;
SELECT f4, f3 into @x, @y from t2 limit 1;
SELECT @x, @y;
END//
delimiter ;//
@ -1271,8 +1271,7 @@ BEGIN
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
where f4 >=-5000 order by f4 limit 3;
declare cur1 cursor for SELECT f1, f2, f4, f5, f6 from t2 limit 3;
open cur1;
while proceed do
SELECT count AS 'loop';
@ -1369,7 +1368,7 @@ create table temp1( f0 char(20), f1 char(20), f2 char(20), f3 int, f4 char(20) )
#Error: 1329 SQLSTATE: 02000 (ER_SP_FETCH_NO_DATA) Message: No data to FETCH
SELECT f1, f2, f4, f5 from t2 order by f4;
SELECT f1, f2, f4, f5 from t2;
delimiter //;
CREATE PROCEDURE sp1( )
@ -1380,21 +1379,21 @@ BEGIN
declare newf2 char(20);
declare newf5 char(20);
declare newf4 integer;
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;
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;
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;
@ -1454,10 +1453,8 @@ BEGIN
declare i_newf12 char(20);
declare i_newf13 date;
declare i_newf14 integer;
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 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 continue handler for sqlstate '02000' set proceed=0;
open cur1;
open cur2;
@ -1489,10 +1486,8 @@ BEGIN
DECLARE o_newf12 CHAR(20);
DECLARE o_newf13 DATE;
DECLARE o_newf14 INTEGER;
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 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 CONTINUE HANDLER FOR SQLSTATE '02000' SET proceed=0;
OPEN cur1;
OPEN cur2;

0
mysql-test/suite/funcs_1/storedproc/storedproc_03.inc Normal file → Executable file
View File

0
mysql-test/suite/funcs_1/storedproc/storedproc_06.inc Normal file → Executable file
View File

0
mysql-test/suite/funcs_1/storedproc/storedproc_07.inc Normal file → Executable file
View File

0
mysql-test/suite/funcs_1/storedproc/storedproc_08.inc Normal file → Executable file
View File

View File

10
mysql-test/suite/funcs_1/storedproc/storedproc_10.inc Normal file → Executable file
View File

@ -54,7 +54,7 @@ connect (user2_1, localhost, user_1, , db_storedproc);
delimiter //;
CREATE PROCEDURE sp31102 () SQL SECURITY INVOKER
BEGIN
SELECT * FROM db_storedproc.t1 WHERE f4=-5000 LIMIT 1;
SELECT * FROM db_storedproc.t1 LIMIT 1;
END//
delimiter ;//
@ -244,21 +244,21 @@ delimiter ;//
CALL sp_ins_1();
SELECT row_count();
SELECT * FROM temp ORDER BY f4;
SELECT * FROM temp;
CALL sp_ins_3();
#FIXME: check is 1 correct here? I expect 3 for 3 inserted rows inside the procedure
SELECT row_count();
SELECT * FROM temp ORDER BY f4;
SELECT * FROM temp;
CALL sp_upd();
SELECT row_count();
SELECT * FROM temp ORDER BY f4;
SELECT * FROM temp;
#FIXME: check is 3 correct here? I expect 7 for 4 inserted and then 3 updated rows inside the procedure
CALL sp_ins_upd();
SELECT row_count();
SELECT * FROM temp ORDER BY f4;
SELECT * FROM temp;
# cleanup
DROP PROCEDURE sp_ins_1;

View File

@ -6,16 +6,19 @@ let $message= .
. IMPORTANT NOTICE:
. -----------------
.
. FIXME: The .result files are still NOT CHECKED for correctness!
. FIXME: The <engine>_storedproc.result files are still NOT CHECKED
. for correctness!
.
. FIXME: Several tests are affected by known problems around DECIMAL
. FIXME: and NUMERIC that will be checked again after WL#2984 once
. FIXME: and NUMERIC that needs to be checked again after WL#2984
. FIXME: has been completed. Some of them are marked in the result.
.
. Currently (Dec 06, 2005) this .result file is checked OK for Linux
. with 5.0.17-bk (ChangeSet@1.1975.1.2, 2005-12-05 18:33:48+01:00).
. Using the available Windows version 5.0.16 there are differences
. that can be ignored (e.g. WL#2984).
. This .result file has been checked OK with Linux 5.0.23-bk,
. ChangeSet@1.2211, 2006-06-28 10:11:43-07:00.
.
. This file has been saved although it might contain failures / wrong
. results to be able to detect _new_ differences in the behaviour.
. Hopefully the remaining checks can be made soon.
.;
--source include/show_msg80.inc
@ -911,7 +914,7 @@ SELECT * from t1 where f2 = f1;
#/t'ql/mysql-test
#t]# t@localhost t
--error 0,1064
#FIXME check this is OK:--error 1064
CREATE PROCEDURE function()
SELECT * from t1 where f2=f1;
DROP PROCEDURE function;
@ -1012,7 +1015,7 @@ CREATE PROCEDURE collate()
CREATE PROCEDURE column()
SELECT * from t1 where f2=f1;
--error 1064
#FIXME check this is OK:--error 1064
CREATE PROCEDURE columns()
SELECT * from t1 where f2=f1;
DROP PROCEDURE columns;
@ -1189,7 +1192,7 @@ CREATE PROCEDURE false()
CREATE PROCEDURE fetch()
SELECT * from t1 where f2=f1;
--error 1064
#FIXME check this is OK:--error 1064
CREATE PROCEDURE fields()
SELECT * from t1 where f2=f1;
DROP PROCEDURE fields;
@ -1210,7 +1213,7 @@ CREATE PROCEDURE force()
CREATE PROCEDURE foreign()
SELECT * from t1 where f2=f1;
--error 1064
#FIXME check this is OK:--error 1064
CREATE PROCEDURE found()
SELECT * from t1 where f2=f1;
DROP PROCEDURE found;
@ -1223,7 +1226,7 @@ CREATE PROCEDURE from()
CREATE PROCEDURE fulltext()
SELECT * from t1 where f2=f1;
--error 1064
#FIXME check this is OK:--error 1064
CREATE PROCEDURE goto()
SELECT * from t1 where f2=f1;
DROP PROCEDURE goto;
@ -1492,7 +1495,7 @@ CREATE PROCEDURE precision()
CREATE PROCEDURE primary()
SELECT * from t1 where f2=f1;
--error 1064
#FIXME check this is OK:--error 1064
CREATE PROCEDURE privileges()
SELECT * from t1 where f2=f1;
DROP PROCEDURE privileges;
@ -1653,7 +1656,7 @@ CREATE PROCEDURE straight_join()
CREATE PROCEDURE table()
SELECT * from t1 where f2=f1;
--error 1064
#FIXME check this is OK:--error 1064
CREATE PROCEDURE tables()
SELECT * from t1 where f2=f1;
DROP PROCEDURE tables;
@ -1834,7 +1837,7 @@ CREATE FUNCTION char ascii not null(f1 char ascii not null) returns char ascii n
CREATE FUNCTION tinytext(f1 tinytext) returns tinytext
return f1;
--error 1064
#FIXME check this is OK:--error 1064
CREATE FUNCTION text(f1 text) returns text
return f1;
DROP FUNCTION text;
@ -10125,7 +10128,7 @@ DROP PROCEDURE IF EXISTS sp1;
--enable_warnings
delimiter //;
#FIXME check this is OK:--error 1064
--error 1064
CREATE PROCEDURE sp1()
BEGIN
declare precision char;
@ -10427,7 +10430,7 @@ delimiter ;//
DROP PROCEDURE IF EXISTS sp1;
delimiter //;
#FIXME check this is OK:--error 1064
--error 1064
CREATE PROCEDURE sp1()
BEGIN
declare soname char;

0
mysql-test/suite/funcs_1/t/innodb_storedproc_02.test Normal file → Executable file
View File

0
mysql-test/suite/funcs_1/t/innodb_storedproc_03.test Normal file → Executable file
View File

0
mysql-test/suite/funcs_1/t/innodb_storedproc_06.test Normal file → Executable file
View File

0
mysql-test/suite/funcs_1/t/innodb_storedproc_07.test Normal file → Executable file
View File

0
mysql-test/suite/funcs_1/t/innodb_storedproc_08.test Normal file → Executable file
View File

0
mysql-test/suite/funcs_1/t/innodb_storedproc_10.test Normal file → Executable file
View File

0
mysql-test/suite/funcs_1/t/memory_storedproc_02.test Normal file → Executable file
View File

0
mysql-test/suite/funcs_1/t/memory_storedproc_03.test Normal file → Executable file
View File

0
mysql-test/suite/funcs_1/t/memory_storedproc_06.test Normal file → Executable file
View File

0
mysql-test/suite/funcs_1/t/memory_storedproc_07.test Normal file → Executable file
View File

0
mysql-test/suite/funcs_1/t/memory_storedproc_08.test Normal file → Executable file
View File

0
mysql-test/suite/funcs_1/t/memory_storedproc_10.test Normal file → Executable file
View File

0
mysql-test/suite/funcs_1/t/myisam_storedproc_02.test Normal file → Executable file
View File

0
mysql-test/suite/funcs_1/t/myisam_storedproc_03.test Normal file → Executable file
View File

0
mysql-test/suite/funcs_1/t/myisam_storedproc_06.test Normal file → Executable file
View File

0
mysql-test/suite/funcs_1/t/myisam_storedproc_07.test Normal file → Executable file
View File

0
mysql-test/suite/funcs_1/t/myisam_storedproc_08.test Normal file → Executable file
View File

0
mysql-test/suite/funcs_1/t/myisam_storedproc_10.test Normal file → Executable file
View File

View File

@ -214,29 +214,21 @@ let $message= Testcase 3.5.1.7: - need to fix;
eval create table t1 (f1 int, f2 char(25),f3 int) engine=$engine_type;
CREATE TRIGGER trg5_1 BEFORE INSERT on test.t1
for each row set new.f3 = '14';
# In 5.0 names to long (more than 64 chars) were trimed without an error
# In 5.1 an error is returned. So adding a call with the expected error
# and one with a shorter name to validate proper execution
--error 1059
CREATE TRIGGER trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ
BEFORE UPDATE on test.t1 for each row set new.f3 = '42';
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;
update t1 set f2='update 3.5.1.7';
select * from t1;
select trigger_name from information_schema.triggers order by trigger_name;
select trigger_name from information_schema.triggers;
#Cleanup
--disable_warnings
--error 0, 1360
drop trigger trg5_1;
# In 5.1 the long name should generate an error that is to long
--error 1059
# The above trigger should be dropped since the name was trimmed.
drop trigger trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ;
drop trigger trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWX;
drop table t1;
#Section 3.5.1.8
@ -393,10 +385,10 @@ let $message= Testcase 3.5.1.11:;
insert into trig_db2.t2 (f1,f2) values ('insert to db2 t2 from db1',3);
insert into trig_db3.t1 (f1,f2) values ('insert to db3 t1 from db1',4);
select @test_var1, @test_var2, @test_var3;
select * from t1 order by f2;
select * from t1;
select * from trig_db2.t2;
select * from trig_db3.t1;
select * from t1 order by f2;
select * from t1;
use test;
#Cleanup
@ -442,7 +434,7 @@ let $message= Testcase 3.5.2.1/2/3:;
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 order by trigger_name;
from information_schema.triggers;
set @test_var1= '', @test_var2= '', @test_var3= '';
insert into t1 (f1,f2) values ('insert to db1 t1 from db1',352);

View File

@ -29,23 +29,23 @@ let $message= Testcase 3.5.3:;
set password for test_yesprivs@localhost = password('PWD');
#Section 3.5.3.1 / 3.5.3.2
# Test case: Ensure TRIGGER privilege is required to create a trigger
# Test case: Ensure SUPER privilege is required to create a trigger
#Section 3.5.3.3 / 3.5.3.4
# Test case: Ensure that root always has the TRIGGER privilege.
# Test case: Ensure that root always has the SUPER privilege.
# OMR - No need to test this since SUPER priv is an existing one and not related
# or added for triggers (TP 2005-06-06)
#Section 3.5.3.5 / 3.5.3.6
# Test case: Ensure that the TRIGGER privilege is required to drop a trigger.
# Test case: Ensure that the SUPER privilege is required to drop a trigger.
let $message= Testcase 3.5.3.2/6:;
--source include/show_msg.inc
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
grant ALL on *.* to test_noprivs@localhost;
revoke TRIGGER on *.* from test_noprivs@localhost;
revoke SUPER on *.* from test_noprivs@localhost;
show grants for test_noprivs@localhost;
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant SUPER on *.* to test_yesprivs@localhost;
# Adding the minimal priv to be able to set to the db
grant SELECT on priv_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
@ -63,15 +63,14 @@ let $message= Testcase 3.5.3.2:;
select current_user;
use priv_db;
# error 1227 is better, as it says, that not the privilege
--error 1142,1227
--error 1227
create trigger trg1_1 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.2_1-no';
connection default;
use priv_db;
insert into t1 (f1) values ('insert 3.5.3.2-no');
select f1 from t1 order by f1;
select f1 from t1;
connection yes_privs;
select current_user;
@ -84,27 +83,29 @@ let $message= Testcase 3.5.3.2:;
select current_user;
use priv_db;
--error 1143
# Added following the fix to bug 5861
--error 1143
insert into t1 (f1) values ('insert 3.5.3.2-yes');
select f1 from t1 order by f1;
grant UPDATE on priv_db.t1 to test_yesprivs@localhost;
insert into t1 (f1) values ('insert 3.5.3.2-yes');
select f1 from t1 order by f1;
select f1 from t1;
grant UPDATE on priv_db.t1 to test_yesprivs@localhost;
let $message= note: once 15166 is fixed a similar case for SELECT needs to be added;
--source include/show_msg.inc
insert into t1 (f1) values ('insert 3.5.3.2-yes');
select f1 from t1;
let $message= Testcase 3.5.3.6:;
--source include/show_msg.inc
connection no_privs;
use priv_db;
--error 1142,1227
--error 1227
drop trigger trg1_2;
connection default;
use priv_db;
insert into t1 (f1) values ('insert 3.5.3.6-yes');
select f1 from t1 order by f1;
select f1 from t1;
connection yes_privs;
use priv_db;
@ -114,7 +115,7 @@ let $message= Testcase 3.5.3.6:;
connection default;
use priv_db;
insert into t1 (f1) values ('insert 3.5.3.6-no');
select f1 from t1 order by f1;
select f1 from t1;
# Cleanup
--disable_warnings
@ -143,7 +144,7 @@ let $message=Testcase 3.5.3.7a:;
show grants for test_noprivs@localhost;
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER, UPDATE on *.* to test_yesprivs@localhost;
grant SUPER, UPDATE on *.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
--replace_result $MASTER_MYPORT MASTER_MYPORT $MASTER_MYSOCK MASTER_MYSOCK
@ -155,7 +156,7 @@ let $message=Testcase 3.5.3.7a:;
select current_user;
use priv_db;
show grants;
select f1 from t1 order by f1;
select f1 from t1;
let $message= Trigger create disabled - should fail - Bug 8884;
--source include/show_msg.inc
@ -165,7 +166,7 @@ let $message= Trigger create disabled - should fail - Bug 8884;
connection default;
insert into t1 (f1) values ('insert 3.5.3.7-1a');
select f1 from t1 order by f1;
select f1 from t1;
--error 0, 1360
drop trigger trg4a_1;
@ -178,8 +179,14 @@ let $message= Trigger create disabled - should fail - Bug 8884;
connection default;
# Added to bypass bug 15166
let $message= SELECT priv added to bypass bug 15166;
--source include/show_msg.inc
grant SELECT on *.* to test_yesprivs@localhost;
insert into t1 (f1) values ('insert 3.5.3.7-2b');
select f1 from t1 order by f1;
select f1 from t1;
# Cleanup
--disable_warnings
@ -193,13 +200,13 @@ let $message= Testcase 3.5.3.7b:;
--source include/show_msg.inc
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
grant TRIGGER on *.* to test_noprivs;
grant SUPER on *.* to test_noprivs;
grant ALL on priv_db.* to test_noprivs@localhost;
revoke UPDATE on priv_db.* from test_noprivs@localhost;
show grants for test_noprivs;
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant SUPER on *.* to test_yesprivs@localhost;
grant UPDATE on priv_db.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
@ -221,9 +228,9 @@ let $message= Trigger create disabled - should fail - Bug 8884;
connection default;
insert into t1 (f1) values ('insert 3.5.3.7-1b');
select f1 from t1 order by f1;
select f1 from t1;
update t1 set f1 = 'update 3.5.3.7-1b' where f1 = 'insert 3.5.3.7-1b';
select f1 from t1 order by f1;
select f1 from t1;
--error 0, 1360
drop trigger trg4b_1;
@ -235,10 +242,15 @@ let $message= Trigger create disabled - should fail - Bug 8884;
connection default;
# Added to bypass bug 15166
let $message= SELECT priv added to bypass bug 15166;
--source include/show_msg.inc
grant SELECT on priv_db.* to test_yesprivs@localhost;
insert into t1 (f1) values ('insert 3.5.3.7-2b');
select f1 from t1 order by f1;
select f1 from t1;
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;
select f1 from t1;
# Cleanup
--disable_warnings
drop trigger trg4b_2;
@ -251,13 +263,13 @@ let $message= Testcase 3.5.3.7c;
--source include/show_msg.inc
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
grant TRIGGER on *.* to test_noprivs@localhost;
grant SUPER on *.* to test_noprivs@localhost;
grant ALL on priv_db.t1 to test_noprivs@localhost;
revoke UPDATE on priv_db.t1 from test_noprivs@localhost;
show grants for test_noprivs;
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant SUPER on *.* to test_yesprivs@localhost;
grant UPDATE on priv_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
@ -279,7 +291,7 @@ let $message= Trigger create disabled - should fail - Bug 8884;
connection default;
insert into t1 (f1) values ('insert 3.5.3.7-1c');
select f1 from t1 order by f1;
select f1 from t1;
--error 0, 1360
drop trigger trg4c_1;
@ -291,8 +303,13 @@ let $message= Trigger create disabled - should fail - Bug 8884;
connection default;
# Added to bypass bug 15166
let $message= SELECT priv added to bypass bug 15166;
--source include/show_msg.inc
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 order by f1;
select f1 from t1;
# Cleanup
--disable_warnings
@ -308,13 +325,13 @@ let $message= Testcase 3.5.3.7d:;
--source include/show_msg.inc
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
grant TRIGGER on *.* to test_noprivs@localhost;
grant SUPER on *.* to test_noprivs@localhost;
# There is no ALL privs on the column level
grant SELECT (f1), INSERT (f1) on priv_db.t1 to test_noprivs@localhost;
show grants for test_noprivs;
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant SUPER on *.* to test_yesprivs@localhost;
grant UPDATE (f1) on priv_db.t1 to test_yesprivs@localhost;
show grants for test_noprivs;
@ -335,7 +352,7 @@ let $message= Trigger create disabled - should fail - Bug 8884;
connection default;
insert into t1 (f1) values ('insert 3.5.3.7-1d');
select f1 from t1 order by f1;
select f1 from t1;
--error 0, 1360
drop trigger trg4d_1;
@ -347,8 +364,13 @@ let $message= Trigger create disabled - should fail - Bug 8884;
connection default;
# Added to bypass bug 15166
let $message= SELECT priv added to bypass bug 15166;
--source include/show_msg.inc
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 order by f1;
select f1 from t1;
# Cleanup
--disable_warnings
@ -372,7 +394,7 @@ let $message= Testcase 3.5.3.8a:;
show grants for test_noprivs@localhost;
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER, SELECT on *.* to test_yesprivs@localhost;
grant SUPER, SELECT on *.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
--replace_result $MASTER_MYPORT MASTER_MYPORT $MASTER_MYSOCK MASTER_MYSOCK
@ -411,6 +433,11 @@ let $message= Trigger create disabled - should fail - Bug 8887;
set @test_var= 'before trig 3.5.3.8-2a';
select @test_var;
# Added to bypass bug 15166
let $message= UPDATE priv added to bypass bug 15166;
--source include/show_msg.inc
grant UPDATE on *.* to test_yesprivs@localhost;
insert into t1 (f1) values ('insert 3.5.3.8-2a');
select @test_var;
@ -426,13 +453,13 @@ let $message= Testcase: 3.5.3.8b;
--source include/show_msg.inc
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
grant TRIGGER on *.* to test_noprivs@localhost;
grant SUPER 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;
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant SUPER on *.* to test_yesprivs@localhost;
grant SELECT on priv_db.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
@ -472,6 +499,11 @@ let $message= Trigger create disabled - should fail - Bug 8887;
insert into t1 (f1) values ('insert 3.5.3.8-2b');
select @test_var;
# Added to bypass bug 15166
let $message= UPDATE priv added to bypass bug 15166;
--source include/show_msg.inc
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;
# Cleanup
@ -486,13 +518,13 @@ let $message= Testcase 3.5.3.8c:;
--source include/show_msg.inc
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
grant TRIGGER on *.* to test_noprivs@localhost;
grant SUPER 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;
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant SUPER on *.* to test_yesprivs@localhost;
grant SELECT on priv_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
@ -528,6 +560,11 @@ let $message= Trigger create disabled - should fail - Bug 8887;
connection default;
set @test_var='before trig 3.5.3.8-2c';
# Added to bypass bug 15166
let $message= UPDATE priv added to bypass bug 15166;
--source include/show_msg.inc
grant UPDATE on priv_db.t1 to test_yesprivs@localhost;
insert into t1 (f1) values ('insert 3.5.3.8-2c');
select @test_var;
# Cleanup
@ -542,13 +579,13 @@ let $message=Testcase: 3.5.3.8d:;
--source include/show_msg.inc
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
grant TRIGGER on *.* to test_noprivs@localhost;
grant SUPER on *.* to test_noprivs@localhost;
# There is no ALL prov on the column level
grant UPDATE (f1), INSERT (f1) on priv_db.t1 to test_noprivs@localhost;
show grants for test_noprivs@localhost;
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant SUPER on *.* to test_yesprivs@localhost;
grant SELECT (f1) on priv_db.t1 to test_yesprivs@localhost;
show grants for test_noprivs@localhost;
@ -583,6 +620,11 @@ let $message= Trigger create disabled - should fail - Bug 8887;
connection default;
set @test_var='before trig 3.5.3.8-2d';
# Added to bypass bug 15166
let $message= UPDATE priv added to bypass bug 15166;
--source include/show_msg.inc
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;
@ -608,7 +650,7 @@ let $message=Testcase: 3.5.3.x:;
eval create table t2 (f2 int) engine= $engine_type;
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant SUPER 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;
@ -629,8 +671,8 @@ let $message=Testcase: 3.5.3.x:;
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 order by f1;
select f2 from t2 order by f2;
select f1 from t1;
select f2 from t2;
connection yes_353x;
use priv_db;
@ -645,8 +687,8 @@ let $message=Testcase: 3.5.3.x:;
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 order by f1;
select f2 from t2 order by f2;
select f1 from t1;
select f2 from t2;
connection yes_353x;
use priv_db;
@ -661,8 +703,8 @@ let $message=Testcase: 3.5.3.x:;
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 order by f1;
select f2 from t2 order by f2;
select f1 from t1;
select f2 from t2;
select @aaa;
connection yes_353x;
@ -678,8 +720,8 @@ let $message=Testcase: 3.5.3.x:;
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 order by f1;
select f2 from t2 order by f2;
select f1 from t1;
select f2 from t2;

View File

@ -51,14 +51,14 @@ let $message= Testcase 3.5.4.1:;
connection con1_general;
Use db_drop;
Insert into t1 values ('Insert error 3.5.4.1');
Select * from t1 order by f1;
Select * from t1;
connection con1_super;
drop trigger trg1;
select trigger_schema, trigger_name, event_object_table
from information_schema.triggers order by trigger_name;
from information_schema.triggers;
connection con1_general;
Insert into t1 values ('Insert no trigger 3.5.4.1');
Select * from t1 order by f1;
Select * from t1;
#Cleanup
--disable_warnings
@ -294,7 +294,7 @@ let $message= Testcase 3.5.5.4:;
Select * from t2;
use dbtest_one;
Insert into dbtest_two.t2 values ('2nd Insert 3.5.5.4');
Select * from dbtest_two.t2 order by f1;
Select * from dbtest_two.t2;
#Cleanup
connection con1_super;
@ -535,7 +535,7 @@ let $message= Testcase 3.5.7.13/14:;
Create trigger trg9_1 BEFORE DELETE
on tb3 for each row set @test_var=@test_var+1;
--error ER_NOT_SUPPORTED_YET
--error ER_NOT_SUPPORTED_YET
Create trigger trg9_2 BEFORE DELETE
on tb3 for each row set @test_var=@test_var+10;

View File

@ -111,10 +111,9 @@ let $message= 3.5.8.4 - multiple SQL;
Insert into tb3 (f120, f122, f136, f144, f163)
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';
# error in ndb
select * from db_test.t1_i order by i120;
select * from db_test.t1_u order by u120;
select * from db_test.t1_d order by d120;
select * from db_test.t1_i;
select * from db_test.t1_u;
select * from db_test.t1_d;
select @test_var;
@ -122,22 +121,16 @@ let $message= 3.5.8.4 - single SQL - insert;
--source include/show_msg.inc
# Trigger definition - single SQL Insert
connection con2_super;
delimiter //;
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//
delimiter ;//
# Trigger exeution - single SQL Insert
connection con2_general;
Select f120, f122, f136, f144, f163 from tb3 where f122 like 'Test 3.5.8.4%';
select * from db_test.t1_i order by i120;
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%';
select * from db_test.t1_i order by i120;
select * from db_test.t1_i;
let $message= 3.5.8.4 - single SQL - update;
@ -155,7 +148,7 @@ let $message= 3.5.8.4 - single SQL - update;
update tb3 set f120='U', f122='Test 3.5.8.4-Single Update'
where f122='Test 3.5.8.4-Single Insert';
Select f120, f122, f136, f144, f163 from tb3 where f122 like 'Test 3.5.8.4%';
select * from db_test.t1_u order by u120;
select * from db_test.t1_u;
let $message= 3.5.8.3/4 - single SQL - delete;
@ -174,7 +167,7 @@ let $message= 3.5.8.3/4 - single SQL - delete;
where f122='Test 3.5.8.4-Single Update';
#unlock tables;
Select f120, f122, f136, f144, f163 from tb3 where f122 like 'Test 3.5.8.4%';
select * from db_test.t1_d order by d120;
select * from db_test.t1_d;
let $message= 3.5.8.3/4 - single SQL - select;
@ -235,16 +228,16 @@ let $message= Testcase 3.5.8.5 (IF):;
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' order by f136;
from tb3 where f122 = 'Test 3.5.8.5-if';
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' order by f136;
from tb3 where f122 = 'Test 3.5.8.5-if';
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' order by f136;
from tb3 where f122 = 'Test 3.5.8.5-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' order by f136;
from tb3 where f122 = 'Test 3.5.8.5-if';
delimiter //;
--error 1064
@ -320,28 +313,28 @@ let $message= Testcase 3.5.8.5-case:;
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' order by f120;
from tb3 where f122 = 'Test 3.5.8.5-case';
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' order by f120;
from tb3 where f122 = 'Test 3.5.8.5-case';
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' order by f120;
from tb3 where f122 = 'Test 3.5.8.5-case';
Insert into tb3 (f120, f122, f136)
values ('d', 'Test 3.5.8.5-case', 152);
select f120, f122, f136, f144, @test_var
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
from tb3 where f122 = 'Test 3.5.8.5-case';
Insert into tb3 (f120, f122, f136, f144)
values ('e', 'Test 3.5.8.5-case', 200, 8);
select f120, f122, f136, f144, @test_var
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
from tb3 where f122 = 'Test 3.5.8.5-case';
--error 0, 1339
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' order by f120;
from tb3 where f122 = 'Test 3.5.8.5-case';
delimiter //;
--error 1064

View File

@ -85,7 +85,7 @@ let $message= Testcase 3.5.9.3:;
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' order by f136;
select f118, f121, f122, f136, f163 from tb3 where f122='Test 3.5.9.3';
select @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122,
@tr_var_b4_136, @tr_var_b4_163;
select @tr_var_af_118, @tr_var_af_121, @tr_var_af_122,
@ -104,7 +104,7 @@ let $message= Testcase 3.5.9.3:;
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' order by f136;
select f118, f121, f122, f136, f163 from tb3 where f122='Test 3.5.9.3';
select @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122,
@tr_var_b4_136, @tr_var_b4_163;
select @tr_var_af_118, @tr_var_af_121, @tr_var_af_122,
@ -159,7 +159,7 @@ let $message= Testcase 3.5.9.4:;
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%' order by f163;
where f122 like 'Test 3.5.9.4%';
select @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122,
@tr_var_b4_136, @tr_var_b4_151, @tr_var_b4_163;
select @tr_var_af_118, @tr_var_af_121, @tr_var_af_122,
@ -180,7 +180,7 @@ let $message= Testcase 3.5.9.4:;
where f122='Test 3.5.9.4';
select f118, f121, f122, f136, f151, f163 from tb3
where f122 like 'Test 3.5.9.4-trig' order by f163;
where f122 like 'Test 3.5.9.4-trig';
select @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122,
@tr_var_b4_136, @tr_var_b4_151, @tr_var_b4_163;
select @tr_var_af_118, @tr_var_af_121, @tr_var_af_122,

View File

@ -48,7 +48,7 @@ let $message= Testcase 3.5.10.1/2/3:;
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%' order by f151;
from tb3 where f122 like 'Test 3.5.10.1/2/3%';
select f121, f122, f151, f163 from vw11;
select f121, f122, f151, f163
from tb3 where f122 like 'Not in View';
@ -56,7 +56,7 @@ let $message= Testcase 3.5.10.1/2/3:;
#Section 3.5.10.2
Update vw11 set f163=1;
select f121, f122, f151, f163 from tb3
where f122 like 'Test 3.5.10.1/2/3%' order by f151;
where f122 like 'Test 3.5.10.1/2/3%';
select f121, f122, f151, f163 from vw11;
#Section 3.5.10.3
@ -64,7 +64,7 @@ let $message= Testcase 3.5.10.1/2/3:;
Select @test_var as 'before delete';
delete from vw11 where f151=1;
select f121, f122, f151, f163 from tb3
where f122 like 'Test 3.5.10.1/2/3%' order by f151;
where f122 like 'Test 3.5.10.1/2/3%';
select f121, f122, f151, f163 from vw11;
Select @test_var as 'after delete';
@ -98,7 +98,7 @@ let $message= Testcase 3.5.10.4:;
eval load data infile '$MYSQL_TEST_DIR/suite/funcs_1/data/t9.txt' into table tb_load;
select @counter as 'Rows Loaded After';
Select * from tb_load order by f1 limit 10;
Select * from tb_load limit 10;
#Cleanup
--disable_warnings
@ -233,7 +233,7 @@ let $message= Testcase y.y.y.2: Check for triggers starting triggers;
#lock tables t1 write, t2_1 write, t2_2 write, t2_3 write, t2_4 write, t3 write;
insert into t1 values (1);
#unlock tables;
select * from t3 order by f1;
select * from t3;
#Cleanup
--disable_warnings
@ -274,10 +274,10 @@ let $message= Testcase y.y.y.3: Circular trigger reference;
# OBN See bug 11896
--error 1442
insert into t1 values (1);
select * from t1 order by f1;
select * from t2 order by f2;
select * from t3 order by f3;
select * from t4 order by f4;
select * from t1;
select * from t2;
select * from t3;
select * from t4;
#Cleanup
--disable_warnings
@ -384,9 +384,9 @@ let $message= Testcase y.y.y.5: Roleback of nested trigger references;
--error 1264
insert into t1 values (1);
commit;
select * from t1 order by f1;
select * from t2 order by f2;
select * from t3 order by f3;
select * from t1;
select * from t2;
select * from t3;
#unlock tables;
#Cleanup
--disable_warnings

View File

@ -3,8 +3,7 @@
# Functions within VIEWs #
# #
###################################################
# 2006-12-08 ML Maintenance + refinements
# 2005-09-14 ML Create this test
# 14.09.2005 ML
let $message= ! Attention: The file with the expected results suffers from
Bug#10713: mysqldump includes database in create view and referenced tables;
@ -69,7 +68,7 @@ Bug#10713: mysqldump includes database in create view and referenced tables;
# But there will be a special messages within the protocol files.
# Example:
# "Attention: CAST --> SIGNED INTEGER
# The file with expected results suffers from Bug 5913";
# The file with expected results suffers from Bug 5083 5913 9809";
# means, the file with expected results contains result sets which
# are known to be wrong.
# "Attention: The last <whatever> failed"
@ -188,7 +187,6 @@ CREATE TABLE t1_modes
--enable_query_log
# The table to be used in the FROM parts of the SELECTs
--replace_result $type <engine_to_be_tested>
eval CREATE TABLE t1_values
(
id BIGINT AUTO_INCREMENT,
@ -418,8 +416,8 @@ eval INSERT INTO t1_values SET select_id = @select_id,
$col_type = -25;
# SELECT * FROM t1_values;
# 1. Cast Functions and Operators
# 1.1 CAST
# 1. Cast Functions and Operators
# 1.1. CAST
#
# Note(ML): I guess the CAST routines are used in many other functions.
# Therefore check also nearly all "ugly" variants like
@ -589,10 +587,15 @@ let $col_type= my_bigint;
eval INSERT INTO t1_values SET select_id = @select_id,
$col_type = 1758;
let $col_type= my_double;
# Bug#12440: CAST(data type DOUBLE AS TIME) strange results;
let $message= some statements disabled because of
Bug#12440: CAST(data type DOUBLE AS TIME) strange results;
--source include/show_msg80.inc
if (0)
{
--source suite/funcs_1/views/fv_cast.inc
eval INSERT INTO t1_values SET select_id = @select_id,
$col_type = +1.758E+3;
}
let $col_type= my_datetime;
--source suite/funcs_1/views/fv_cast.inc
let $col_type= my_date;
@ -628,11 +631,16 @@ let $col_type= my_bigint;
--source suite/funcs_1/views/fv_cast.inc
let $col_type= my_decimal;
--source suite/funcs_1/views/fv_cast.inc
# Bug#13349: CAST(1.0E+300 TO DECIMAL) returns wrong result + diff little/big endian;
let $message= some statements disabled because of
Bug#13349: CAST(1.0E+300 TO DECIMAL) returns wrong result + diff little/big endian;
--source include/show_msg80.inc
if (0)
{
let $col_type= my_double;
--source suite/funcs_1/views/fv_cast.inc
eval INSERT INTO t1_values SET select_id = @select_id,
$col_type = -0.33333333E+4;
}
let $col_type= my_datetime;
--source suite/funcs_1/views/fv_cast.inc
let $col_type= my_date;
@ -650,8 +658,11 @@ let $target_type= SIGNED INTEGER;
#
let $message=
"Attention: CAST --> SIGNED INTEGER
The file with expected results suffers from
Bug#5083 Big integer values are inserted as negative into
decimal/string columns
Bug#5913 Traditional mode: BIGINT range not correctly delimited
Status: To be fixed later";
Both have the status: To be fixed later";
--source include/show_msg80.inc
let $col_type= my_char_30;
--source suite/funcs_1/views/fv_cast.inc
@ -665,9 +676,14 @@ let $col_type= my_bigint;
--source suite/funcs_1/views/fv_cast.inc
let $col_type= my_decimal;
--source suite/funcs_1/views/fv_cast.inc
# Bug #13344: CAST(1E+300 TO signed int) on little endian CPU, wrong result;
let $message= some statements disabled because of
Bug #13344: CAST(1E+300 TO signed int) on little endian CPU, wrong result;
--source include/show_msg80.inc
if (0)
{
let $col_type= my_double;
--source suite/funcs_1/views/fv_cast.inc
}
let $col_type= my_datetime;
--source suite/funcs_1/views/fv_cast.inc
let $col_type= my_date;
@ -685,7 +701,7 @@ let $target_type= UNSIGNED INTEGER;
#
let $message=
"Attention: CAST --> UNSIGNED INTEGER
The file with expected results suffers from Bug 5913";
The file with expected results suffers from Bug 5083 5913 9809";
--source include/show_msg80.inc
let $col_type= my_char_30;
--source suite/funcs_1/views/fv_cast.inc
@ -700,11 +716,10 @@ let $col_type= my_bigint;
let $col_type= my_decimal;
--source suite/funcs_1/views/fv_cast.inc
let $message= some statements disabled because of
Bug#5913 Traditional mode: BIGINT range not correctly delimited;
Bugs#8663: cant use bgint unsigned as input to cast;
--source include/show_msg80.inc
if (0)
{
# Bugs#8663: cant use bgint unsigned as input to cast
let $col_type= my_double;
--source suite/funcs_1/views/fv_cast.inc
}
@ -832,6 +847,11 @@ let $col_type= my_year;
# select if(isnull(`test`.`t1`.`f1`),_latin1'IS NULL',
# _latin1'IS NOT NULL'),...
#
let $message=
"Attention: IF($col_type IS NULL, ...
The file with expected results suffers from
Bug#11689. successful CREATE VIEW but SELECT on view fails.";
--source include/show_msg80.inc
# Bug#11689 success on Create view .. IF(col1 IS NULL,...), col2 ; but SELECT fails
let $col_type= my_char_30;
--source suite/funcs_1/views/fv_if2.inc
@ -1010,7 +1030,7 @@ eval SET @my_select =
#
let $message=
"Attention: LEFT(''AaBbCcDdEeFfGgHhIiJjÄäÜüÖö'', <numeric column>)
The file with expected results suffers from Bug 10963"
The file with expected results suffers from Bug 10963 11728"
and the testcases with length = BIGINT or DOUBLE column are deactivated,
because there are 32/64 Bit differences;
--source include/show_msg80.inc
@ -1064,10 +1084,8 @@ $col_type, id FROM t1_values';
# If the file doesn't exist or cannot be read ... ,
# the function returns NULL.
# SELECT LOADFILE
# Prepare a file:
SELECT 'äÄ@' INTO OUTFILE '../tmp/func_view.dat';
eval SET @my_select =
'SELECT LOAD_FILE(''../tmp/func_view.dat''), id FROM t1_values';
'SELECT LOAD_FILE(''../log/current_test''), id FROM t1_values';
--source suite/funcs_1/views/fv1.inc
@ -1291,13 +1309,14 @@ while ($select_id)
--disable_query_log
eval set @got_errno= $mysql_errno ;
let $run0= `SELECT @got_errno = 0`;
--enable_query_log
if (!$run0)
let $print_warning= `SELECT @got_errno`;
if ($print_warning)
{
--echo
--echo Attention: The last CREATE VIEW failed
--echo
SELECT 'Attention: The last CREATE VIEW failed ' AS ""
UNION
SELECT '' ;
}
--enable_query_log
}
# FIXME The loop over the modes will start here.
@ -1311,17 +1330,21 @@ while ($select_id)
--disable_result_log
}
eval $my_select
WHERE select_id = $select_id OR select_id IS NULL order by id;
WHERE select_id = $select_id OR select_id IS NULL;
if ($run_no_result)
{
--enable_result_log
}
if ($mysql_errno)
--disable_query_log
eval set @got_errno= $mysql_errno ;
let $print_warning= `SELECT @got_errno`;
if ($print_warning)
{
--echo
--echo Attention: The last SELECT on the base table failed
--echo
SELECT 'Attention: The last SELECT on the base table failed' AS ""
UNION
SELECT '' ;
}
--enable_query_log
}
# $run0 is 1, if CREATE VIEW was successful.
@ -1330,12 +1353,16 @@ while ($select_id)
{
# Check the CREATE VIEW statement
SHOW CREATE VIEW v1;
if ($mysql_errno)
--disable_query_log
eval set @got_errno= $mysql_errno ;
let $print_warning= `SELECT @got_errno`;
if ($print_warning)
{
--echo
--echo Attention: The last SHOW CREATE VIEW failed
--echo
SELECT 'Attention: The last SHOW CREATE VIEW failed' AS ""
UNION
SELECT '' ;
}
--enable_query_log
# Maybe a Join is faster
if ($run_no_result)
@ -1344,17 +1371,21 @@ while ($select_id)
}
eval SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = $select_id OR select_id IS NULL) order by id;
WHERE select_id = $select_id OR select_id IS NULL);
if ($run_no_result)
{
--enable_result_log
}
if ($mysql_errno)
--disable_query_log
eval set @got_errno= $mysql_errno ;
let $print_warning= `SELECT @got_errno`;
if ($print_warning)
{
--echo
--echo Attention: The last SELECT from VIEW failed
--echo
SELECT 'Attention: The last SELECT from VIEW failed' AS ""
UNION
SELECT '' ;
}
--enable_query_log
DROP VIEW v1;
}
@ -1363,11 +1394,11 @@ while ($select_id)
# Produce two empty lines as separator between different SELECTS
# to be tested.
--echo
--echo
--disable_query_log
SELECT '' AS "";
--enable_query_log
dec $select_id ;
}
DROP TABLE t1_selects, t1_modes, t1_values;
--exec rm $MYSQLTEST_VARDIR/tmp/func_view.dat

View File

@ -1772,7 +1772,7 @@ SELECT * FROM v1 ORDER BY f1;
--enable_info
# 1. The record to be inserted will be within the scope of the view.
# But there is already a record with the PRIMARY KEY f1 = 2 .
--error ER_DUP_ENTRY_WITH_KEY_NAME
--error 1062
INSERT INTO v1 VALUES(2,'two');
# 2. The record to be inserted will be within the scope of the view.
# There is no already existing record with the PRIMARY KEY f1 = 3 .
@ -1789,7 +1789,7 @@ SELECT * FROM v1 ORDER BY f1;
# 1. The record to be updated is within the scope of the view
# and will stay inside the scope.
# But there is already a record with the PRIMARY KEY f1 = 2 .
--error ER_DUP_ENTRY_WITH_KEY_NAME
--error 1062
UPDATE v1 SET f1 = 2 WHERE f1 = 3;
# 2. The record to be updated is within the scope of the view
# and will stay inside the scope.
@ -1873,11 +1873,11 @@ DROP VIEW IF EXISTS test.v1;
eval CREATE TABLE t1 (f1 ENUM('A', 'B', 'C') NOT NULL, f2 INTEGER)
ENGINE = $engine_type;
INSERT INTO t1 VALUES ('A', 1);
SELECT * FROM t1 order by f1, f2;
SELECT * FROM t1;
CREATE VIEW v1 AS SELECT * FROM t1 WHERE f2 BETWEEN 1 AND 2
WITH CASCADED CHECK OPTION ;
SELECT * FROM v1 order by f1, f2;
SELECT * FROM v1;
--enable_info
# positive cases
UPDATE v1 SET f2 = 2 WHERE f2 = 1;
@ -1885,7 +1885,7 @@ INSERT INTO v1 VALUES('B',2);
--disable_info
# Bug#11771: View over InnoDB table, wrong result SELECT on VIEW,
# field->query_id wrong
SELECT * FROM v1 order by f1, f2;
SELECT * FROM v1;
# negative cases
--enable_info
--error 1369
@ -1895,7 +1895,7 @@ INSERT INTO v1 VALUES('B',3);
--disable_info
# Bug#11771: View over InnoDB table, wrong result SELECT on VIEW,
# field->query_id wrong
SELECT * FROM v1 order by f1, f2;
SELECT * FROM v1;
let $message= Testcase 3.3.1.49 ;
@ -3287,7 +3287,7 @@ DELETE FROM t1;
# f1 gets the default 0, because we are in the native sql_mode
INSERT INTO v1 SET f2 = 'ABC';
# f1 gets the default 0, but this value is already exists
--error ER_DUP_ENTRY_WITH_KEY_NAME
--error 1062
INSERT INTO v1 SET f2 = 'ABC';
SELECT * from t1;
DELETE FROM t1;
@ -3375,7 +3375,7 @@ CREATE VIEW v1 AS SELECT f2, f3 FROM t1;
# f1 gets the default 0, because we are in the native sql_mode
INSERT INTO v1 SET f2 = 'ABC';
# f1 gets the default 0 and this value is already exists
--error ER_DUP_ENTRY_WITH_KEY_NAME
--error 1062
INSERT INTO v1 SET f2 = 'ABC';
SELECT * from t1;
DELETE FROM t1;
@ -3838,8 +3838,8 @@ INSERT INTO v1 SET f1 = -1, f4 = 'ABC', report = 'v1 0';
# 0. Initial state
DESCRIBE t1;
DESCRIBE v1;
SELECT * FROM t1 order by f1, report;
SELECT * FROM v1 order by f1, report;
SELECT * FROM t1;
SELECT * FROM v1;
#
# 1. Name of one base table column is altered
ALTER TABLE t1 CHANGE COLUMN f4 f4x CHAR(5);
@ -3854,9 +3854,9 @@ DESCRIBE t1;
# Bug#12533 crash on DESCRIBE <view> after renaming base table column;
--error 1356
DESCRIBE v1;
SELECT * FROM t1 order by f1, report;
SELECT * FROM t1;
--error 1356
SELECT * FROM v1 order by f1, report;
SELECT * FROM v1;
ALTER TABLE t1 CHANGE COLUMN f4x f4 CHAR(5);
#
# 2. Length of one base table column is increased
@ -3865,8 +3865,8 @@ INSERT INTO t1 SET f1 = 2, f4 = '<-- 10 -->', report = 't1 2';
INSERT INTO v1 SET f1 = 2, f4 = '<-- 10 -->', report = 'v1 2';
DESCRIBE t1;
DESCRIBE v1;
SELECT * FROM t1 order by f1, report;
SELECT * FROM v1 order by f1, report;
SELECT * FROM t1;
SELECT * FROM v1;
#
# 3. Length of one base table column is reduced
ALTER TABLE t1 CHANGE COLUMN f4 f4 CHAR(8);
@ -3874,8 +3874,8 @@ INSERT INTO t1 SET f1 = 3, f4 = '<-- 10 -->', report = 't1 3';
INSERT INTO v1 SET f1 = 3, f4 = '<-- 10 -->', report = 'v1 3';
DESCRIBE t1;
DESCRIBE v1;
SELECT * FROM t1 order by f1, report;
SELECT * FROM v1 order by f1, report;
SELECT * FROM t1;
SELECT * FROM v1;
#
# 4. Type of one base table column is altered string -> string
ALTER TABLE t1 CHANGE COLUMN f4 f4 VARCHAR(20);
@ -3883,8 +3883,8 @@ INSERT INTO t1 SET f1 = 4, f4 = '<------ 20 -------->', report = 't1 4';
INSERT INTO v1 SET f1 = 4, f4 = '<------ 20 -------->', report = 'v1 4';
DESCRIBE t1;
DESCRIBE v1;
SELECT * FROM t1 order by f1, report;
SELECT * FROM v1 order by f1, report;
SELECT * FROM t1;
SELECT * FROM v1;
#
# 5. Type of one base table column altered numeric -> string
ALTER TABLE t1 CHANGE COLUMN f1 f1 VARCHAR(30);
@ -3894,8 +3894,8 @@ INSERT INTO v1 SET f1 = '<------------- 30 ----------->',
f4 = '<------ 20 -------->', report = 'v1 5';
DESCRIBE t1;
DESCRIBE v1;
SELECT * FROM t1 order by f1, report;
SELECT * FROM v1 order by f1, report;
SELECT * FROM t1;
SELECT * FROM v1;
#
# 6. DROP of one base table column
ALTER TABLE t1 DROP COLUMN f2;
@ -3905,9 +3905,9 @@ INSERT INTO v1 SET f1 = 'ABC', f4 = '<------ 20 -------->', report = 'v1 6';
DESCRIBE t1;
--error 1356
DESCRIBE v1;
SELECT * FROM t1 order by f1, report;
SELECT * FROM t1;
--error 1356
SELECT * FROM v1 order by f1, report;
SELECT * FROM v1;
#
# 7. Recreation of dropped base table column with the same data type like before
ALTER TABLE t1 ADD COLUMN f2 DATE DEFAULT NULL;
@ -3917,8 +3917,8 @@ INSERT INTO v1 SET f1 = 'ABC', f2 = '1500-12-04',
f4 = '<------ 20 -------->', report = 'v1 7';
DESCRIBE t1;
DESCRIBE v1;
SELECT * FROM t1 order by f1, report;
SELECT * FROM v1 order by f1, report;
SELECT * FROM t1;
SELECT * FROM v1;
#
# 8. Recreation of dropped base table column with a different data type
# like before
@ -3930,8 +3930,8 @@ INSERT INTO v1 SET f1 = 'ABC', f2 = -3.3E-4,
f4 = '<------ 20 -------->', report = 'v1 8';
DESCRIBE t1;
DESCRIBE v1;
SELECT * FROM t1 order by f1, report;
SELECT * FROM v1 order by f1, report;
SELECT * FROM t1;
SELECT * FROM v1;
#
# 9. Add a column to the base table
ALTER TABLE t1 ADD COLUMN f3 NUMERIC(7,2);
@ -3944,8 +3944,8 @@ INSERT INTO v1 SET f1 = 'ABC', f2 = -3.3E-4,
f4 = '<------ 20 -------->', report = 'v1 9a';
DESCRIBE t1;
DESCRIBE v1;
SELECT * FROM t1 order by f1, report;
SELECT * FROM v1 order by f1, report;
SELECT * FROM t1;
SELECT * FROM v1;
#
# 10. VIEW with numeric function is "victim" of data type change
DROP TABLE t1;
@ -3955,32 +3955,32 @@ INSERT INTO t1 SET f1 = 'ABC', f2 = 3;
CREATE VIEW v1 AS SELECT f1, SQRT(f2) my_sqrt FROM t1;
DESCRIBE t1;
DESCRIBE v1;
SELECT * FROM t1 order by f1, f2;
SELECT * FROM v1 order by 2;
SELECT * FROM t1;
SELECT * FROM v1;
ALTER TABLE t1 CHANGE COLUMN f2 f2 VARCHAR(30);
INSERT INTO t1 SET f1 = 'ABC', f2 = 'DEF';
DESCRIBE t1;
DESCRIBE v1;
SELECT * FROM t1 order by f1, f2;
SELECT * FROM v1 order by 2;
SELECT * FROM t1;
SELECT * FROM v1;
# Some statements for comparison
# - the ugly SQRT('DEF) as constant
SELECT SQRT('DEF');
# - Will a VIEW based on the same definition show the same result ?
CREATE VIEW v2 AS SELECT SQRT('DEF');
SELECT * FROM v2 order by 1;
SELECT * FROM v2;
# - Will a VIEW v2 created after the base table column recreation show the same
# result set like v1 ?
CREATE OR REPLACE VIEW v2 AS SELECT f1, SQRT(f2) my_sqrt FROM t1;
DESCRIBE v2;
SELECT * FROM v2 order by 2;
SELECT * FROM v2;
# - What will be the content of base table created with AS SELECT ?
CREATE TABLE t2 AS SELECT f1, SQRT(f2) my_sqrt FROM t1;
if ($have_bug_11589)
{
--disable_ps_protocol
}
SELECT * FROM t2 order by 2;
SELECT * FROM t2;
--enable_ps_protocol
DROP TABLE t2;
CREATE TABLE t2 AS SELECT * FROM v1;
@ -3988,7 +3988,7 @@ if ($have_bug_11589)
{
--disable_ps_protocol
}
SELECT * FROM t2 order by 2;
SELECT * FROM t2;
--enable_ps_protocol
DROP TABLE t2;
CREATE TABLE t2 AS SELECT * FROM v2;
@ -3996,7 +3996,7 @@ if ($have_bug_11589)
{
--disable_ps_protocol
}
SELECT * FROM t2 order by 2;
SELECT * FROM t2;
--enable_ps_protocol
#
DROP TABLE t1;