mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Fix a bad BitKeeper dependency structure for the "funcs_1" suite:
Step 2: Restore the 5.1 contents in the 5.0-dependent files.
This commit is contained in:
@ -1,4 +1,3 @@
|
||||
#### suite/funcs_1/cursors/cursors_master.test
|
||||
|
||||
let $message= NOT YET IMPLEMENTED: cursor tests;
|
||||
--source include/show_msg80.inc
|
||||
|
@ -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
|
||||
# -------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
@ -58,5 +58,5 @@ eval $dd_part1 triggers $dd_part2;
|
||||
--error 1109
|
||||
eval $dd_part1 parameters $dd_part2;
|
||||
|
||||
--error 1109
|
||||
--error 0,1109
|
||||
eval $dd_part1 referential_constraints $dd_part2;
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -166,7 +166,7 @@ declare y integer default 1;
|
||||
set @x = x;
|
||||
set @y = y;
|
||||
set @z = 234;
|
||||
SELECT f1, f2 into @x, @y from t2 limit 1;
|
||||
SELECT f1, f2 into @x, @y from t2 where f1='a`' and f2='a`' limit 1;
|
||||
SELECT @x, @y, @z, invar;
|
||||
BEGIN
|
||||
set @x = 2;
|
||||
@ -209,7 +209,7 @@ BEGIN
|
||||
declare x integer; declare y integer;
|
||||
set @x=x;
|
||||
set @y=y;
|
||||
SELECT f4, f3 into @x, @y from t2 limit 1;
|
||||
SELECT f4, f3 into @x, @y from t2 where f4=-5000 and f3='1000-01-01' limit 1;
|
||||
SELECT @x, @y;
|
||||
END//
|
||||
CALL sp1();
|
||||
@ -544,6 +544,9 @@ exit handler 2
|
||||
exit handler 2
|
||||
exit handler 1
|
||||
exit handler 1
|
||||
Warnings:
|
||||
Note 1051 Unknown table 'tqq'
|
||||
Note 1051 Unknown table 'tqq'
|
||||
create table res_t1(w char unique, x char);
|
||||
insert into res_t1 values ('a', 'b');
|
||||
CREATE PROCEDURE h1 ()
|
||||
@ -1084,7 +1087,8 @@ declare f2_value char(20);
|
||||
declare f5_value char(20);
|
||||
declare f4_value integer;
|
||||
declare f6_value integer;
|
||||
declare cur1 cursor for SELECT f1, f2, f4, f5, f6 from t2 limit 3;
|
||||
declare cur1 cursor for SELECT f1, f2, f4, f5, f6 from t2
|
||||
where f4 >=-5000 order by f4 limit 3;
|
||||
open cur1;
|
||||
while proceed do
|
||||
SELECT count AS 'loop';
|
||||
@ -1167,7 +1171,7 @@ of a compound statement ends.
|
||||
DROP TABLE IF EXISTS temp1;
|
||||
DROP PROCEDURE IF EXISTS sp1;
|
||||
create table temp1( f0 char(20), f1 char(20), f2 char(20), f3 int, f4 char(20) );
|
||||
SELECT f1, f2, f4, f5 from t2;
|
||||
SELECT f1, f2, f4, f5 from t2 order by f4;
|
||||
f1 f2 f4 f5
|
||||
a` a` -5000 a`
|
||||
aaa aaa -4999 aaa
|
||||
@ -1187,21 +1191,21 @@ declare newf1 char(20);
|
||||
declare newf2 char(20);
|
||||
declare newf5 char(20);
|
||||
declare newf4 integer;
|
||||
declare cur1 cursor for SELECT f1, f2, f4, f5 from t2 limit 5;
|
||||
declare cur2 cursor for SELECT f1, f2, f4, f5 from t2 limit 5;
|
||||
declare cur1 cursor for SELECT f1, f2, f4, f5 from t2 where f4 >= -5000 order by f4 limit 5;
|
||||
declare cur2 cursor for SELECT f1, f2, f4, f5 from t2 where f4 >= -5000 order by f4 limit 5;
|
||||
open cur1;
|
||||
open cur2;
|
||||
BEGIN
|
||||
declare continue handler for sqlstate '02000' set count = 1;
|
||||
declare continue handler for sqlstate '02000' set count=1;
|
||||
fetch cur1 into newf1, newf2, newf4, newf5;
|
||||
SELECT '-1-', count, newf1, newf2, newf4, newf5;
|
||||
insert into temp1 values ('cur1_out', newf1, newf2, newf4, newf5);
|
||||
set count = 4;
|
||||
set count= 4;
|
||||
BEGIN
|
||||
while count > 0 do
|
||||
while count> 0 do
|
||||
fetch cur1 into newf1, newf2, newf4, newf5;
|
||||
SELECT '-2-', count, newf1, newf2, newf4, newf5;
|
||||
set count = count - 1;
|
||||
set count = count- 1;
|
||||
END while;
|
||||
SELECT '-3-', count, newf1, newf2, newf4, newf4;
|
||||
END;
|
||||
@ -1270,8 +1274,10 @@ declare i_newf11 char(20);
|
||||
declare i_newf12 char(20);
|
||||
declare i_newf13 date;
|
||||
declare i_newf14 integer;
|
||||
declare cur1 cursor for SELECT f1, f2, f3, f4 from t2 limit 4;
|
||||
declare cur2 cursor for SELECT f1, f2, f3, f4 from t2 limit 3;
|
||||
declare cur1 cursor for SELECT f1, f2, f3, f4 from t2
|
||||
where f4>=-5000 order by f4 limit 4;
|
||||
declare cur2 cursor for SELECT f1, f2, f3, f4 from t2
|
||||
where f4>=-5000 order by f4 limit 3;
|
||||
declare continue handler for sqlstate '02000' set proceed=0;
|
||||
open cur1;
|
||||
open cur2;
|
||||
@ -1302,8 +1308,10 @@ DECLARE o_newf11 CHAR(20);
|
||||
DECLARE o_newf12 CHAR(20);
|
||||
DECLARE o_newf13 DATE;
|
||||
DECLARE o_newf14 INTEGER;
|
||||
DECLARE cur1 CURSOR FOR SELECT f1, f2, f3, f4 FROM t2 LIMIT 5;
|
||||
DECLARE cur2 CURSOR FOR SELECT f1, f2, f3, f4 FROM t2 LIMIT 5;
|
||||
DECLARE cur1 CURSOR FOR SELECT f1, f2, f3, f4 FROM t2
|
||||
WHERE f4>=-5000 ORDER BY f4 LIMIT 5;
|
||||
DECLARE cur2 CURSOR FOR SELECT f1, f2, f3, f4 FROM t2
|
||||
WHERE f4>=-5000 ORDER BY f4 LIMIT 5;
|
||||
DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET proceed=0;
|
||||
OPEN cur1;
|
||||
OPEN cur2;
|
||||
|
@ -80,7 +80,7 @@ connect(localhost,user_1,,db_storedproc,MYSQL_PORT,MYSQL_SOCK);
|
||||
user_1@localhost db_storedproc
|
||||
CREATE PROCEDURE sp31102 () SQL SECURITY INVOKER
|
||||
BEGIN
|
||||
SELECT * FROM db_storedproc.t1 LIMIT 1;
|
||||
SELECT * FROM db_storedproc.t1 WHERE f4=-5000 LIMIT 1;
|
||||
END//
|
||||
CREATE FUNCTION fn31105(n INT) RETURNS INT
|
||||
BEGIN
|
||||
@ -209,7 +209,7 @@ CALL sp_ins_1();
|
||||
SELECT row_count();
|
||||
row_count()
|
||||
1
|
||||
SELECT * FROM temp;
|
||||
SELECT * FROM temp ORDER BY f4;
|
||||
f1 f2 f3 f4 f5 f6
|
||||
a` a` 1000-01-01 -5000 a` -5000
|
||||
aaa aaa 1000-01-02 -4999 aaa -4999
|
||||
@ -226,7 +226,7 @@ CALL sp_ins_3();
|
||||
SELECT row_count();
|
||||
row_count()
|
||||
1
|
||||
SELECT * FROM temp;
|
||||
SELECT * FROM temp ORDER BY f4;
|
||||
f1 f2 f3 f4 f5 f6
|
||||
a` a` 1000-01-01 -5000 a` -5000
|
||||
aaa aaa 1000-01-02 -4999 aaa -4999
|
||||
@ -246,7 +246,7 @@ CALL sp_upd();
|
||||
SELECT row_count();
|
||||
row_count()
|
||||
4
|
||||
SELECT * FROM temp;
|
||||
SELECT * FROM temp ORDER BY f4;
|
||||
f1 f2 f3 f4 f5 f6
|
||||
a` a` 1000-01-01 -5000 a` -5000
|
||||
aaa aaa 1000-01-02 -4999 aaa -4999
|
||||
@ -279,7 +279,7 @@ COUNT( f1 ) f1
|
||||
SELECT row_count();
|
||||
row_count()
|
||||
3
|
||||
SELECT * FROM temp;
|
||||
SELECT * FROM temp ORDER BY f4;
|
||||
f1 f2 f3 f4 f5 f6
|
||||
a` a` 1000-01-01 -5000 a` -5000
|
||||
aaa aaa 1000-01-02 -4999 aaa -4999
|
||||
|
@ -199,6 +199,9 @@ CREATE TRIGGER trg5_1 BEFORE INSERT on test.t1
|
||||
for each row set new.f3 = '14';
|
||||
CREATE TRIGGER trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ
|
||||
BEFORE UPDATE on test.t1 for each row set new.f3 = '42';
|
||||
ERROR 42000: Identifier name 'trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ' is too long
|
||||
CREATE TRIGGER trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWX
|
||||
BEFORE UPDATE on test.t1 for each row set new.f3 = '42';
|
||||
insert into t1 (f2) values ('insert 3.5.1.7');
|
||||
select * from t1;
|
||||
f1 f2 f3
|
||||
@ -207,12 +210,14 @@ update t1 set f2='update 3.5.1.7';
|
||||
select * from t1;
|
||||
f1 f2 f3
|
||||
NULL update 3.5.1.7 42
|
||||
select trigger_name from information_schema.triggers;
|
||||
select trigger_name from information_schema.triggers order by trigger_name;
|
||||
trigger_name
|
||||
trg5_1
|
||||
trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWX
|
||||
drop trigger trg5_1;
|
||||
drop trigger trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ;
|
||||
ERROR 42000: Identifier name 'trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ' is too long
|
||||
drop trigger trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWX;
|
||||
drop table t1;
|
||||
|
||||
Testcase 3.5.1.8:
|
||||
@ -314,7 +319,7 @@ insert into trig_db3.t1 (f1,f2) values ('insert to db3 t1 from db1',4);
|
||||
select @test_var1, @test_var2, @test_var3;
|
||||
@test_var1 @test_var2 @test_var3
|
||||
trig1 trig2 trig3
|
||||
select * from t1;
|
||||
select * from t1 order by f2;
|
||||
f1 f2
|
||||
trig1 1
|
||||
trig1 2
|
||||
@ -324,7 +329,7 @@ trig2 3
|
||||
select * from trig_db3.t1;
|
||||
f1 f2
|
||||
trig3 4
|
||||
select * from t1;
|
||||
select * from t1 order by f2;
|
||||
f1 f2
|
||||
trig1 1
|
||||
trig1 2
|
||||
@ -349,10 +354,10 @@ for each row set @test_var2='trig1_a';
|
||||
create trigger trig_db2.trig2 before insert on trig_db2.t1
|
||||
for each row set @test_var3='trig2';
|
||||
select trigger_schema, trigger_name, event_object_table
|
||||
from information_schema.triggers;
|
||||
from information_schema.triggers order by trigger_name;
|
||||
trigger_schema trigger_name event_object_table
|
||||
trig_db1 trig1_b t1
|
||||
trig_db1 trig1_a t1
|
||||
trig_db1 trig1_b t1
|
||||
trig_db2 trig2 t1
|
||||
set @test_var1= '', @test_var2= '', @test_var3= '';
|
||||
insert into t1 (f1,f2) values ('insert to db1 t1 from db1',352);
|
||||
|
@ -82,16 +82,16 @@ Testcase 3.5.3.2/6:
|
||||
-------------------
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
|
||||
grant ALL on *.* to test_noprivs@localhost;
|
||||
revoke SUPER on *.* from test_noprivs@localhost;
|
||||
revoke TRIGGER on *.* from test_noprivs@localhost;
|
||||
show grants for test_noprivs@localhost;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
|
||||
grant SUPER on *.* to test_yesprivs@localhost;
|
||||
grant TRIGGER on *.* to test_yesprivs@localhost;
|
||||
grant SELECT on priv_db.t1 to test_yesprivs@localhost;
|
||||
show grants for test_yesprivs@localhost;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
|
||||
connect(localhost,test_noprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
|
||||
connect(localhost,test_yesprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
|
||||
@ -104,10 +104,10 @@ test_noprivs@localhost
|
||||
use priv_db;
|
||||
create trigger trg1_1 before INSERT on t1 for each row
|
||||
set new.f1 = 'trig 3.5.3.2_1-no';
|
||||
ERROR 42000: Access denied; you need the SUPER privilege for this operation
|
||||
Got one of the listed errors
|
||||
use priv_db;
|
||||
insert into t1 (f1) values ('insert 3.5.3.2-no');
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
select current_user;
|
||||
@ -122,15 +122,12 @@ root@localhost
|
||||
use priv_db;
|
||||
insert into t1 (f1) values ('insert 3.5.3.2-yes');
|
||||
ERROR 42000: UPDATE command denied to user 'test_yesprivs'@'localhost' for column 'f1' in table 't1'
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
grant UPDATE on priv_db.t1 to test_yesprivs@localhost;
|
||||
|
||||
note: once 15166 is fixed a similar case for SELECT needs to be added
|
||||
---------------------------------------------------------------------
|
||||
insert into t1 (f1) values ('insert 3.5.3.2-yes');
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
trig 3.5.3.2_2-yes
|
||||
@ -139,10 +136,10 @@ Testcase 3.5.3.6:
|
||||
-----------------
|
||||
use priv_db;
|
||||
drop trigger trg1_2;
|
||||
ERROR 42000: Access denied; you need the SUPER privilege for this operation
|
||||
Got one of the listed errors
|
||||
use priv_db;
|
||||
insert into t1 (f1) values ('insert 3.5.3.6-yes');
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
trig 3.5.3.2_2-yes
|
||||
@ -151,12 +148,12 @@ use priv_db;
|
||||
drop trigger trg1_2;
|
||||
use priv_db;
|
||||
insert into t1 (f1) values ('insert 3.5.3.6-no');
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
insert 3.5.3.6-no
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
drop trigger trg1_2;
|
||||
|
||||
Testcase 3.5.3.7a:
|
||||
@ -166,12 +163,12 @@ grant ALL on *.* to test_noprivs@localhost;
|
||||
revoke UPDATE on *.* from test_noprivs@localhost;
|
||||
show grants for test_noprivs@localhost;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
|
||||
grant SUPER, UPDATE on *.* to test_yesprivs@localhost;
|
||||
grant TRIGGER, UPDATE on *.* to test_yesprivs@localhost;
|
||||
show grants for test_yesprivs@localhost;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT UPDATE, SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT UPDATE, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
connect(localhost,test_noprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
|
||||
connect(localhost,test_yesprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
|
||||
select current_user;
|
||||
@ -180,24 +177,24 @@ test_noprivs@localhost
|
||||
use priv_db;
|
||||
show grants;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
select f1 from t1;
|
||||
GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
insert 3.5.3.6-no
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
|
||||
Trigger create disabled - should fail - Bug 8884
|
||||
------------------------------------------------
|
||||
insert into t1 (f1) values ('insert 3.5.3.7-1a');
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
insert 3.5.3.6-no
|
||||
insert 3.5.3.7-1a
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
drop trigger trg4a_1;
|
||||
use priv_db;
|
||||
select current_user;
|
||||
@ -205,236 +202,220 @@ current_user
|
||||
test_yesprivs@localhost
|
||||
show grants;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT UPDATE, SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT UPDATE, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
create trigger trg4a_2 before INSERT on t1 for each row
|
||||
set new.f1 = 'trig 3.5.3.7-2a';
|
||||
|
||||
SELECT priv added to bypass bug 15166
|
||||
-------------------------------------
|
||||
grant SELECT on *.* to test_yesprivs@localhost;
|
||||
insert into t1 (f1) values ('insert 3.5.3.7-2b');
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
insert 3.5.3.6-no
|
||||
insert 3.5.3.7-1a
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.7-2a
|
||||
drop trigger trg4a_2;
|
||||
|
||||
Testcase 3.5.3.7b:
|
||||
------------------
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
|
||||
grant SUPER on *.* to test_noprivs;
|
||||
grant TRIGGER on *.* to test_noprivs;
|
||||
grant ALL on priv_db.* to test_noprivs@localhost;
|
||||
revoke UPDATE on priv_db.* from test_noprivs@localhost;
|
||||
show grants for test_noprivs;
|
||||
Grants for test_noprivs@%
|
||||
GRANT SUPER ON *.* TO 'test_noprivs'@'%'
|
||||
GRANT TRIGGER ON *.* TO 'test_noprivs'@'%'
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
|
||||
grant SUPER on *.* to test_yesprivs@localhost;
|
||||
grant TRIGGER on *.* to test_yesprivs@localhost;
|
||||
grant UPDATE on priv_db.* to test_yesprivs@localhost;
|
||||
show grants for test_yesprivs@localhost;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT UPDATE ON `priv_db`.* TO 'test_yesprivs'@'localhost'
|
||||
connect(localhost,test_noprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
|
||||
connect(localhost,test_yesprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
|
||||
show grants;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE ON `priv_db`.* TO 'test_noprivs'@'localhost'
|
||||
GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER ON `priv_db`.* TO 'test_noprivs'@'localhost'
|
||||
use priv_db;
|
||||
|
||||
Trigger create disabled - should fail - Bug 8884
|
||||
------------------------------------------------
|
||||
insert into t1 (f1) values ('insert 3.5.3.7-1b');
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
insert 3.5.3.6-no
|
||||
insert 3.5.3.7-1a
|
||||
trig 3.5.3.7-2a
|
||||
insert 3.5.3.7-1b
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.7-2a
|
||||
update t1 set f1 = 'update 3.5.3.7-1b' where f1 = 'insert 3.5.3.7-1b';
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
insert 3.5.3.6-no
|
||||
insert 3.5.3.7-1a
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.7-2a
|
||||
update 3.5.3.7-1b
|
||||
drop trigger trg4b_1;
|
||||
show grants;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT UPDATE ON `priv_db`.* TO 'test_yesprivs'@'localhost'
|
||||
use priv_db;
|
||||
create trigger trg4b_2 before UPDATE on t1 for each row
|
||||
set new.f1 = 'trig 3.5.3.7-2b';
|
||||
|
||||
SELECT priv added to bypass bug 15166
|
||||
-------------------------------------
|
||||
grant SELECT on priv_db.* to test_yesprivs@localhost;
|
||||
insert into t1 (f1) values ('insert 3.5.3.7-2b');
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
insert 3.5.3.6-no
|
||||
insert 3.5.3.7-1a
|
||||
trig 3.5.3.7-2a
|
||||
update 3.5.3.7-1b
|
||||
insert 3.5.3.7-2b
|
||||
update t1 set f1 = 'update 3.5.3.7-2b' where f1 = 'insert 3.5.3.7-2b';
|
||||
select f1 from t1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
insert 3.5.3.6-no
|
||||
insert 3.5.3.7-1a
|
||||
trig 3.5.3.7-2a
|
||||
update 3.5.3.7-1b
|
||||
update t1 set f1 = 'update 3.5.3.7-2b' where f1 = 'insert 3.5.3.7-2b';
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
insert 3.5.3.6-no
|
||||
insert 3.5.3.7-1a
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.7-2a
|
||||
trig 3.5.3.7-2b
|
||||
update 3.5.3.7-1b
|
||||
drop trigger trg4b_2;
|
||||
|
||||
Testcase 3.5.3.7c
|
||||
-----------------
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
|
||||
grant SUPER on *.* to test_noprivs@localhost;
|
||||
grant TRIGGER on *.* to test_noprivs@localhost;
|
||||
grant ALL on priv_db.t1 to test_noprivs@localhost;
|
||||
revoke UPDATE on priv_db.t1 from test_noprivs@localhost;
|
||||
show grants for test_noprivs;
|
||||
Grants for test_noprivs@%
|
||||
GRANT SUPER ON *.* TO 'test_noprivs'@'%'
|
||||
GRANT TRIGGER ON *.* TO 'test_noprivs'@'%'
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
|
||||
grant SUPER on *.* to test_yesprivs@localhost;
|
||||
grant TRIGGER on *.* to test_yesprivs@localhost;
|
||||
grant UPDATE on priv_db.t1 to test_yesprivs@localhost;
|
||||
show grants for test_yesprivs@localhost;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
|
||||
connect(localhost,test_noprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
|
||||
connect(localhost,test_yesprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
|
||||
show grants;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
|
||||
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
|
||||
use priv_db;
|
||||
|
||||
Trigger create disabled - should fail - Bug 8884
|
||||
------------------------------------------------
|
||||
insert into t1 (f1) values ('insert 3.5.3.7-1c');
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
insert 3.5.3.6-no
|
||||
insert 3.5.3.7-1a
|
||||
trig 3.5.3.7-2a
|
||||
update 3.5.3.7-1b
|
||||
trig 3.5.3.7-2b
|
||||
insert 3.5.3.7-1c
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.7-2a
|
||||
trig 3.5.3.7-2b
|
||||
update 3.5.3.7-1b
|
||||
drop trigger trg4c_1;
|
||||
show grants;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
|
||||
use priv_db;
|
||||
create trigger trg4c_2 before INSERT on t1 for each row
|
||||
set new.f1 = 'trig 3.5.3.7-2c';
|
||||
|
||||
SELECT priv added to bypass bug 15166
|
||||
-------------------------------------
|
||||
grant SELECT on priv_db.t1 to test_yesprivs@localhost;
|
||||
insert into t1 (f1) values ('insert 3.5.3.7-2c');
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
insert 3.5.3.6-no
|
||||
insert 3.5.3.7-1a
|
||||
trig 3.5.3.7-2a
|
||||
update 3.5.3.7-1b
|
||||
trig 3.5.3.7-2b
|
||||
insert 3.5.3.7-1c
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.7-2a
|
||||
trig 3.5.3.7-2b
|
||||
trig 3.5.3.7-2c
|
||||
update 3.5.3.7-1b
|
||||
drop trigger trg4c_2;
|
||||
|
||||
Testcase 3.5.3.7d:
|
||||
------------------
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
|
||||
grant SUPER on *.* to test_noprivs@localhost;
|
||||
grant TRIGGER on *.* to test_noprivs@localhost;
|
||||
grant SELECT (f1), INSERT (f1) on priv_db.t1 to test_noprivs@localhost;
|
||||
show grants for test_noprivs;
|
||||
Grants for test_noprivs@%
|
||||
GRANT SUPER ON *.* TO 'test_noprivs'@'%'
|
||||
GRANT TRIGGER ON *.* TO 'test_noprivs'@'%'
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
|
||||
grant SUPER on *.* to test_yesprivs@localhost;
|
||||
grant TRIGGER on *.* to test_yesprivs@localhost;
|
||||
grant UPDATE (f1) on priv_db.t1 to test_yesprivs@localhost;
|
||||
show grants for test_noprivs;
|
||||
Grants for test_noprivs@%
|
||||
GRANT SUPER ON *.* TO 'test_noprivs'@'%'
|
||||
GRANT TRIGGER ON *.* TO 'test_noprivs'@'%'
|
||||
connect(localhost,test_noprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
|
||||
connect(localhost,test_yesprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
|
||||
show grants;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT (f1), INSERT (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
|
||||
use priv_db;
|
||||
|
||||
Trigger create disabled - should fail - Bug 8884
|
||||
------------------------------------------------
|
||||
insert into t1 (f1) values ('insert 3.5.3.7-1d');
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
insert 3.5.3.6-no
|
||||
insert 3.5.3.7-1a
|
||||
trig 3.5.3.7-2a
|
||||
update 3.5.3.7-1b
|
||||
trig 3.5.3.7-2b
|
||||
insert 3.5.3.7-1c
|
||||
trig 3.5.3.7-2c
|
||||
insert 3.5.3.7-1d
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.7-2a
|
||||
trig 3.5.3.7-2b
|
||||
trig 3.5.3.7-2c
|
||||
update 3.5.3.7-1b
|
||||
drop trigger trg4d_1;
|
||||
show grants;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT UPDATE (f1) ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
|
||||
use priv_db;
|
||||
create trigger trg4d_2 before INSERT on t1 for each row
|
||||
set new.f1 = 'trig 3.5.3.7-2d';
|
||||
|
||||
SELECT priv added to bypass bug 15166
|
||||
-------------------------------------
|
||||
grant SELECT (f1) on priv_db.t1 to test_yesprivs@localhost;
|
||||
insert into t1 (f1) values ('insert 3.5.3.7-2d');
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
insert 3.5.3.6-no
|
||||
insert 3.5.3.7-1a
|
||||
trig 3.5.3.7-2a
|
||||
update 3.5.3.7-1b
|
||||
trig 3.5.3.7-2b
|
||||
insert 3.5.3.7-1c
|
||||
trig 3.5.3.7-2c
|
||||
insert 3.5.3.7-1d
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.7-2a
|
||||
trig 3.5.3.7-2b
|
||||
trig 3.5.3.7-2c
|
||||
trig 3.5.3.7-2d
|
||||
update 3.5.3.7-1b
|
||||
drop trigger trg4d_2;
|
||||
|
||||
Testcase 3.5.3.8a:
|
||||
@ -444,12 +425,12 @@ grant ALL on *.* to test_noprivs@localhost;
|
||||
revoke SELECT on *.* from test_noprivs@localhost;
|
||||
show grants for test_noprivs@localhost;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
|
||||
grant SUPER, SELECT on *.* to test_yesprivs@localhost;
|
||||
grant TRIGGER, SELECT on *.* to test_yesprivs@localhost;
|
||||
show grants for test_yesprivs@localhost;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT SELECT, SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
connect(localhost,test_noprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
|
||||
connect(localhost,test_yesprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
|
||||
select current_user;
|
||||
@ -458,7 +439,7 @@ test_noprivs@localhost
|
||||
use priv_db;
|
||||
show grants;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
|
||||
Trigger create disabled - should fail - Bug 8887
|
||||
------------------------------------------------
|
||||
@ -477,17 +458,13 @@ current_user
|
||||
test_yesprivs@localhost
|
||||
show grants;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT SELECT, SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
create trigger trg5a_2 before INSERT on t1 for each row
|
||||
set @test_var= new.f1;
|
||||
set @test_var= 'before trig 3.5.3.8-2a';
|
||||
select @test_var;
|
||||
@test_var
|
||||
before trig 3.5.3.8-2a
|
||||
|
||||
UPDATE priv added to bypass bug 15166
|
||||
-------------------------------------
|
||||
grant UPDATE on *.* to test_yesprivs@localhost;
|
||||
insert into t1 (f1) values ('insert 3.5.3.8-2a');
|
||||
select @test_var;
|
||||
@test_var
|
||||
@ -497,26 +474,26 @@ drop trigger trg5a_2;
|
||||
Testcase: 3.5.3.8b
|
||||
------------------
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
|
||||
grant SUPER on *.* to test_noprivs@localhost;
|
||||
grant TRIGGER on *.* to test_noprivs@localhost;
|
||||
grant ALL on priv_db.* to test_noprivs@localhost;
|
||||
revoke SELECT on priv_db.* from test_noprivs@localhost;
|
||||
show grants for test_noprivs@localhost;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE ON `priv_db`.* TO 'test_noprivs'@'localhost'
|
||||
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER ON `priv_db`.* TO 'test_noprivs'@'localhost'
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
|
||||
grant SUPER on *.* to test_yesprivs@localhost;
|
||||
grant TRIGGER on *.* to test_yesprivs@localhost;
|
||||
grant SELECT on priv_db.* to test_yesprivs@localhost;
|
||||
show grants for test_yesprivs@localhost;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT ON `priv_db`.* TO 'test_yesprivs'@'localhost'
|
||||
connect(localhost,test_noprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
|
||||
connect(localhost,test_yesprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
|
||||
show grants;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE ON `priv_db`.* TO 'test_noprivs'@'localhost'
|
||||
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER ON `priv_db`.* TO 'test_noprivs'@'localhost'
|
||||
use priv_db;
|
||||
|
||||
Trigger create disabled - should fail - Bug 8887
|
||||
@ -533,7 +510,7 @@ before trig 3.5.3.8-1b
|
||||
drop trigger trg5b_1;
|
||||
show grants;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT ON `priv_db`.* TO 'test_yesprivs'@'localhost'
|
||||
use priv_db;
|
||||
create trigger trg5b_2 before UPDATE on t1 for each row
|
||||
@ -543,10 +520,6 @@ insert into t1 (f1) values ('insert 3.5.3.8-2b');
|
||||
select @test_var;
|
||||
@test_var
|
||||
before trig 3.5.3.8-2b
|
||||
|
||||
UPDATE priv added to bypass bug 15166
|
||||
-------------------------------------
|
||||
grant UPDATE on priv_db.* to test_yesprivs@localhost;
|
||||
update t1 set f1= 'update 3.5.3.8-2b' where f1 = 'insert 3.5.3.8-2b';
|
||||
select @test_var;
|
||||
@test_var
|
||||
@ -556,26 +529,26 @@ drop trigger trg5b_2;
|
||||
Testcase 3.5.3.8c:
|
||||
------------------
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
|
||||
grant SUPER on *.* to test_noprivs@localhost;
|
||||
grant TRIGGER on *.* to test_noprivs@localhost;
|
||||
grant ALL on priv_db.t1 to test_noprivs@localhost;
|
||||
revoke SELECT on priv_db.t1 from test_noprivs@localhost;
|
||||
show grants for test_noprivs@localhost;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
|
||||
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
|
||||
grant SUPER on *.* to test_yesprivs@localhost;
|
||||
grant TRIGGER on *.* to test_yesprivs@localhost;
|
||||
grant SELECT on priv_db.t1 to test_yesprivs@localhost;
|
||||
show grants for test_yesprivs@localhost;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
|
||||
connect(localhost,test_noprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
|
||||
connect(localhost,test_yesprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
|
||||
show grants;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
|
||||
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
|
||||
use priv_db;
|
||||
|
||||
Trigger create disabled - should fail - Bug 8887
|
||||
@ -588,16 +561,12 @@ before trig 3.5.3.8-1c
|
||||
drop trigger trg5c_1;
|
||||
show grants;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
|
||||
use priv_db;
|
||||
create trigger trg5c_2 before INSERT on t1 for each row
|
||||
set @test_var= new.f1;
|
||||
set @test_var='before trig 3.5.3.8-2c';
|
||||
|
||||
UPDATE priv added to bypass bug 15166
|
||||
-------------------------------------
|
||||
grant UPDATE on priv_db.t1 to test_yesprivs@localhost;
|
||||
insert into t1 (f1) values ('insert 3.5.3.8-2c');
|
||||
select @test_var;
|
||||
@test_var
|
||||
@ -607,24 +576,24 @@ drop trigger trg5c_2;
|
||||
Testcase: 3.5.3.8d:
|
||||
-------------------
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
|
||||
grant SUPER on *.* to test_noprivs@localhost;
|
||||
grant TRIGGER on *.* to test_noprivs@localhost;
|
||||
grant UPDATE (f1), INSERT (f1) on priv_db.t1 to test_noprivs@localhost;
|
||||
show grants for test_noprivs@localhost;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
|
||||
grant SUPER on *.* to test_yesprivs@localhost;
|
||||
grant TRIGGER on *.* to test_yesprivs@localhost;
|
||||
grant SELECT (f1) on priv_db.t1 to test_yesprivs@localhost;
|
||||
show grants for test_noprivs@localhost;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
|
||||
connect(localhost,test_noprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
|
||||
connect(localhost,test_yesprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
|
||||
show grants;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
|
||||
use priv_db;
|
||||
|
||||
@ -638,16 +607,12 @@ before trig 3.5.3.8-1d
|
||||
drop trigger trg5d_1;
|
||||
show grants;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT (f1) ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
|
||||
use priv_db;
|
||||
create trigger trg5d_2 before INSERT on t1 for each row
|
||||
set @test_var= new.f1;
|
||||
set @test_var='before trig 3.5.3.8-2d';
|
||||
|
||||
UPDATE priv added to bypass bug 15166
|
||||
-------------------------------------
|
||||
grant UPDATE (f1) on priv_db.t1 to test_yesprivs@localhost;
|
||||
insert into t1 (f1) values ('insert 3.5.3.8-2d');
|
||||
select @test_var;
|
||||
@test_var
|
||||
@ -662,12 +627,12 @@ drop table if exists t2;
|
||||
create table t1 (f1 int) engine= innodb;
|
||||
create table t2 (f2 int) engine= innodb;
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
|
||||
grant SUPER on *.* to test_yesprivs@localhost;
|
||||
grant TRIGGER on *.* to test_yesprivs@localhost;
|
||||
grant SELECT, UPDATE on priv_db.t1 to test_yesprivs@localhost;
|
||||
grant SELECT on priv_db.t2 to test_yesprivs@localhost;
|
||||
show grants for test_yesprivs@localhost;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT ON `priv_db`.`t2` TO 'test_yesprivs'@'localhost'
|
||||
GRANT SELECT, UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
|
||||
connect(localhost,test_yesprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
|
||||
@ -683,10 +648,10 @@ ERROR 42000: INSERT command denied to user 'test_yesprivs'@'localhost' for table
|
||||
revoke SELECT on priv_db.t2 from test_yesprivs@localhost;
|
||||
grant INSERT on priv_db.t2 to test_yesprivs@localhost;
|
||||
insert into t1 (f1) values (4);
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
4
|
||||
select f2 from t2;
|
||||
select f2 from t2 order by f2;
|
||||
f2
|
||||
4
|
||||
use priv_db;
|
||||
@ -699,11 +664,11 @@ ERROR 42000: UPDATE command denied to user 'test_yesprivs'@'localhost' for table
|
||||
revoke INSERT on priv_db.t2 from test_yesprivs@localhost;
|
||||
grant UPDATE on priv_db.t2 to test_yesprivs@localhost;
|
||||
insert into t1 (f1) values (2);
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
4
|
||||
2
|
||||
select f2 from t2;
|
||||
4
|
||||
select f2 from t2 order by f2;
|
||||
f2
|
||||
1
|
||||
use priv_db;
|
||||
@ -716,12 +681,12 @@ ERROR 42000: SELECT command denied to user 'test_yesprivs'@'localhost' for table
|
||||
revoke UPDATE on priv_db.t2 from test_yesprivs@localhost;
|
||||
grant SELECT on priv_db.t2 to test_yesprivs@localhost;
|
||||
insert into t1 (f1) values (1);
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
4
|
||||
2
|
||||
1
|
||||
select f2 from t2;
|
||||
2
|
||||
4
|
||||
select f2 from t2 order by f2;
|
||||
f2
|
||||
1
|
||||
select @aaa;
|
||||
@ -737,13 +702,13 @@ ERROR 42000: DELETE command denied to user 'test_yesprivs'@'localhost' for table
|
||||
revoke SELECT on priv_db.t2 from test_yesprivs@localhost;
|
||||
grant DELETE on priv_db.t2 to test_yesprivs@localhost;
|
||||
insert into t1 (f1) values (1);
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
4
|
||||
1
|
||||
1
|
||||
2
|
||||
1
|
||||
1
|
||||
select f2 from t2;
|
||||
4
|
||||
select f2 from t2 order by f2;
|
||||
f2
|
||||
drop database if exists priv_db;
|
||||
drop user test_yesprivs@localhost;
|
||||
|
@ -93,18 +93,18 @@ Create trigger trg1 BEFORE INSERT on t1
|
||||
for each row set new.f1='Trigger 3.5.4.1';
|
||||
Use db_drop;
|
||||
Insert into t1 values ('Insert error 3.5.4.1');
|
||||
Select * from t1;
|
||||
Select * from t1 order by f1;
|
||||
f1
|
||||
Trigger 3.5.4.1
|
||||
drop trigger trg1;
|
||||
select trigger_schema, trigger_name, event_object_table
|
||||
from information_schema.triggers;
|
||||
from information_schema.triggers order by trigger_name;
|
||||
trigger_schema trigger_name event_object_table
|
||||
Insert into t1 values ('Insert no trigger 3.5.4.1');
|
||||
Select * from t1;
|
||||
Select * from t1 order by f1;
|
||||
f1
|
||||
Trigger 3.5.4.1
|
||||
Insert no trigger 3.5.4.1
|
||||
Trigger 3.5.4.1
|
||||
drop trigger trg1;
|
||||
drop database if exists db_drop;
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM 'test_general'@'localhost';
|
||||
@ -258,7 +258,7 @@ use dbtest_one;
|
||||
Insert into dbtest_two.t2 values ('2nd Insert 3.5.5.4');
|
||||
Warnings:
|
||||
Warning 1265 Data truncated for column 'f1' at row 1
|
||||
Select * from dbtest_two.t2;
|
||||
Select * from dbtest_two.t2 order by f1;
|
||||
f1
|
||||
1st Insert 3.5.
|
||||
2nd Insert 3.5.
|
||||
|
@ -139,10 +139,10 @@ values ('1', 'Test 3.5.8.4', 222, 23456, 1.05);
|
||||
Select f120, f122, f136, f144, f163 from tb3 where f122= 'Test 3.5.8.4';
|
||||
f120 f122 f136 f144 f163
|
||||
1 Test 3.5.8.4 00222 0000023456 1.050000000000000000000000000000
|
||||
select * from db_test.t1_i;
|
||||
select * from db_test.t1_i order by i120;
|
||||
i120 i136 i144 i163
|
||||
1 00222 0000023456 1.050000000000000000000000000000
|
||||
select * from db_test.t1_u;
|
||||
select * from db_test.t1_u order by u120;
|
||||
u120 u136 u144 u163
|
||||
a 00111 0000099999 999.990000000000000000000000000000
|
||||
b 00222 0000023456 1.050000000000000000000000000000
|
||||
@ -150,7 +150,7 @@ c 00333 0000099999 999.990000000000000000000000000000
|
||||
d 00222 0000023456 1.050000000000000000000000000000
|
||||
e 00222 0000023456 1.050000000000000000000000000000
|
||||
f 00333 0000099999 999.990000000000000000000000000000
|
||||
select * from db_test.t1_d;
|
||||
select * from db_test.t1_d order by d120;
|
||||
d120 d136 d144 d163
|
||||
a 00111 0000099999 999.990000000000000000000000000000
|
||||
c 00333 0000099999 999.990000000000000000000000000000
|
||||
@ -162,14 +162,22 @@ select @test_var;
|
||||
3.5.8.4 - single SQL - insert
|
||||
-----------------------------
|
||||
Create trigger trg2 BEFORE UPDATE on tb3 for each row
|
||||
BEGIN
|
||||
insert into db_test.t1_i
|
||||
values (new.f120, new.f136, new.f144, new.f163);
|
||||
END//
|
||||
Select f120, f122, f136, f144, f163 from tb3 where f122 like 'Test 3.5.8.4%';
|
||||
f120 f122 f136 f144 f163
|
||||
1 Test 3.5.8.4 00222 0000023456 1.050000000000000000000000000000
|
||||
select * from db_test.t1_i order by i120;
|
||||
i120 i136 i144 i163
|
||||
1 00222 0000023456 1.050000000000000000000000000000
|
||||
update tb3 set f120='I', f122='Test 3.5.8.4-Single Insert'
|
||||
where f122='Test 3.5.8.4';
|
||||
Select f120, f122, f136, f144, f163 from tb3 where f122 like 'Test 3.5.8.4%';
|
||||
f120 f122 f136 f144 f163
|
||||
I Test 3.5.8.4-Single Insert 00222 0000023456 1.050000000000000000000000000000
|
||||
select * from db_test.t1_i;
|
||||
select * from db_test.t1_i order by i120;
|
||||
i120 i136 i144 i163
|
||||
1 00222 0000023456 1.050000000000000000000000000000
|
||||
I 00222 0000023456 1.050000000000000000000000000000
|
||||
@ -186,14 +194,14 @@ update tb3 set f120='U', f122='Test 3.5.8.4-Single Update'
|
||||
Select f120, f122, f136, f144, f163 from tb3 where f122 like 'Test 3.5.8.4%';
|
||||
f120 f122 f136 f144 f163
|
||||
U Test 3.5.8.4-Single Update 00222 0000023456 1.050000000000000000000000000000
|
||||
select * from db_test.t1_u;
|
||||
select * from db_test.t1_u order by u120;
|
||||
u120 u136 u144 u163
|
||||
a 00111 0000099999 999.990000000000000000000000000000
|
||||
U 00222 0000023456 1.050000000000000000000000000000
|
||||
c 00333 0000099999 999.990000000000000000000000000000
|
||||
U 00222 0000023456 1.050000000000000000000000000000
|
||||
U 00222 0000023456 1.050000000000000000000000000000
|
||||
f 00333 0000099999 999.990000000000000000000000000000
|
||||
U 00222 0000023456 1.050000000000000000000000000000
|
||||
U 00222 0000023456 1.050000000000000000000000000000
|
||||
U 00222 0000023456 1.050000000000000000000000000000
|
||||
|
||||
3.5.8.3/4 - single SQL - delete
|
||||
-------------------------------
|
||||
@ -206,7 +214,7 @@ f122='Test 3.5.8.4-Single Delete'
|
||||
Select f120, f122, f136, f144, f163 from tb3 where f122 like 'Test 3.5.8.4%';
|
||||
f120 f122 f136 f144 f163
|
||||
D Test 3.5.8.4-Single Delete 00444 0000023456 1.050000000000000000000000000000
|
||||
select * from db_test.t1_d;
|
||||
select * from db_test.t1_d order by d120;
|
||||
d120 d136 d144 d163
|
||||
a 00111 0000099999 999.990000000000000000000000000000
|
||||
c 00333 0000099999 999.990000000000000000000000000000
|
||||
@ -253,29 +261,29 @@ END//
|
||||
set @test_var='Empty', @test_var2=0;
|
||||
Insert into tb3 (f120, f122, f136) values ('1', 'Test 3.5.8.5-if', 101);
|
||||
select f120, f122, f136, @test_var, @test_var2
|
||||
from tb3 where f122 = 'Test 3.5.8.5-if';
|
||||
from tb3 where f122 = 'Test 3.5.8.5-if' order by f136;
|
||||
f120 f122 f136 @test_var @test_var2
|
||||
D Test 3.5.8.5-if 00101 one 2nd else
|
||||
Insert into tb3 (f120, f122, f136) values ('2', 'Test 3.5.8.5-if', 102);
|
||||
select f120, f122, f136, @test_var, @test_var2
|
||||
from tb3 where f122 = 'Test 3.5.8.5-if';
|
||||
from tb3 where f122 = 'Test 3.5.8.5-if' order by f136;
|
||||
f120 f122 f136 @test_var @test_var2
|
||||
D Test 3.5.8.5-if 00101 two 2nd else
|
||||
D Test 3.5.8.5-if 00102 two 2nd else
|
||||
Insert into tb3 (f120, f122, f136) values ('3', 'Test 3.5.8.5-if', 10);
|
||||
select f120, f122, f136, @test_var, @test_var2
|
||||
from tb3 where f122 = 'Test 3.5.8.5-if';
|
||||
from tb3 where f122 = 'Test 3.5.8.5-if' order by f136;
|
||||
f120 f122 f136 @test_var @test_var2
|
||||
d Test 3.5.8.5-if 00010 three 2nd if
|
||||
D Test 3.5.8.5-if 00101 three 2nd if
|
||||
D Test 3.5.8.5-if 00102 three 2nd if
|
||||
d Test 3.5.8.5-if 00010 three 2nd if
|
||||
Insert into tb3 (f120, f122, f136) values ('3', 'Test 3.5.8.5-if', 103);
|
||||
select f120, f122, f136, @test_var, @test_var2
|
||||
from tb3 where f122 = 'Test 3.5.8.5-if';
|
||||
from tb3 where f122 = 'Test 3.5.8.5-if' order by f136;
|
||||
f120 f122 f136 @test_var @test_var2
|
||||
d Test 3.5.8.5-if 00010 three 2nd else
|
||||
D Test 3.5.8.5-if 00101 three 2nd else
|
||||
D Test 3.5.8.5-if 00102 three 2nd else
|
||||
d Test 3.5.8.5-if 00010 three 2nd else
|
||||
D Test 3.5.8.5-if 00103 three 2nd else
|
||||
create trigger trg3 before update on tb3 for each row
|
||||
BEGIN
|
||||
@ -335,20 +343,20 @@ set @test_var='Empty';
|
||||
Insert into tb3 (f120, f122, f136, f144)
|
||||
values ('a', 'Test 3.5.8.5-case', 5, 7);
|
||||
select f120, f122, f136, f144, @test_var
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case';
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
|
||||
f120 f122 f136 f144 @test_var
|
||||
A Test 3.5.8.5-case 00125 0000000007 A*seven
|
||||
Insert into tb3 (f120, f122, f136, f144)
|
||||
values ('b', 'Test 3.5.8.5-case', 71,16);
|
||||
select f120, f122, f136, f144, @test_var
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case';
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
|
||||
f120 f122 f136 f144 @test_var
|
||||
A Test 3.5.8.5-case 00125 0000000007 B*0000000016
|
||||
B Test 3.5.8.5-case 00191 0000000016 B*0000000016
|
||||
Insert into tb3 (f120, f122, f136, f144)
|
||||
values ('c', 'Test 3.5.8.5-case', 80,1);
|
||||
select f120, f122, f136, f144, @test_var
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case';
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
|
||||
f120 f122 f136 f144 @test_var
|
||||
A Test 3.5.8.5-case 00125 0000000007 C=one
|
||||
B Test 3.5.8.5-case 00191 0000000016 C=one
|
||||
@ -358,34 +366,34 @@ values ('d', 'Test 3.5.8.5-case', 152);
|
||||
Warnings:
|
||||
Warning 1265 Data truncated for column 'f120' at row 1
|
||||
select f120, f122, f136, f144, @test_var
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case';
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
|
||||
f120 f122 f136 f144 @test_var
|
||||
1 Test 3.5.8.5-case 00152 0000099999 1*0000099999
|
||||
A Test 3.5.8.5-case 00125 0000000007 1*0000099999
|
||||
B Test 3.5.8.5-case 00191 0000000016 1*0000099999
|
||||
C Test 3.5.8.5-case 00200 0000000001 1*0000099999
|
||||
1 Test 3.5.8.5-case 00152 0000099999 1*0000099999
|
||||
Insert into tb3 (f120, f122, f136, f144)
|
||||
values ('e', 'Test 3.5.8.5-case', 200, 8);
|
||||
Warnings:
|
||||
Warning 1265 Data truncated for column 'f120' at row 1
|
||||
select f120, f122, f136, f144, @test_var
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case';
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
|
||||
f120 f122 f136 f144 @test_var
|
||||
1 Test 3.5.8.5-case 00152 0000099999 1=eight
|
||||
1 Test 3.5.8.5-case 00200 0000000008 1=eight
|
||||
A Test 3.5.8.5-case 00125 0000000007 1=eight
|
||||
B Test 3.5.8.5-case 00191 0000000016 1=eight
|
||||
C Test 3.5.8.5-case 00200 0000000001 1=eight
|
||||
1 Test 3.5.8.5-case 00152 0000099999 1=eight
|
||||
1 Test 3.5.8.5-case 00200 0000000008 1=eight
|
||||
Insert into tb3 (f120, f122, f136, f144)
|
||||
values ('f', 'Test 3.5.8.5-case', 100, 8);
|
||||
select f120, f122, f136, f144, @test_var
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case';
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
|
||||
f120 f122 f136 f144 @test_var
|
||||
1 Test 3.5.8.5-case 00152 0000099999 1=eight
|
||||
1 Test 3.5.8.5-case 00200 0000000008 1=eight
|
||||
A Test 3.5.8.5-case 00125 0000000007 1=eight
|
||||
B Test 3.5.8.5-case 00191 0000000016 1=eight
|
||||
C Test 3.5.8.5-case 00200 0000000001 1=eight
|
||||
1 Test 3.5.8.5-case 00152 0000099999 1=eight
|
||||
1 Test 3.5.8.5-case 00200 0000000008 1=eight
|
||||
create trigger trg3a before update on tb3 for each row
|
||||
BEGIN
|
||||
CASE
|
||||
|
@ -120,7 +120,7 @@ set @tr_var_af_118=old.f118, @tr_var_af_121=old.f121,
|
||||
Insert into tb3 (f122, f136, f163)
|
||||
values ('Test 3.5.9.3', 7, 123.17);
|
||||
Update tb3 Set f136=8 where f122='Test 3.5.9.3';
|
||||
select f118, f121, f122, f136, f163 from tb3 where f122='Test 3.5.9.3';
|
||||
select f118, f121, f122, f136, f163 from tb3 where f122='Test 3.5.9.3' order by f136;
|
||||
f118 f121 f122 f136 f163
|
||||
a NULL Test 3.5.9.3 00008 123.170000000000000000000000000000
|
||||
select @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122,
|
||||
@ -136,7 +136,7 @@ a NULL Test 3.5.9.3 7 123.170000000000000000000000000000
|
||||
@tr_var_af_118 @tr_var_af_121 @tr_var_af_122 @tr_var_af_136 @tr_var_af_163
|
||||
0 0 0 0 0
|
||||
delete from tb3 where f122='Test 3.5.9.3';
|
||||
select f118, f121, f122, f136, f163 from tb3 where f122='Test 3.5.9.3';
|
||||
select f118, f121, f122, f136, f163 from tb3 where f122='Test 3.5.9.3' order by f136;
|
||||
f118 f121 f122 f136 f163
|
||||
select @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122,
|
||||
@tr_var_b4_136, @tr_var_b4_163;
|
||||
@ -176,7 +176,7 @@ set @tr_var_af_118=new.f118, @tr_var_af_121=new.f121,
|
||||
Insert into tb3 (f122, f136, f151, f163)
|
||||
values ('Test 3.5.9.4', 7, DEFAULT, 995.24);
|
||||
select f118, f121, f122, f136, f151, f163 from tb3
|
||||
where f122 like 'Test 3.5.9.4%';
|
||||
where f122 like 'Test 3.5.9.4%' order by f163;
|
||||
f118 f121 f122 f136 f151 f163
|
||||
a NULL Test 3.5.9.4 00007 999 995.240000000000000000000000000000
|
||||
select @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122,
|
||||
@ -194,9 +194,9 @@ a NULL Test 3.5.9.4 7 999 995.240000000000000000000000000000
|
||||
Update tb3 Set f122='Test 3.5.9.4-trig', f136=NULL, f151=DEFAULT, f163=NULL
|
||||
where f122='Test 3.5.9.4';
|
||||
Warnings:
|
||||
Warning 1263 Column was set to data type implicit default; NULL supplied for NOT NULL column 'f136' at row 11
|
||||
Warning 1048 Column 'f136' cannot be null
|
||||
select f118, f121, f122, f136, f151, f163 from tb3
|
||||
where f122 like 'Test 3.5.9.4-trig';
|
||||
where f122 like 'Test 3.5.9.4-trig' order by f163;
|
||||
f118 f121 f122 f136 f151 f163
|
||||
a NULL Test 3.5.9.4-trig 00000 999 NULL
|
||||
select @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122,
|
||||
|
@ -87,7 +87,7 @@ Insert into vw11 (f122, f151) values ('Test 3.5.10.1/2/3', 1);
|
||||
Insert into vw11 (f122, f151) values ('Test 3.5.10.1/2/3', 2);
|
||||
Insert into vw11 (f122, f151) values ('Not in View', 3);
|
||||
select f121, f122, f151, f163
|
||||
from tb3 where f122 like 'Test 3.5.10.1/2/3%';
|
||||
from tb3 where f122 like 'Test 3.5.10.1/2/3%' order by f151;
|
||||
f121 f122 f151 f163
|
||||
NULL Test 3.5.10.1/2/3 1 111.110000000000000000000000000000
|
||||
NULL Test 3.5.10.1/2/3 2 111.110000000000000000000000000000
|
||||
@ -101,7 +101,7 @@ f121 f122 f151 f163
|
||||
NULL Not in View 3 111.110000000000000000000000000000
|
||||
Update vw11 set f163=1;
|
||||
select f121, f122, f151, f163 from tb3
|
||||
where f122 like 'Test 3.5.10.1/2/3%';
|
||||
where f122 like 'Test 3.5.10.1/2/3%' order by f151;
|
||||
f121 f122 f151 f163
|
||||
Y Test 3.5.10.1/2/3-Update 1 1.000000000000000000000000000000
|
||||
Y Test 3.5.10.1/2/3-Update 2 1.000000000000000000000000000000
|
||||
@ -115,7 +115,7 @@ before delete
|
||||
0
|
||||
delete from vw11 where f151=1;
|
||||
select f121, f122, f151, f163 from tb3
|
||||
where f122 like 'Test 3.5.10.1/2/3%';
|
||||
where f122 like 'Test 3.5.10.1/2/3%' order by f151;
|
||||
f121 f122 f151 f163
|
||||
Y Test 3.5.10.1/2/3-Update 2 1.000000000000000000000000000000
|
||||
select f121, f122, f151, f163 from vw11;
|
||||
@ -146,7 +146,7 @@ load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t9.txt' into table tb_load;
|
||||
select @counter as 'Rows Loaded After';
|
||||
Rows Loaded After
|
||||
10
|
||||
Select * from tb_load limit 10;
|
||||
Select * from tb_load order by f1 limit 10;
|
||||
f1 f2 f3
|
||||
-5000 a` 1000
|
||||
-4999 aaa 999
|
||||
@ -241,7 +241,7 @@ insert into t3 (f1) values (new.f1+1000);
|
||||
create trigger tr2_4 after insert on t2_4 for each row
|
||||
insert into t3 (f1) values (new.f1+10000);
|
||||
insert into t1 values (1);
|
||||
select * from t3;
|
||||
select * from t3 order by f1;
|
||||
f1
|
||||
12
|
||||
102
|
||||
@ -276,14 +276,14 @@ create trigger tr4 after insert on t4
|
||||
for each row insert into t1 (f1) values (new.f4+1);
|
||||
insert into t1 values (1);
|
||||
ERROR HY000: Can't update table 't1' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
|
||||
select * from t1;
|
||||
select * from t1 order by f1;
|
||||
f1
|
||||
0
|
||||
select * from t2;
|
||||
select * from t2 order by f2;
|
||||
f2
|
||||
select * from t3;
|
||||
select * from t3 order by f3;
|
||||
f3
|
||||
select * from t4;
|
||||
select * from t4 order by f4;
|
||||
f4
|
||||
drop trigger tr1;
|
||||
drop trigger tr2;
|
||||
@ -369,7 +369,7 @@ create table t4 (f4 tinyint) engine = innodb;
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`f1` int(11) default NULL
|
||||
`f1` int(11) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
||||
insert into t1 values (1);
|
||||
create trigger tr1 after insert on t1
|
||||
@ -381,14 +381,14 @@ for each row insert into t4 (f4) values (new.f3+1000);
|
||||
set autocommit=0;
|
||||
start transaction;
|
||||
insert into t1 values (1);
|
||||
ERROR 22003: Out of range value adjusted for column 'f4' at row 1
|
||||
ERROR 22003: Out of range value for column 'f4' at row 1
|
||||
commit;
|
||||
select * from t1;
|
||||
select * from t1 order by f1;
|
||||
f1
|
||||
1
|
||||
select * from t2;
|
||||
select * from t2 order by f2;
|
||||
f2
|
||||
select * from t3;
|
||||
select * from t3 order by f3;
|
||||
f3
|
||||
drop trigger tr1;
|
||||
drop trigger tr2;
|
||||
|
@ -116,7 +116,7 @@ insert into t1 values (3,'Department C');
|
||||
insert into t2 values (1,2,'Emp 1');
|
||||
insert into t2 values (2,3,'Emp 2');
|
||||
insert into t2 values (3,4,'Emp 3');
|
||||
ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test/t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`f_id`) REFERENCES `t1` (`id`) ON UPDATE CASCADE)
|
||||
ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`f_id`) REFERENCES `t1` (`id`) ON UPDATE CASCADE)
|
||||
create trigger tr_t2 before insert on t2 for each row
|
||||
insert into t1 values(new.f_id, concat('New Department ', new.f_id));
|
||||
lock tables t1 write, t2 write;
|
||||
|
@ -1926,7 +1926,7 @@ f1 f2
|
||||
2 two
|
||||
4 four
|
||||
INSERT INTO v1 VALUES(2,'two');
|
||||
ERROR 23000: Duplicate entry '2' for key 1
|
||||
ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
|
||||
INSERT INTO v1 VALUES(3,'three');
|
||||
affected rows: 1
|
||||
INSERT INTO v1 VALUES(6,'six');
|
||||
@ -1945,7 +1945,7 @@ f1 f2
|
||||
3 three
|
||||
4 four
|
||||
UPDATE v1 SET f1 = 2 WHERE f1 = 3;
|
||||
ERROR 23000: Duplicate entry '2' for key 1
|
||||
ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
|
||||
UPDATE v1 SET f2 = 'number' WHERE f1 = 3;
|
||||
affected rows: 1
|
||||
info: Rows matched: 1 Changed: 1 Warnings: 0
|
||||
@ -1992,12 +1992,12 @@ DROP VIEW IF EXISTS test.v1;
|
||||
CREATE TABLE t1 (f1 ENUM('A', 'B', 'C') NOT NULL, f2 INTEGER)
|
||||
ENGINE = innodb;
|
||||
INSERT INTO t1 VALUES ('A', 1);
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 order by f1, f2;
|
||||
f1 f2
|
||||
A 1
|
||||
CREATE VIEW v1 AS SELECT * FROM t1 WHERE f2 BETWEEN 1 AND 2
|
||||
WITH CASCADED CHECK OPTION ;
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by f1, f2;
|
||||
f1 f2
|
||||
A 1
|
||||
UPDATE v1 SET f2 = 2 WHERE f2 = 1;
|
||||
@ -2005,7 +2005,7 @@ affected rows: 1
|
||||
info: Rows matched: 1 Changed: 1 Warnings: 0
|
||||
INSERT INTO v1 VALUES('B',2);
|
||||
affected rows: 1
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by f1, f2;
|
||||
f1 f2
|
||||
A 2
|
||||
B 2
|
||||
@ -2013,7 +2013,7 @@ UPDATE v1 SET f2 = 4;
|
||||
ERROR HY000: CHECK OPTION failed 'test.v1'
|
||||
INSERT INTO v1 VALUES('B',3);
|
||||
ERROR HY000: CHECK OPTION failed 'test.v1'
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by f1, f2;
|
||||
f1 f2
|
||||
A 2
|
||||
B 2
|
||||
@ -10580,7 +10580,7 @@ f1 f2 f3 f4
|
||||
DELETE FROM t1;
|
||||
INSERT INTO v1 SET f2 = 'ABC';
|
||||
INSERT INTO v1 SET f2 = 'ABC';
|
||||
ERROR 23000: Duplicate entry '0' for key 1
|
||||
ERROR 23000: Duplicate entry '0' for key 'PRIMARY'
|
||||
SELECT * from t1;
|
||||
f1 f2 f3 f4
|
||||
0 ABC NULL NULL
|
||||
@ -10649,7 +10649,7 @@ DROP VIEW v1;
|
||||
CREATE VIEW v1 AS SELECT f2, f3 FROM t1;
|
||||
INSERT INTO v1 SET f2 = 'ABC';
|
||||
INSERT INTO v1 SET f2 = 'ABC';
|
||||
ERROR 23000: Duplicate entry '0' for key 1
|
||||
ERROR 23000: Duplicate entry '0' for key 'PRIMARY'
|
||||
SELECT * from t1;
|
||||
f1 f2 f3 f4
|
||||
0 ABC NULL NULL
|
||||
@ -10984,11 +10984,11 @@ f1 bigint(20) YES NULL
|
||||
f2 date YES NULL
|
||||
f4 char(5) YES NULL
|
||||
report char(10) YES NULL
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 order by f1, report;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by f1, report;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
@ -11008,12 +11008,12 @@ f4x char(5) YES NULL
|
||||
report char(10) YES NULL
|
||||
DESCRIBE v1;
|
||||
ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 order by f1, report;
|
||||
f1 f2 f4x report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
0 NULL ABC t1 1
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by f1, report;
|
||||
ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
|
||||
ALTER TABLE t1 CHANGE COLUMN f4x f4 CHAR(5);
|
||||
ALTER TABLE t1 CHANGE COLUMN f4 f4 CHAR(10);
|
||||
@ -11031,14 +11031,14 @@ f1 bigint(20) YES NULL
|
||||
f2 date YES NULL
|
||||
f4 char(10) YES NULL
|
||||
report char(10) YES NULL
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 order by f1, report;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
0 NULL ABC t1 1
|
||||
2 NULL <-- 10 --> t1 2
|
||||
2 NULL <-- 10 --> v1 2
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by f1, report;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
@ -11067,7 +11067,7 @@ f1 bigint(20) YES NULL
|
||||
f2 date YES NULL
|
||||
f4 char(8) YES NULL
|
||||
report char(10) YES NULL
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 order by f1, report;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
@ -11076,7 +11076,7 @@ f1 f2 f4 report
|
||||
2 NULL <-- 10 - v1 2
|
||||
3 NULL <-- 10 - t1 3
|
||||
3 NULL <-- 10 - v1 3
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by f1, report;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
@ -11100,7 +11100,7 @@ f1 bigint(20) YES NULL
|
||||
f2 date YES NULL
|
||||
f4 varchar(20) YES NULL
|
||||
report char(10) YES NULL
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 order by f1, report;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
@ -11111,7 +11111,7 @@ f1 f2 f4 report
|
||||
3 NULL <-- 10 - v1 3
|
||||
4 NULL <------ 20 --------> t1 4
|
||||
4 NULL <------ 20 --------> v1 4
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by f1, report;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
@ -11139,7 +11139,7 @@ f1 varchar(30) YES NULL
|
||||
f2 date YES NULL
|
||||
f4 varchar(20) YES NULL
|
||||
report char(10) YES NULL
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 order by f1, report;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
@ -11152,7 +11152,7 @@ f1 f2 f4 report
|
||||
4 NULL <------ 20 --------> v1 4
|
||||
<------------- 30 -----------> NULL <------ 20 --------> t1 5
|
||||
<------------- 30 -----------> NULL <------ 20 --------> v1 5
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by f1, report;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
@ -11176,7 +11176,7 @@ f4 varchar(20) YES NULL
|
||||
report char(10) YES NULL
|
||||
DESCRIBE v1;
|
||||
ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 order by f1, report;
|
||||
f1 f4 report
|
||||
-1 ABC t1 0
|
||||
-1 ABC v1 0
|
||||
@ -11190,7 +11190,7 @@ f1 f4 report
|
||||
<------------- 30 -----------> <------ 20 --------> t1 5
|
||||
<------------- 30 -----------> <------ 20 --------> v1 5
|
||||
ABC <------ 20 --------> t1 6
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by f1, report;
|
||||
ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
|
||||
ALTER TABLE t1 ADD COLUMN f2 DATE DEFAULT NULL;
|
||||
INSERT INTO t1 SET f1 = 'ABC', f2 = '1500-12-04',
|
||||
@ -11209,7 +11209,7 @@ f1 varchar(30) YES NULL
|
||||
f2 date YES NULL
|
||||
f4 varchar(20) YES NULL
|
||||
report char(10) YES NULL
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 order by f1, report;
|
||||
f1 f4 report f2
|
||||
-1 ABC t1 0 NULL
|
||||
-1 ABC v1 0 NULL
|
||||
@ -11225,7 +11225,7 @@ f1 f4 report f2
|
||||
ABC <------ 20 --------> t1 6 NULL
|
||||
ABC <------ 20 --------> t1 7 1500-12-04
|
||||
ABC <------ 20 --------> v1 7 1500-12-04
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by f1, report;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
@ -11259,7 +11259,7 @@ f1 varchar(30) YES NULL
|
||||
f2 float YES NULL
|
||||
f4 varchar(20) YES NULL
|
||||
report char(10) YES NULL
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 order by f1, report;
|
||||
f1 f4 report f2
|
||||
-1 ABC t1 0 NULL
|
||||
-1 ABC v1 0 NULL
|
||||
@ -11274,10 +11274,10 @@ f1 f4 report f2
|
||||
<------------- 30 -----------> <------ 20 --------> v1 5 NULL
|
||||
ABC <------ 20 --------> t1 6 NULL
|
||||
ABC <------ 20 --------> t1 7 NULL
|
||||
ABC <------ 20 --------> v1 7 NULL
|
||||
ABC <------ 20 --------> t1 8 -0.00033
|
||||
ABC <------ 20 --------> v1 7 NULL
|
||||
ABC <------ 20 --------> v1 8 -0.00033
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by f1, report;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
@ -11292,8 +11292,8 @@ f1 f2 f4 report
|
||||
<------------- 30 -----------> NULL <------ 20 --------> v1 5
|
||||
ABC NULL <------ 20 --------> t1 6
|
||||
ABC NULL <------ 20 --------> t1 7
|
||||
ABC NULL <------ 20 --------> v1 7
|
||||
ABC -0.00033 <------ 20 --------> t1 8
|
||||
ABC NULL <------ 20 --------> v1 7
|
||||
ABC -0.00033 <------ 20 --------> v1 8
|
||||
ALTER TABLE t1 ADD COLUMN f3 NUMERIC(7,2);
|
||||
INSERT INTO t1 SET f1 = 'ABC', f2 = -3.3E-4,
|
||||
@ -11316,7 +11316,7 @@ f1 varchar(30) YES NULL
|
||||
f2 float YES NULL
|
||||
f4 varchar(20) YES NULL
|
||||
report char(10) YES NULL
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 order by f1, report;
|
||||
f1 f4 report f2 f3
|
||||
-1 ABC t1 0 NULL NULL
|
||||
-1 ABC v1 0 NULL NULL
|
||||
@ -11331,12 +11331,12 @@ f1 f4 report f2 f3
|
||||
<------------- 30 -----------> <------ 20 --------> v1 5 NULL NULL
|
||||
ABC <------ 20 --------> t1 6 NULL NULL
|
||||
ABC <------ 20 --------> t1 7 NULL NULL
|
||||
ABC <------ 20 --------> v1 7 NULL NULL
|
||||
ABC <------ 20 --------> t1 8 -0.00033 NULL
|
||||
ABC <------ 20 --------> v1 8 -0.00033 NULL
|
||||
ABC <------ 20 --------> t1 9 -0.00033 -2.20
|
||||
ABC <------ 20 --------> v1 7 NULL NULL
|
||||
ABC <------ 20 --------> v1 8 -0.00033 NULL
|
||||
ABC <------ 20 --------> v1 9a -0.00033 NULL
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by f1, report;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
@ -11351,10 +11351,10 @@ f1 f2 f4 report
|
||||
<------------- 30 -----------> NULL <------ 20 --------> v1 5
|
||||
ABC NULL <------ 20 --------> t1 6
|
||||
ABC NULL <------ 20 --------> t1 7
|
||||
ABC NULL <------ 20 --------> v1 7
|
||||
ABC -0.00033 <------ 20 --------> t1 8
|
||||
ABC -0.00033 <------ 20 --------> v1 8
|
||||
ABC -0.00033 <------ 20 --------> t1 9
|
||||
ABC NULL <------ 20 --------> v1 7
|
||||
ABC -0.00033 <------ 20 --------> v1 8
|
||||
ABC -0.00033 <------ 20 --------> v1 9a
|
||||
DROP TABLE t1;
|
||||
DROP VIEW v1;
|
||||
@ -11369,10 +11369,10 @@ DESCRIBE v1;
|
||||
Field Type Null Key Default Extra
|
||||
f1 char(10) YES NULL
|
||||
my_sqrt double YES NULL
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 order by f1, f2;
|
||||
f1 f2
|
||||
ABC 3
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by 2;
|
||||
f1 my_sqrt
|
||||
ABC 1.7320508075689
|
||||
ALTER TABLE t1 CHANGE COLUMN f2 f2 VARCHAR(30);
|
||||
@ -11385,21 +11385,21 @@ DESCRIBE v1;
|
||||
Field Type Null Key Default Extra
|
||||
f1 char(10) YES NULL
|
||||
my_sqrt double YES NULL
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 order by f1, f2;
|
||||
f1 f2
|
||||
ABC 3
|
||||
ABC DEF
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by 2;
|
||||
f1 my_sqrt
|
||||
ABC 1.7320508075689
|
||||
ABC 0
|
||||
ABC 1.7320508075689
|
||||
SELECT SQRT('DEF');
|
||||
SQRT('DEF')
|
||||
0
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect DOUBLE value: 'DEF'
|
||||
CREATE VIEW v2 AS SELECT SQRT('DEF');
|
||||
SELECT * FROM v2;
|
||||
SELECT * FROM v2 order by 1;
|
||||
SQRT('DEF')
|
||||
0
|
||||
Warnings:
|
||||
@ -11409,27 +11409,27 @@ DESCRIBE v2;
|
||||
Field Type Null Key Default Extra
|
||||
f1 char(10) YES NULL
|
||||
my_sqrt double YES NULL
|
||||
SELECT * FROM v2;
|
||||
SELECT * FROM v2 order by 2;
|
||||
f1 my_sqrt
|
||||
ABC 0
|
||||
ABC 1.7320508075689
|
||||
ABC 0
|
||||
CREATE TABLE t2 AS SELECT f1, SQRT(f2) my_sqrt FROM t1;
|
||||
SELECT * FROM t2;
|
||||
SELECT * FROM t2 order by 2;
|
||||
f1 my_sqrt
|
||||
ABC 1.73205080756888
|
||||
ABC 0
|
||||
ABC 1.73205080756888
|
||||
DROP TABLE t2;
|
||||
CREATE TABLE t2 AS SELECT * FROM v1;
|
||||
SELECT * FROM t2;
|
||||
SELECT * FROM t2 order by 2;
|
||||
f1 my_sqrt
|
||||
ABC 1.73205080756888
|
||||
ABC 0
|
||||
ABC 1.73205080756888
|
||||
DROP TABLE t2;
|
||||
CREATE TABLE t2 AS SELECT * FROM v2;
|
||||
SELECT * FROM t2;
|
||||
SELECT * FROM t2 order by 2;
|
||||
f1 my_sqrt
|
||||
ABC 1.73205080756888
|
||||
ABC 0
|
||||
ABC 1.73205080756888
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
||||
DROP VIEW v1;
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -166,7 +166,7 @@ declare y integer default 1;
|
||||
set @x = x;
|
||||
set @y = y;
|
||||
set @z = 234;
|
||||
SELECT f1, f2 into @x, @y from t2 limit 1;
|
||||
SELECT f1, f2 into @x, @y from t2 where f1='a`' and f2='a`' limit 1;
|
||||
SELECT @x, @y, @z, invar;
|
||||
BEGIN
|
||||
set @x = 2;
|
||||
@ -209,7 +209,7 @@ BEGIN
|
||||
declare x integer; declare y integer;
|
||||
set @x=x;
|
||||
set @y=y;
|
||||
SELECT f4, f3 into @x, @y from t2 limit 1;
|
||||
SELECT f4, f3 into @x, @y from t2 where f4=-5000 and f3='1000-01-01' limit 1;
|
||||
SELECT @x, @y;
|
||||
END//
|
||||
CALL sp1();
|
||||
@ -544,6 +544,9 @@ exit handler 2
|
||||
exit handler 2
|
||||
exit handler 1
|
||||
exit handler 1
|
||||
Warnings:
|
||||
Note 1051 Unknown table 'tqq'
|
||||
Note 1051 Unknown table 'tqq'
|
||||
create table res_t1(w char unique, x char);
|
||||
insert into res_t1 values ('a', 'b');
|
||||
CREATE PROCEDURE h1 ()
|
||||
@ -1084,7 +1087,8 @@ declare f2_value char(20);
|
||||
declare f5_value char(20);
|
||||
declare f4_value integer;
|
||||
declare f6_value integer;
|
||||
declare cur1 cursor for SELECT f1, f2, f4, f5, f6 from t2 limit 3;
|
||||
declare cur1 cursor for SELECT f1, f2, f4, f5, f6 from t2
|
||||
where f4 >=-5000 order by f4 limit 3;
|
||||
open cur1;
|
||||
while proceed do
|
||||
SELECT count AS 'loop';
|
||||
@ -1167,7 +1171,7 @@ of a compound statement ends.
|
||||
DROP TABLE IF EXISTS temp1;
|
||||
DROP PROCEDURE IF EXISTS sp1;
|
||||
create table temp1( f0 char(20), f1 char(20), f2 char(20), f3 int, f4 char(20) );
|
||||
SELECT f1, f2, f4, f5 from t2;
|
||||
SELECT f1, f2, f4, f5 from t2 order by f4;
|
||||
f1 f2 f4 f5
|
||||
a` a` -5000 a`
|
||||
aaa aaa -4999 aaa
|
||||
@ -1187,21 +1191,21 @@ declare newf1 char(20);
|
||||
declare newf2 char(20);
|
||||
declare newf5 char(20);
|
||||
declare newf4 integer;
|
||||
declare cur1 cursor for SELECT f1, f2, f4, f5 from t2 limit 5;
|
||||
declare cur2 cursor for SELECT f1, f2, f4, f5 from t2 limit 5;
|
||||
declare cur1 cursor for SELECT f1, f2, f4, f5 from t2 where f4 >= -5000 order by f4 limit 5;
|
||||
declare cur2 cursor for SELECT f1, f2, f4, f5 from t2 where f4 >= -5000 order by f4 limit 5;
|
||||
open cur1;
|
||||
open cur2;
|
||||
BEGIN
|
||||
declare continue handler for sqlstate '02000' set count = 1;
|
||||
declare continue handler for sqlstate '02000' set count=1;
|
||||
fetch cur1 into newf1, newf2, newf4, newf5;
|
||||
SELECT '-1-', count, newf1, newf2, newf4, newf5;
|
||||
insert into temp1 values ('cur1_out', newf1, newf2, newf4, newf5);
|
||||
set count = 4;
|
||||
set count= 4;
|
||||
BEGIN
|
||||
while count > 0 do
|
||||
while count> 0 do
|
||||
fetch cur1 into newf1, newf2, newf4, newf5;
|
||||
SELECT '-2-', count, newf1, newf2, newf4, newf5;
|
||||
set count = count - 1;
|
||||
set count = count- 1;
|
||||
END while;
|
||||
SELECT '-3-', count, newf1, newf2, newf4, newf4;
|
||||
END;
|
||||
@ -1270,8 +1274,10 @@ declare i_newf11 char(20);
|
||||
declare i_newf12 char(20);
|
||||
declare i_newf13 date;
|
||||
declare i_newf14 integer;
|
||||
declare cur1 cursor for SELECT f1, f2, f3, f4 from t2 limit 4;
|
||||
declare cur2 cursor for SELECT f1, f2, f3, f4 from t2 limit 3;
|
||||
declare cur1 cursor for SELECT f1, f2, f3, f4 from t2
|
||||
where f4>=-5000 order by f4 limit 4;
|
||||
declare cur2 cursor for SELECT f1, f2, f3, f4 from t2
|
||||
where f4>=-5000 order by f4 limit 3;
|
||||
declare continue handler for sqlstate '02000' set proceed=0;
|
||||
open cur1;
|
||||
open cur2;
|
||||
@ -1302,8 +1308,10 @@ DECLARE o_newf11 CHAR(20);
|
||||
DECLARE o_newf12 CHAR(20);
|
||||
DECLARE o_newf13 DATE;
|
||||
DECLARE o_newf14 INTEGER;
|
||||
DECLARE cur1 CURSOR FOR SELECT f1, f2, f3, f4 FROM t2 LIMIT 5;
|
||||
DECLARE cur2 CURSOR FOR SELECT f1, f2, f3, f4 FROM t2 LIMIT 5;
|
||||
DECLARE cur1 CURSOR FOR SELECT f1, f2, f3, f4 FROM t2
|
||||
WHERE f4>=-5000 ORDER BY f4 LIMIT 5;
|
||||
DECLARE cur2 CURSOR FOR SELECT f1, f2, f3, f4 FROM t2
|
||||
WHERE f4>=-5000 ORDER BY f4 LIMIT 5;
|
||||
DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET proceed=0;
|
||||
OPEN cur1;
|
||||
OPEN cur2;
|
||||
|
@ -80,7 +80,7 @@ connect(localhost,user_1,,db_storedproc,MYSQL_PORT,MYSQL_SOCK);
|
||||
user_1@localhost db_storedproc
|
||||
CREATE PROCEDURE sp31102 () SQL SECURITY INVOKER
|
||||
BEGIN
|
||||
SELECT * FROM db_storedproc.t1 LIMIT 1;
|
||||
SELECT * FROM db_storedproc.t1 WHERE f4=-5000 LIMIT 1;
|
||||
END//
|
||||
CREATE FUNCTION fn31105(n INT) RETURNS INT
|
||||
BEGIN
|
||||
@ -209,7 +209,7 @@ CALL sp_ins_1();
|
||||
SELECT row_count();
|
||||
row_count()
|
||||
1
|
||||
SELECT * FROM temp;
|
||||
SELECT * FROM temp ORDER BY f4;
|
||||
f1 f2 f3 f4 f5 f6
|
||||
a` a` 1000-01-01 -5000 a` -5000
|
||||
aaa aaa 1000-01-02 -4999 aaa -4999
|
||||
@ -226,7 +226,7 @@ CALL sp_ins_3();
|
||||
SELECT row_count();
|
||||
row_count()
|
||||
1
|
||||
SELECT * FROM temp;
|
||||
SELECT * FROM temp ORDER BY f4;
|
||||
f1 f2 f3 f4 f5 f6
|
||||
a` a` 1000-01-01 -5000 a` -5000
|
||||
aaa aaa 1000-01-02 -4999 aaa -4999
|
||||
@ -246,7 +246,7 @@ CALL sp_upd();
|
||||
SELECT row_count();
|
||||
row_count()
|
||||
4
|
||||
SELECT * FROM temp;
|
||||
SELECT * FROM temp ORDER BY f4;
|
||||
f1 f2 f3 f4 f5 f6
|
||||
a` a` 1000-01-01 -5000 a` -5000
|
||||
aaa aaa 1000-01-02 -4999 aaa -4999
|
||||
@ -279,7 +279,7 @@ COUNT( f1 ) f1
|
||||
SELECT row_count();
|
||||
row_count()
|
||||
3
|
||||
SELECT * FROM temp;
|
||||
SELECT * FROM temp ORDER BY f4;
|
||||
f1 f2 f3 f4 f5 f6
|
||||
a` a` 1000-01-01 -5000 a` -5000
|
||||
aaa aaa 1000-01-02 -4999 aaa -4999
|
||||
|
@ -195,6 +195,9 @@ CREATE TRIGGER trg5_1 BEFORE INSERT on test.t1
|
||||
for each row set new.f3 = '14';
|
||||
CREATE TRIGGER trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ
|
||||
BEFORE UPDATE on test.t1 for each row set new.f3 = '42';
|
||||
ERROR 42000: Identifier name 'trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ' is too long
|
||||
CREATE TRIGGER trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWX
|
||||
BEFORE UPDATE on test.t1 for each row set new.f3 = '42';
|
||||
insert into t1 (f2) values ('insert 3.5.1.7');
|
||||
select * from t1;
|
||||
f1 f2 f3
|
||||
@ -203,12 +206,14 @@ update t1 set f2='update 3.5.1.7';
|
||||
select * from t1;
|
||||
f1 f2 f3
|
||||
NULL update 3.5.1.7 42
|
||||
select trigger_name from information_schema.triggers;
|
||||
select trigger_name from information_schema.triggers order by trigger_name;
|
||||
trigger_name
|
||||
trg5_1
|
||||
trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWX
|
||||
drop trigger trg5_1;
|
||||
drop trigger trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ;
|
||||
ERROR 42000: Identifier name 'trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ' is too long
|
||||
drop trigger trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWX;
|
||||
drop table t1;
|
||||
|
||||
Testcase 3.5.1.8:
|
||||
@ -310,7 +315,7 @@ insert into trig_db3.t1 (f1,f2) values ('insert to db3 t1 from db1',4);
|
||||
select @test_var1, @test_var2, @test_var3;
|
||||
@test_var1 @test_var2 @test_var3
|
||||
trig1 trig2 trig3
|
||||
select * from t1;
|
||||
select * from t1 order by f2;
|
||||
f1 f2
|
||||
trig1 1
|
||||
trig1 2
|
||||
@ -320,7 +325,7 @@ trig2 3
|
||||
select * from trig_db3.t1;
|
||||
f1 f2
|
||||
trig3 4
|
||||
select * from t1;
|
||||
select * from t1 order by f2;
|
||||
f1 f2
|
||||
trig1 1
|
||||
trig1 2
|
||||
@ -345,10 +350,10 @@ for each row set @test_var2='trig1_a';
|
||||
create trigger trig_db2.trig2 before insert on trig_db2.t1
|
||||
for each row set @test_var3='trig2';
|
||||
select trigger_schema, trigger_name, event_object_table
|
||||
from information_schema.triggers;
|
||||
from information_schema.triggers order by trigger_name;
|
||||
trigger_schema trigger_name event_object_table
|
||||
trig_db1 trig1_b t1
|
||||
trig_db1 trig1_a t1
|
||||
trig_db1 trig1_b t1
|
||||
trig_db2 trig2 t1
|
||||
set @test_var1= '', @test_var2= '', @test_var3= '';
|
||||
insert into t1 (f1,f2) values ('insert to db1 t1 from db1',352);
|
||||
|
@ -78,16 +78,16 @@ Testcase 3.5.3.2/6:
|
||||
-------------------
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
|
||||
grant ALL on *.* to test_noprivs@localhost;
|
||||
revoke SUPER on *.* from test_noprivs@localhost;
|
||||
revoke TRIGGER on *.* from test_noprivs@localhost;
|
||||
show grants for test_noprivs@localhost;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
|
||||
grant SUPER on *.* to test_yesprivs@localhost;
|
||||
grant TRIGGER on *.* to test_yesprivs@localhost;
|
||||
grant SELECT on priv_db.t1 to test_yesprivs@localhost;
|
||||
show grants for test_yesprivs@localhost;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
|
||||
connect(localhost,test_noprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
|
||||
connect(localhost,test_yesprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
|
||||
@ -100,10 +100,10 @@ test_noprivs@localhost
|
||||
use priv_db;
|
||||
create trigger trg1_1 before INSERT on t1 for each row
|
||||
set new.f1 = 'trig 3.5.3.2_1-no';
|
||||
ERROR 42000: Access denied; you need the SUPER privilege for this operation
|
||||
Got one of the listed errors
|
||||
use priv_db;
|
||||
insert into t1 (f1) values ('insert 3.5.3.2-no');
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
select current_user;
|
||||
@ -118,15 +118,12 @@ root@localhost
|
||||
use priv_db;
|
||||
insert into t1 (f1) values ('insert 3.5.3.2-yes');
|
||||
ERROR 42000: UPDATE command denied to user 'test_yesprivs'@'localhost' for column 'f1' in table 't1'
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
grant UPDATE on priv_db.t1 to test_yesprivs@localhost;
|
||||
|
||||
note: once 15166 is fixed a similar case for SELECT needs to be added
|
||||
---------------------------------------------------------------------
|
||||
insert into t1 (f1) values ('insert 3.5.3.2-yes');
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
trig 3.5.3.2_2-yes
|
||||
@ -135,10 +132,10 @@ Testcase 3.5.3.6:
|
||||
-----------------
|
||||
use priv_db;
|
||||
drop trigger trg1_2;
|
||||
ERROR 42000: Access denied; you need the SUPER privilege for this operation
|
||||
Got one of the listed errors
|
||||
use priv_db;
|
||||
insert into t1 (f1) values ('insert 3.5.3.6-yes');
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
trig 3.5.3.2_2-yes
|
||||
@ -147,12 +144,12 @@ use priv_db;
|
||||
drop trigger trg1_2;
|
||||
use priv_db;
|
||||
insert into t1 (f1) values ('insert 3.5.3.6-no');
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
insert 3.5.3.6-no
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
drop trigger trg1_2;
|
||||
|
||||
Testcase 3.5.3.7a:
|
||||
@ -162,12 +159,12 @@ grant ALL on *.* to test_noprivs@localhost;
|
||||
revoke UPDATE on *.* from test_noprivs@localhost;
|
||||
show grants for test_noprivs@localhost;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
|
||||
grant SUPER, UPDATE on *.* to test_yesprivs@localhost;
|
||||
grant TRIGGER, UPDATE on *.* to test_yesprivs@localhost;
|
||||
show grants for test_yesprivs@localhost;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT UPDATE, SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT UPDATE, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
connect(localhost,test_noprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
|
||||
connect(localhost,test_yesprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
|
||||
select current_user;
|
||||
@ -176,24 +173,24 @@ test_noprivs@localhost
|
||||
use priv_db;
|
||||
show grants;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
select f1 from t1;
|
||||
GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
insert 3.5.3.6-no
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
|
||||
Trigger create disabled - should fail - Bug 8884
|
||||
------------------------------------------------
|
||||
insert into t1 (f1) values ('insert 3.5.3.7-1a');
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
insert 3.5.3.6-no
|
||||
insert 3.5.3.7-1a
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
drop trigger trg4a_1;
|
||||
use priv_db;
|
||||
select current_user;
|
||||
@ -201,236 +198,220 @@ current_user
|
||||
test_yesprivs@localhost
|
||||
show grants;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT UPDATE, SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT UPDATE, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
create trigger trg4a_2 before INSERT on t1 for each row
|
||||
set new.f1 = 'trig 3.5.3.7-2a';
|
||||
|
||||
SELECT priv added to bypass bug 15166
|
||||
-------------------------------------
|
||||
grant SELECT on *.* to test_yesprivs@localhost;
|
||||
insert into t1 (f1) values ('insert 3.5.3.7-2b');
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
insert 3.5.3.6-no
|
||||
insert 3.5.3.7-1a
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.7-2a
|
||||
drop trigger trg4a_2;
|
||||
|
||||
Testcase 3.5.3.7b:
|
||||
------------------
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
|
||||
grant SUPER on *.* to test_noprivs;
|
||||
grant TRIGGER on *.* to test_noprivs;
|
||||
grant ALL on priv_db.* to test_noprivs@localhost;
|
||||
revoke UPDATE on priv_db.* from test_noprivs@localhost;
|
||||
show grants for test_noprivs;
|
||||
Grants for test_noprivs@%
|
||||
GRANT SUPER ON *.* TO 'test_noprivs'@'%'
|
||||
GRANT TRIGGER ON *.* TO 'test_noprivs'@'%'
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
|
||||
grant SUPER on *.* to test_yesprivs@localhost;
|
||||
grant TRIGGER on *.* to test_yesprivs@localhost;
|
||||
grant UPDATE on priv_db.* to test_yesprivs@localhost;
|
||||
show grants for test_yesprivs@localhost;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT UPDATE ON `priv_db`.* TO 'test_yesprivs'@'localhost'
|
||||
connect(localhost,test_noprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
|
||||
connect(localhost,test_yesprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
|
||||
show grants;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE ON `priv_db`.* TO 'test_noprivs'@'localhost'
|
||||
GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER ON `priv_db`.* TO 'test_noprivs'@'localhost'
|
||||
use priv_db;
|
||||
|
||||
Trigger create disabled - should fail - Bug 8884
|
||||
------------------------------------------------
|
||||
insert into t1 (f1) values ('insert 3.5.3.7-1b');
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
insert 3.5.3.6-no
|
||||
insert 3.5.3.7-1a
|
||||
trig 3.5.3.7-2a
|
||||
insert 3.5.3.7-1b
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.7-2a
|
||||
update t1 set f1 = 'update 3.5.3.7-1b' where f1 = 'insert 3.5.3.7-1b';
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
insert 3.5.3.6-no
|
||||
insert 3.5.3.7-1a
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.7-2a
|
||||
update 3.5.3.7-1b
|
||||
drop trigger trg4b_1;
|
||||
show grants;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT UPDATE ON `priv_db`.* TO 'test_yesprivs'@'localhost'
|
||||
use priv_db;
|
||||
create trigger trg4b_2 before UPDATE on t1 for each row
|
||||
set new.f1 = 'trig 3.5.3.7-2b';
|
||||
|
||||
SELECT priv added to bypass bug 15166
|
||||
-------------------------------------
|
||||
grant SELECT on priv_db.* to test_yesprivs@localhost;
|
||||
insert into t1 (f1) values ('insert 3.5.3.7-2b');
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
insert 3.5.3.6-no
|
||||
insert 3.5.3.7-1a
|
||||
trig 3.5.3.7-2a
|
||||
update 3.5.3.7-1b
|
||||
insert 3.5.3.7-2b
|
||||
update t1 set f1 = 'update 3.5.3.7-2b' where f1 = 'insert 3.5.3.7-2b';
|
||||
select f1 from t1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
insert 3.5.3.6-no
|
||||
insert 3.5.3.7-1a
|
||||
trig 3.5.3.7-2a
|
||||
update 3.5.3.7-1b
|
||||
update t1 set f1 = 'update 3.5.3.7-2b' where f1 = 'insert 3.5.3.7-2b';
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
insert 3.5.3.6-no
|
||||
insert 3.5.3.7-1a
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.7-2a
|
||||
trig 3.5.3.7-2b
|
||||
update 3.5.3.7-1b
|
||||
drop trigger trg4b_2;
|
||||
|
||||
Testcase 3.5.3.7c
|
||||
-----------------
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
|
||||
grant SUPER on *.* to test_noprivs@localhost;
|
||||
grant TRIGGER on *.* to test_noprivs@localhost;
|
||||
grant ALL on priv_db.t1 to test_noprivs@localhost;
|
||||
revoke UPDATE on priv_db.t1 from test_noprivs@localhost;
|
||||
show grants for test_noprivs;
|
||||
Grants for test_noprivs@%
|
||||
GRANT SUPER ON *.* TO 'test_noprivs'@'%'
|
||||
GRANT TRIGGER ON *.* TO 'test_noprivs'@'%'
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
|
||||
grant SUPER on *.* to test_yesprivs@localhost;
|
||||
grant TRIGGER on *.* to test_yesprivs@localhost;
|
||||
grant UPDATE on priv_db.t1 to test_yesprivs@localhost;
|
||||
show grants for test_yesprivs@localhost;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
|
||||
connect(localhost,test_noprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
|
||||
connect(localhost,test_yesprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
|
||||
show grants;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
|
||||
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
|
||||
use priv_db;
|
||||
|
||||
Trigger create disabled - should fail - Bug 8884
|
||||
------------------------------------------------
|
||||
insert into t1 (f1) values ('insert 3.5.3.7-1c');
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
insert 3.5.3.6-no
|
||||
insert 3.5.3.7-1a
|
||||
trig 3.5.3.7-2a
|
||||
update 3.5.3.7-1b
|
||||
trig 3.5.3.7-2b
|
||||
insert 3.5.3.7-1c
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.7-2a
|
||||
trig 3.5.3.7-2b
|
||||
update 3.5.3.7-1b
|
||||
drop trigger trg4c_1;
|
||||
show grants;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
|
||||
use priv_db;
|
||||
create trigger trg4c_2 before INSERT on t1 for each row
|
||||
set new.f1 = 'trig 3.5.3.7-2c';
|
||||
|
||||
SELECT priv added to bypass bug 15166
|
||||
-------------------------------------
|
||||
grant SELECT on priv_db.t1 to test_yesprivs@localhost;
|
||||
insert into t1 (f1) values ('insert 3.5.3.7-2c');
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
insert 3.5.3.6-no
|
||||
insert 3.5.3.7-1a
|
||||
trig 3.5.3.7-2a
|
||||
update 3.5.3.7-1b
|
||||
trig 3.5.3.7-2b
|
||||
insert 3.5.3.7-1c
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.7-2a
|
||||
trig 3.5.3.7-2b
|
||||
trig 3.5.3.7-2c
|
||||
update 3.5.3.7-1b
|
||||
drop trigger trg4c_2;
|
||||
|
||||
Testcase 3.5.3.7d:
|
||||
------------------
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
|
||||
grant SUPER on *.* to test_noprivs@localhost;
|
||||
grant TRIGGER on *.* to test_noprivs@localhost;
|
||||
grant SELECT (f1), INSERT (f1) on priv_db.t1 to test_noprivs@localhost;
|
||||
show grants for test_noprivs;
|
||||
Grants for test_noprivs@%
|
||||
GRANT SUPER ON *.* TO 'test_noprivs'@'%'
|
||||
GRANT TRIGGER ON *.* TO 'test_noprivs'@'%'
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
|
||||
grant SUPER on *.* to test_yesprivs@localhost;
|
||||
grant TRIGGER on *.* to test_yesprivs@localhost;
|
||||
grant UPDATE (f1) on priv_db.t1 to test_yesprivs@localhost;
|
||||
show grants for test_noprivs;
|
||||
Grants for test_noprivs@%
|
||||
GRANT SUPER ON *.* TO 'test_noprivs'@'%'
|
||||
GRANT TRIGGER ON *.* TO 'test_noprivs'@'%'
|
||||
connect(localhost,test_noprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
|
||||
connect(localhost,test_yesprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
|
||||
show grants;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT (f1), INSERT (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
|
||||
use priv_db;
|
||||
|
||||
Trigger create disabled - should fail - Bug 8884
|
||||
------------------------------------------------
|
||||
insert into t1 (f1) values ('insert 3.5.3.7-1d');
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
insert 3.5.3.6-no
|
||||
insert 3.5.3.7-1a
|
||||
trig 3.5.3.7-2a
|
||||
update 3.5.3.7-1b
|
||||
trig 3.5.3.7-2b
|
||||
insert 3.5.3.7-1c
|
||||
trig 3.5.3.7-2c
|
||||
insert 3.5.3.7-1d
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.7-2a
|
||||
trig 3.5.3.7-2b
|
||||
trig 3.5.3.7-2c
|
||||
update 3.5.3.7-1b
|
||||
drop trigger trg4d_1;
|
||||
show grants;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT UPDATE (f1) ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
|
||||
use priv_db;
|
||||
create trigger trg4d_2 before INSERT on t1 for each row
|
||||
set new.f1 = 'trig 3.5.3.7-2d';
|
||||
|
||||
SELECT priv added to bypass bug 15166
|
||||
-------------------------------------
|
||||
grant SELECT (f1) on priv_db.t1 to test_yesprivs@localhost;
|
||||
insert into t1 (f1) values ('insert 3.5.3.7-2d');
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
insert 3.5.3.6-no
|
||||
insert 3.5.3.7-1a
|
||||
trig 3.5.3.7-2a
|
||||
update 3.5.3.7-1b
|
||||
trig 3.5.3.7-2b
|
||||
insert 3.5.3.7-1c
|
||||
trig 3.5.3.7-2c
|
||||
insert 3.5.3.7-1d
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.7-2a
|
||||
trig 3.5.3.7-2b
|
||||
trig 3.5.3.7-2c
|
||||
trig 3.5.3.7-2d
|
||||
update 3.5.3.7-1b
|
||||
drop trigger trg4d_2;
|
||||
|
||||
Testcase 3.5.3.8a:
|
||||
@ -440,12 +421,12 @@ grant ALL on *.* to test_noprivs@localhost;
|
||||
revoke SELECT on *.* from test_noprivs@localhost;
|
||||
show grants for test_noprivs@localhost;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
|
||||
grant SUPER, SELECT on *.* to test_yesprivs@localhost;
|
||||
grant TRIGGER, SELECT on *.* to test_yesprivs@localhost;
|
||||
show grants for test_yesprivs@localhost;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT SELECT, SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
connect(localhost,test_noprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
|
||||
connect(localhost,test_yesprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
|
||||
select current_user;
|
||||
@ -454,7 +435,7 @@ test_noprivs@localhost
|
||||
use priv_db;
|
||||
show grants;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
|
||||
Trigger create disabled - should fail - Bug 8887
|
||||
------------------------------------------------
|
||||
@ -473,17 +454,13 @@ current_user
|
||||
test_yesprivs@localhost
|
||||
show grants;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT SELECT, SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
create trigger trg5a_2 before INSERT on t1 for each row
|
||||
set @test_var= new.f1;
|
||||
set @test_var= 'before trig 3.5.3.8-2a';
|
||||
select @test_var;
|
||||
@test_var
|
||||
before trig 3.5.3.8-2a
|
||||
|
||||
UPDATE priv added to bypass bug 15166
|
||||
-------------------------------------
|
||||
grant UPDATE on *.* to test_yesprivs@localhost;
|
||||
insert into t1 (f1) values ('insert 3.5.3.8-2a');
|
||||
select @test_var;
|
||||
@test_var
|
||||
@ -493,26 +470,26 @@ drop trigger trg5a_2;
|
||||
Testcase: 3.5.3.8b
|
||||
------------------
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
|
||||
grant SUPER on *.* to test_noprivs@localhost;
|
||||
grant TRIGGER on *.* to test_noprivs@localhost;
|
||||
grant ALL on priv_db.* to test_noprivs@localhost;
|
||||
revoke SELECT on priv_db.* from test_noprivs@localhost;
|
||||
show grants for test_noprivs@localhost;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE ON `priv_db`.* TO 'test_noprivs'@'localhost'
|
||||
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER ON `priv_db`.* TO 'test_noprivs'@'localhost'
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
|
||||
grant SUPER on *.* to test_yesprivs@localhost;
|
||||
grant TRIGGER on *.* to test_yesprivs@localhost;
|
||||
grant SELECT on priv_db.* to test_yesprivs@localhost;
|
||||
show grants for test_yesprivs@localhost;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT ON `priv_db`.* TO 'test_yesprivs'@'localhost'
|
||||
connect(localhost,test_noprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
|
||||
connect(localhost,test_yesprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
|
||||
show grants;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE ON `priv_db`.* TO 'test_noprivs'@'localhost'
|
||||
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER ON `priv_db`.* TO 'test_noprivs'@'localhost'
|
||||
use priv_db;
|
||||
|
||||
Trigger create disabled - should fail - Bug 8887
|
||||
@ -529,7 +506,7 @@ before trig 3.5.3.8-1b
|
||||
drop trigger trg5b_1;
|
||||
show grants;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT ON `priv_db`.* TO 'test_yesprivs'@'localhost'
|
||||
use priv_db;
|
||||
create trigger trg5b_2 before UPDATE on t1 for each row
|
||||
@ -539,10 +516,6 @@ insert into t1 (f1) values ('insert 3.5.3.8-2b');
|
||||
select @test_var;
|
||||
@test_var
|
||||
before trig 3.5.3.8-2b
|
||||
|
||||
UPDATE priv added to bypass bug 15166
|
||||
-------------------------------------
|
||||
grant UPDATE on priv_db.* to test_yesprivs@localhost;
|
||||
update t1 set f1= 'update 3.5.3.8-2b' where f1 = 'insert 3.5.3.8-2b';
|
||||
select @test_var;
|
||||
@test_var
|
||||
@ -552,26 +525,26 @@ drop trigger trg5b_2;
|
||||
Testcase 3.5.3.8c:
|
||||
------------------
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
|
||||
grant SUPER on *.* to test_noprivs@localhost;
|
||||
grant TRIGGER on *.* to test_noprivs@localhost;
|
||||
grant ALL on priv_db.t1 to test_noprivs@localhost;
|
||||
revoke SELECT on priv_db.t1 from test_noprivs@localhost;
|
||||
show grants for test_noprivs@localhost;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
|
||||
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
|
||||
grant SUPER on *.* to test_yesprivs@localhost;
|
||||
grant TRIGGER on *.* to test_yesprivs@localhost;
|
||||
grant SELECT on priv_db.t1 to test_yesprivs@localhost;
|
||||
show grants for test_yesprivs@localhost;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
|
||||
connect(localhost,test_noprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
|
||||
connect(localhost,test_yesprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
|
||||
show grants;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
|
||||
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
|
||||
use priv_db;
|
||||
|
||||
Trigger create disabled - should fail - Bug 8887
|
||||
@ -584,16 +557,12 @@ before trig 3.5.3.8-1c
|
||||
drop trigger trg5c_1;
|
||||
show grants;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
|
||||
use priv_db;
|
||||
create trigger trg5c_2 before INSERT on t1 for each row
|
||||
set @test_var= new.f1;
|
||||
set @test_var='before trig 3.5.3.8-2c';
|
||||
|
||||
UPDATE priv added to bypass bug 15166
|
||||
-------------------------------------
|
||||
grant UPDATE on priv_db.t1 to test_yesprivs@localhost;
|
||||
insert into t1 (f1) values ('insert 3.5.3.8-2c');
|
||||
select @test_var;
|
||||
@test_var
|
||||
@ -603,24 +572,24 @@ drop trigger trg5c_2;
|
||||
Testcase: 3.5.3.8d:
|
||||
-------------------
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
|
||||
grant SUPER on *.* to test_noprivs@localhost;
|
||||
grant TRIGGER on *.* to test_noprivs@localhost;
|
||||
grant UPDATE (f1), INSERT (f1) on priv_db.t1 to test_noprivs@localhost;
|
||||
show grants for test_noprivs@localhost;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
|
||||
grant SUPER on *.* to test_yesprivs@localhost;
|
||||
grant TRIGGER on *.* to test_yesprivs@localhost;
|
||||
grant SELECT (f1) on priv_db.t1 to test_yesprivs@localhost;
|
||||
show grants for test_noprivs@localhost;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
|
||||
connect(localhost,test_noprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
|
||||
connect(localhost,test_yesprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
|
||||
show grants;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
|
||||
use priv_db;
|
||||
|
||||
@ -634,16 +603,12 @@ before trig 3.5.3.8-1d
|
||||
drop trigger trg5d_1;
|
||||
show grants;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT (f1) ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
|
||||
use priv_db;
|
||||
create trigger trg5d_2 before INSERT on t1 for each row
|
||||
set @test_var= new.f1;
|
||||
set @test_var='before trig 3.5.3.8-2d';
|
||||
|
||||
UPDATE priv added to bypass bug 15166
|
||||
-------------------------------------
|
||||
grant UPDATE (f1) on priv_db.t1 to test_yesprivs@localhost;
|
||||
insert into t1 (f1) values ('insert 3.5.3.8-2d');
|
||||
select @test_var;
|
||||
@test_var
|
||||
@ -658,12 +623,12 @@ drop table if exists t2;
|
||||
create table t1 (f1 int) engine= memory;
|
||||
create table t2 (f2 int) engine= memory;
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
|
||||
grant SUPER on *.* to test_yesprivs@localhost;
|
||||
grant TRIGGER on *.* to test_yesprivs@localhost;
|
||||
grant SELECT, UPDATE on priv_db.t1 to test_yesprivs@localhost;
|
||||
grant SELECT on priv_db.t2 to test_yesprivs@localhost;
|
||||
show grants for test_yesprivs@localhost;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT ON `priv_db`.`t2` TO 'test_yesprivs'@'localhost'
|
||||
GRANT SELECT, UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
|
||||
connect(localhost,test_yesprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
|
||||
@ -679,10 +644,10 @@ ERROR 42000: INSERT command denied to user 'test_yesprivs'@'localhost' for table
|
||||
revoke SELECT on priv_db.t2 from test_yesprivs@localhost;
|
||||
grant INSERT on priv_db.t2 to test_yesprivs@localhost;
|
||||
insert into t1 (f1) values (4);
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
4
|
||||
select f2 from t2;
|
||||
select f2 from t2 order by f2;
|
||||
f2
|
||||
4
|
||||
use priv_db;
|
||||
@ -695,11 +660,11 @@ ERROR 42000: UPDATE command denied to user 'test_yesprivs'@'localhost' for table
|
||||
revoke INSERT on priv_db.t2 from test_yesprivs@localhost;
|
||||
grant UPDATE on priv_db.t2 to test_yesprivs@localhost;
|
||||
insert into t1 (f1) values (2);
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
4
|
||||
2
|
||||
select f2 from t2;
|
||||
4
|
||||
select f2 from t2 order by f2;
|
||||
f2
|
||||
1
|
||||
use priv_db;
|
||||
@ -712,12 +677,12 @@ ERROR 42000: SELECT command denied to user 'test_yesprivs'@'localhost' for table
|
||||
revoke UPDATE on priv_db.t2 from test_yesprivs@localhost;
|
||||
grant SELECT on priv_db.t2 to test_yesprivs@localhost;
|
||||
insert into t1 (f1) values (1);
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
4
|
||||
2
|
||||
1
|
||||
select f2 from t2;
|
||||
2
|
||||
4
|
||||
select f2 from t2 order by f2;
|
||||
f2
|
||||
1
|
||||
select @aaa;
|
||||
@ -733,13 +698,13 @@ ERROR 42000: DELETE command denied to user 'test_yesprivs'@'localhost' for table
|
||||
revoke SELECT on priv_db.t2 from test_yesprivs@localhost;
|
||||
grant DELETE on priv_db.t2 to test_yesprivs@localhost;
|
||||
insert into t1 (f1) values (1);
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
4
|
||||
1
|
||||
1
|
||||
2
|
||||
1
|
||||
1
|
||||
select f2 from t2;
|
||||
4
|
||||
select f2 from t2 order by f2;
|
||||
f2
|
||||
drop database if exists priv_db;
|
||||
drop user test_yesprivs@localhost;
|
||||
|
@ -89,18 +89,18 @@ Create trigger trg1 BEFORE INSERT on t1
|
||||
for each row set new.f1='Trigger 3.5.4.1';
|
||||
Use db_drop;
|
||||
Insert into t1 values ('Insert error 3.5.4.1');
|
||||
Select * from t1;
|
||||
Select * from t1 order by f1;
|
||||
f1
|
||||
Trigger 3.5.4.1
|
||||
drop trigger trg1;
|
||||
select trigger_schema, trigger_name, event_object_table
|
||||
from information_schema.triggers;
|
||||
from information_schema.triggers order by trigger_name;
|
||||
trigger_schema trigger_name event_object_table
|
||||
Insert into t1 values ('Insert no trigger 3.5.4.1');
|
||||
Select * from t1;
|
||||
Select * from t1 order by f1;
|
||||
f1
|
||||
Trigger 3.5.4.1
|
||||
Insert no trigger 3.5.4.1
|
||||
Trigger 3.5.4.1
|
||||
drop trigger trg1;
|
||||
drop database if exists db_drop;
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM 'test_general'@'localhost';
|
||||
@ -254,7 +254,7 @@ use dbtest_one;
|
||||
Insert into dbtest_two.t2 values ('2nd Insert 3.5.5.4');
|
||||
Warnings:
|
||||
Warning 1265 Data truncated for column 'f1' at row 1
|
||||
Select * from dbtest_two.t2;
|
||||
Select * from dbtest_two.t2 order by f1;
|
||||
f1
|
||||
1st Insert 3.5.
|
||||
2nd Insert 3.5.
|
||||
|
@ -135,10 +135,10 @@ values ('1', 'Test 3.5.8.4', 222, 23456, 1.05);
|
||||
Select f120, f122, f136, f144, f163 from tb3 where f122= 'Test 3.5.8.4';
|
||||
f120 f122 f136 f144 f163
|
||||
1 Test 3.5.8.4 00222 0000023456 1.050000000000000000000000000000
|
||||
select * from db_test.t1_i;
|
||||
select * from db_test.t1_i order by i120;
|
||||
i120 i136 i144 i163
|
||||
1 00222 0000023456 1.050000000000000000000000000000
|
||||
select * from db_test.t1_u;
|
||||
select * from db_test.t1_u order by u120;
|
||||
u120 u136 u144 u163
|
||||
a 00111 0000099999 999.990000000000000000000000000000
|
||||
b 00222 0000023456 1.050000000000000000000000000000
|
||||
@ -146,7 +146,7 @@ c 00333 0000099999 999.990000000000000000000000000000
|
||||
d 00222 0000023456 1.050000000000000000000000000000
|
||||
e 00222 0000023456 1.050000000000000000000000000000
|
||||
f 00333 0000099999 999.990000000000000000000000000000
|
||||
select * from db_test.t1_d;
|
||||
select * from db_test.t1_d order by d120;
|
||||
d120 d136 d144 d163
|
||||
a 00111 0000099999 999.990000000000000000000000000000
|
||||
c 00333 0000099999 999.990000000000000000000000000000
|
||||
@ -158,14 +158,22 @@ select @test_var;
|
||||
3.5.8.4 - single SQL - insert
|
||||
-----------------------------
|
||||
Create trigger trg2 BEFORE UPDATE on tb3 for each row
|
||||
BEGIN
|
||||
insert into db_test.t1_i
|
||||
values (new.f120, new.f136, new.f144, new.f163);
|
||||
END//
|
||||
Select f120, f122, f136, f144, f163 from tb3 where f122 like 'Test 3.5.8.4%';
|
||||
f120 f122 f136 f144 f163
|
||||
1 Test 3.5.8.4 00222 0000023456 1.050000000000000000000000000000
|
||||
select * from db_test.t1_i order by i120;
|
||||
i120 i136 i144 i163
|
||||
1 00222 0000023456 1.050000000000000000000000000000
|
||||
update tb3 set f120='I', f122='Test 3.5.8.4-Single Insert'
|
||||
where f122='Test 3.5.8.4';
|
||||
Select f120, f122, f136, f144, f163 from tb3 where f122 like 'Test 3.5.8.4%';
|
||||
f120 f122 f136 f144 f163
|
||||
I Test 3.5.8.4-Single Insert 00222 0000023456 1.050000000000000000000000000000
|
||||
select * from db_test.t1_i;
|
||||
select * from db_test.t1_i order by i120;
|
||||
i120 i136 i144 i163
|
||||
1 00222 0000023456 1.050000000000000000000000000000
|
||||
I 00222 0000023456 1.050000000000000000000000000000
|
||||
@ -182,14 +190,14 @@ update tb3 set f120='U', f122='Test 3.5.8.4-Single Update'
|
||||
Select f120, f122, f136, f144, f163 from tb3 where f122 like 'Test 3.5.8.4%';
|
||||
f120 f122 f136 f144 f163
|
||||
U Test 3.5.8.4-Single Update 00222 0000023456 1.050000000000000000000000000000
|
||||
select * from db_test.t1_u;
|
||||
select * from db_test.t1_u order by u120;
|
||||
u120 u136 u144 u163
|
||||
a 00111 0000099999 999.990000000000000000000000000000
|
||||
U 00222 0000023456 1.050000000000000000000000000000
|
||||
c 00333 0000099999 999.990000000000000000000000000000
|
||||
U 00222 0000023456 1.050000000000000000000000000000
|
||||
U 00222 0000023456 1.050000000000000000000000000000
|
||||
f 00333 0000099999 999.990000000000000000000000000000
|
||||
U 00222 0000023456 1.050000000000000000000000000000
|
||||
U 00222 0000023456 1.050000000000000000000000000000
|
||||
U 00222 0000023456 1.050000000000000000000000000000
|
||||
|
||||
3.5.8.3/4 - single SQL - delete
|
||||
-------------------------------
|
||||
@ -202,7 +210,7 @@ f122='Test 3.5.8.4-Single Delete'
|
||||
Select f120, f122, f136, f144, f163 from tb3 where f122 like 'Test 3.5.8.4%';
|
||||
f120 f122 f136 f144 f163
|
||||
D Test 3.5.8.4-Single Delete 00444 0000023456 1.050000000000000000000000000000
|
||||
select * from db_test.t1_d;
|
||||
select * from db_test.t1_d order by d120;
|
||||
d120 d136 d144 d163
|
||||
a 00111 0000099999 999.990000000000000000000000000000
|
||||
c 00333 0000099999 999.990000000000000000000000000000
|
||||
@ -249,29 +257,29 @@ END//
|
||||
set @test_var='Empty', @test_var2=0;
|
||||
Insert into tb3 (f120, f122, f136) values ('1', 'Test 3.5.8.5-if', 101);
|
||||
select f120, f122, f136, @test_var, @test_var2
|
||||
from tb3 where f122 = 'Test 3.5.8.5-if';
|
||||
from tb3 where f122 = 'Test 3.5.8.5-if' order by f136;
|
||||
f120 f122 f136 @test_var @test_var2
|
||||
D Test 3.5.8.5-if 00101 one 2nd else
|
||||
Insert into tb3 (f120, f122, f136) values ('2', 'Test 3.5.8.5-if', 102);
|
||||
select f120, f122, f136, @test_var, @test_var2
|
||||
from tb3 where f122 = 'Test 3.5.8.5-if';
|
||||
from tb3 where f122 = 'Test 3.5.8.5-if' order by f136;
|
||||
f120 f122 f136 @test_var @test_var2
|
||||
D Test 3.5.8.5-if 00101 two 2nd else
|
||||
D Test 3.5.8.5-if 00102 two 2nd else
|
||||
Insert into tb3 (f120, f122, f136) values ('3', 'Test 3.5.8.5-if', 10);
|
||||
select f120, f122, f136, @test_var, @test_var2
|
||||
from tb3 where f122 = 'Test 3.5.8.5-if';
|
||||
from tb3 where f122 = 'Test 3.5.8.5-if' order by f136;
|
||||
f120 f122 f136 @test_var @test_var2
|
||||
d Test 3.5.8.5-if 00010 three 2nd if
|
||||
D Test 3.5.8.5-if 00101 three 2nd if
|
||||
D Test 3.5.8.5-if 00102 three 2nd if
|
||||
d Test 3.5.8.5-if 00010 three 2nd if
|
||||
Insert into tb3 (f120, f122, f136) values ('3', 'Test 3.5.8.5-if', 103);
|
||||
select f120, f122, f136, @test_var, @test_var2
|
||||
from tb3 where f122 = 'Test 3.5.8.5-if';
|
||||
from tb3 where f122 = 'Test 3.5.8.5-if' order by f136;
|
||||
f120 f122 f136 @test_var @test_var2
|
||||
d Test 3.5.8.5-if 00010 three 2nd else
|
||||
D Test 3.5.8.5-if 00101 three 2nd else
|
||||
D Test 3.5.8.5-if 00102 three 2nd else
|
||||
d Test 3.5.8.5-if 00010 three 2nd else
|
||||
D Test 3.5.8.5-if 00103 three 2nd else
|
||||
create trigger trg3 before update on tb3 for each row
|
||||
BEGIN
|
||||
@ -331,20 +339,20 @@ set @test_var='Empty';
|
||||
Insert into tb3 (f120, f122, f136, f144)
|
||||
values ('a', 'Test 3.5.8.5-case', 5, 7);
|
||||
select f120, f122, f136, f144, @test_var
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case';
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
|
||||
f120 f122 f136 f144 @test_var
|
||||
A Test 3.5.8.5-case 00125 0000000007 A*seven
|
||||
Insert into tb3 (f120, f122, f136, f144)
|
||||
values ('b', 'Test 3.5.8.5-case', 71,16);
|
||||
select f120, f122, f136, f144, @test_var
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case';
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
|
||||
f120 f122 f136 f144 @test_var
|
||||
A Test 3.5.8.5-case 00125 0000000007 B*0000000016
|
||||
B Test 3.5.8.5-case 00191 0000000016 B*0000000016
|
||||
Insert into tb3 (f120, f122, f136, f144)
|
||||
values ('c', 'Test 3.5.8.5-case', 80,1);
|
||||
select f120, f122, f136, f144, @test_var
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case';
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
|
||||
f120 f122 f136 f144 @test_var
|
||||
A Test 3.5.8.5-case 00125 0000000007 C=one
|
||||
B Test 3.5.8.5-case 00191 0000000016 C=one
|
||||
@ -354,34 +362,34 @@ values ('d', 'Test 3.5.8.5-case', 152);
|
||||
Warnings:
|
||||
Warning 1265 Data truncated for column 'f120' at row 1
|
||||
select f120, f122, f136, f144, @test_var
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case';
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
|
||||
f120 f122 f136 f144 @test_var
|
||||
1 Test 3.5.8.5-case 00152 0000099999 1*0000099999
|
||||
A Test 3.5.8.5-case 00125 0000000007 1*0000099999
|
||||
B Test 3.5.8.5-case 00191 0000000016 1*0000099999
|
||||
C Test 3.5.8.5-case 00200 0000000001 1*0000099999
|
||||
1 Test 3.5.8.5-case 00152 0000099999 1*0000099999
|
||||
Insert into tb3 (f120, f122, f136, f144)
|
||||
values ('e', 'Test 3.5.8.5-case', 200, 8);
|
||||
Warnings:
|
||||
Warning 1265 Data truncated for column 'f120' at row 1
|
||||
select f120, f122, f136, f144, @test_var
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case';
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
|
||||
f120 f122 f136 f144 @test_var
|
||||
1 Test 3.5.8.5-case 00152 0000099999 1=eight
|
||||
1 Test 3.5.8.5-case 00200 0000000008 1=eight
|
||||
A Test 3.5.8.5-case 00125 0000000007 1=eight
|
||||
B Test 3.5.8.5-case 00191 0000000016 1=eight
|
||||
C Test 3.5.8.5-case 00200 0000000001 1=eight
|
||||
1 Test 3.5.8.5-case 00152 0000099999 1=eight
|
||||
1 Test 3.5.8.5-case 00200 0000000008 1=eight
|
||||
Insert into tb3 (f120, f122, f136, f144)
|
||||
values ('f', 'Test 3.5.8.5-case', 100, 8);
|
||||
select f120, f122, f136, f144, @test_var
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case';
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
|
||||
f120 f122 f136 f144 @test_var
|
||||
1 Test 3.5.8.5-case 00152 0000099999 1=eight
|
||||
1 Test 3.5.8.5-case 00200 0000000008 1=eight
|
||||
A Test 3.5.8.5-case 00125 0000000007 1=eight
|
||||
B Test 3.5.8.5-case 00191 0000000016 1=eight
|
||||
C Test 3.5.8.5-case 00200 0000000001 1=eight
|
||||
1 Test 3.5.8.5-case 00152 0000099999 1=eight
|
||||
1 Test 3.5.8.5-case 00200 0000000008 1=eight
|
||||
create trigger trg3a before update on tb3 for each row
|
||||
BEGIN
|
||||
CASE
|
||||
|
@ -116,7 +116,7 @@ set @tr_var_af_118=old.f118, @tr_var_af_121=old.f121,
|
||||
Insert into tb3 (f122, f136, f163)
|
||||
values ('Test 3.5.9.3', 7, 123.17);
|
||||
Update tb3 Set f136=8 where f122='Test 3.5.9.3';
|
||||
select f118, f121, f122, f136, f163 from tb3 where f122='Test 3.5.9.3';
|
||||
select f118, f121, f122, f136, f163 from tb3 where f122='Test 3.5.9.3' order by f136;
|
||||
f118 f121 f122 f136 f163
|
||||
a NULL Test 3.5.9.3 00008 123.170000000000000000000000000000
|
||||
select @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122,
|
||||
@ -132,7 +132,7 @@ a NULL Test 3.5.9.3 7 123.170000000000000000000000000000
|
||||
@tr_var_af_118 @tr_var_af_121 @tr_var_af_122 @tr_var_af_136 @tr_var_af_163
|
||||
0 0 0 0 0
|
||||
delete from tb3 where f122='Test 3.5.9.3';
|
||||
select f118, f121, f122, f136, f163 from tb3 where f122='Test 3.5.9.3';
|
||||
select f118, f121, f122, f136, f163 from tb3 where f122='Test 3.5.9.3' order by f136;
|
||||
f118 f121 f122 f136 f163
|
||||
select @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122,
|
||||
@tr_var_b4_136, @tr_var_b4_163;
|
||||
@ -172,7 +172,7 @@ set @tr_var_af_118=new.f118, @tr_var_af_121=new.f121,
|
||||
Insert into tb3 (f122, f136, f151, f163)
|
||||
values ('Test 3.5.9.4', 7, DEFAULT, 995.24);
|
||||
select f118, f121, f122, f136, f151, f163 from tb3
|
||||
where f122 like 'Test 3.5.9.4%';
|
||||
where f122 like 'Test 3.5.9.4%' order by f163;
|
||||
f118 f121 f122 f136 f151 f163
|
||||
a NULL Test 3.5.9.4 00007 999 995.240000000000000000000000000000
|
||||
select @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122,
|
||||
@ -190,9 +190,9 @@ a NULL Test 3.5.9.4 7 999 995.240000000000000000000000000000
|
||||
Update tb3 Set f122='Test 3.5.9.4-trig', f136=NULL, f151=DEFAULT, f163=NULL
|
||||
where f122='Test 3.5.9.4';
|
||||
Warnings:
|
||||
Warning 1263 Column was set to data type implicit default; NULL supplied for NOT NULL column 'f136' at row 11
|
||||
Warning 1048 Column 'f136' cannot be null
|
||||
select f118, f121, f122, f136, f151, f163 from tb3
|
||||
where f122 like 'Test 3.5.9.4-trig';
|
||||
where f122 like 'Test 3.5.9.4-trig' order by f163;
|
||||
f118 f121 f122 f136 f151 f163
|
||||
a NULL Test 3.5.9.4-trig 00000 999 NULL
|
||||
select @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122,
|
||||
|
@ -83,7 +83,7 @@ Insert into vw11 (f122, f151) values ('Test 3.5.10.1/2/3', 1);
|
||||
Insert into vw11 (f122, f151) values ('Test 3.5.10.1/2/3', 2);
|
||||
Insert into vw11 (f122, f151) values ('Not in View', 3);
|
||||
select f121, f122, f151, f163
|
||||
from tb3 where f122 like 'Test 3.5.10.1/2/3%';
|
||||
from tb3 where f122 like 'Test 3.5.10.1/2/3%' order by f151;
|
||||
f121 f122 f151 f163
|
||||
NULL Test 3.5.10.1/2/3 1 111.110000000000000000000000000000
|
||||
NULL Test 3.5.10.1/2/3 2 111.110000000000000000000000000000
|
||||
@ -97,7 +97,7 @@ f121 f122 f151 f163
|
||||
NULL Not in View 3 111.110000000000000000000000000000
|
||||
Update vw11 set f163=1;
|
||||
select f121, f122, f151, f163 from tb3
|
||||
where f122 like 'Test 3.5.10.1/2/3%';
|
||||
where f122 like 'Test 3.5.10.1/2/3%' order by f151;
|
||||
f121 f122 f151 f163
|
||||
Y Test 3.5.10.1/2/3-Update 1 1.000000000000000000000000000000
|
||||
Y Test 3.5.10.1/2/3-Update 2 1.000000000000000000000000000000
|
||||
@ -111,7 +111,7 @@ before delete
|
||||
0
|
||||
delete from vw11 where f151=1;
|
||||
select f121, f122, f151, f163 from tb3
|
||||
where f122 like 'Test 3.5.10.1/2/3%';
|
||||
where f122 like 'Test 3.5.10.1/2/3%' order by f151;
|
||||
f121 f122 f151 f163
|
||||
Y Test 3.5.10.1/2/3-Update 2 1.000000000000000000000000000000
|
||||
select f121, f122, f151, f163 from vw11;
|
||||
@ -142,7 +142,7 @@ load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t9.txt' into table tb_load;
|
||||
select @counter as 'Rows Loaded After';
|
||||
Rows Loaded After
|
||||
10
|
||||
Select * from tb_load limit 10;
|
||||
Select * from tb_load order by f1 limit 10;
|
||||
f1 f2 f3
|
||||
-5000 a` 1000
|
||||
-4999 aaa 999
|
||||
@ -237,7 +237,7 @@ insert into t3 (f1) values (new.f1+1000);
|
||||
create trigger tr2_4 after insert on t2_4 for each row
|
||||
insert into t3 (f1) values (new.f1+10000);
|
||||
insert into t1 values (1);
|
||||
select * from t3;
|
||||
select * from t3 order by f1;
|
||||
f1
|
||||
12
|
||||
102
|
||||
@ -272,17 +272,17 @@ create trigger tr4 after insert on t4
|
||||
for each row insert into t1 (f1) values (new.f4+1);
|
||||
insert into t1 values (1);
|
||||
ERROR HY000: Can't update table 't1' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
|
||||
select * from t1;
|
||||
select * from t1 order by f1;
|
||||
f1
|
||||
0
|
||||
1
|
||||
select * from t2;
|
||||
select * from t2 order by f2;
|
||||
f2
|
||||
2
|
||||
select * from t3;
|
||||
select * from t3 order by f3;
|
||||
f3
|
||||
3
|
||||
select * from t4;
|
||||
select * from t4 order by f4;
|
||||
f4
|
||||
4
|
||||
drop trigger tr1;
|
||||
@ -369,7 +369,7 @@ create table t4 (f4 tinyint) engine = memory;
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`f1` int(11) default NULL
|
||||
`f1` int(11) DEFAULT NULL
|
||||
) ENGINE=MEMORY DEFAULT CHARSET=latin1
|
||||
insert into t1 values (1);
|
||||
create trigger tr1 after insert on t1
|
||||
@ -381,16 +381,16 @@ for each row insert into t4 (f4) values (new.f3+1000);
|
||||
set autocommit=0;
|
||||
start transaction;
|
||||
insert into t1 values (1);
|
||||
ERROR 22003: Out of range value adjusted for column 'f4' at row 1
|
||||
ERROR 22003: Out of range value for column 'f4' at row 1
|
||||
commit;
|
||||
select * from t1;
|
||||
select * from t1 order by f1;
|
||||
f1
|
||||
1
|
||||
1
|
||||
select * from t2;
|
||||
select * from t2 order by f2;
|
||||
f2
|
||||
2
|
||||
select * from t3;
|
||||
select * from t3 order by f3;
|
||||
f3
|
||||
3
|
||||
drop trigger tr1;
|
||||
|
@ -1930,7 +1930,7 @@ f1 f2
|
||||
2 two
|
||||
4 four
|
||||
INSERT INTO v1 VALUES(2,'two');
|
||||
ERROR 23000: Duplicate entry '2' for key 1
|
||||
ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
|
||||
INSERT INTO v1 VALUES(3,'three');
|
||||
affected rows: 1
|
||||
INSERT INTO v1 VALUES(6,'six');
|
||||
@ -1949,7 +1949,7 @@ f1 f2
|
||||
3 three
|
||||
4 four
|
||||
UPDATE v1 SET f1 = 2 WHERE f1 = 3;
|
||||
ERROR 23000: Duplicate entry '2' for key 1
|
||||
ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
|
||||
UPDATE v1 SET f2 = 'number' WHERE f1 = 3;
|
||||
affected rows: 1
|
||||
info: Rows matched: 1 Changed: 1 Warnings: 0
|
||||
@ -1997,12 +1997,12 @@ DROP VIEW IF EXISTS test.v1;
|
||||
CREATE TABLE t1 (f1 ENUM('A', 'B', 'C') NOT NULL, f2 INTEGER)
|
||||
ENGINE = memory;
|
||||
INSERT INTO t1 VALUES ('A', 1);
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 order by f1, f2;
|
||||
f1 f2
|
||||
A 1
|
||||
CREATE VIEW v1 AS SELECT * FROM t1 WHERE f2 BETWEEN 1 AND 2
|
||||
WITH CASCADED CHECK OPTION ;
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by f1, f2;
|
||||
f1 f2
|
||||
A 1
|
||||
UPDATE v1 SET f2 = 2 WHERE f2 = 1;
|
||||
@ -2010,7 +2010,7 @@ affected rows: 1
|
||||
info: Rows matched: 1 Changed: 1 Warnings: 0
|
||||
INSERT INTO v1 VALUES('B',2);
|
||||
affected rows: 1
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by f1, f2;
|
||||
f1 f2
|
||||
A 2
|
||||
B 2
|
||||
@ -2018,7 +2018,7 @@ UPDATE v1 SET f2 = 4;
|
||||
ERROR HY000: CHECK OPTION failed 'test.v1'
|
||||
INSERT INTO v1 VALUES('B',3);
|
||||
ERROR HY000: CHECK OPTION failed 'test.v1'
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by f1, f2;
|
||||
f1 f2
|
||||
A 2
|
||||
B 2
|
||||
@ -10585,7 +10585,7 @@ f1 f2 f3 f4
|
||||
DELETE FROM t1;
|
||||
INSERT INTO v1 SET f2 = 'ABC';
|
||||
INSERT INTO v1 SET f2 = 'ABC';
|
||||
ERROR 23000: Duplicate entry '0' for key 1
|
||||
ERROR 23000: Duplicate entry '0' for key 'PRIMARY'
|
||||
SELECT * from t1;
|
||||
f1 f2 f3 f4
|
||||
0 ABC NULL NULL
|
||||
@ -10654,7 +10654,7 @@ DROP VIEW v1;
|
||||
CREATE VIEW v1 AS SELECT f2, f3 FROM t1;
|
||||
INSERT INTO v1 SET f2 = 'ABC';
|
||||
INSERT INTO v1 SET f2 = 'ABC';
|
||||
ERROR 23000: Duplicate entry '0' for key 1
|
||||
ERROR 23000: Duplicate entry '0' for key 'PRIMARY'
|
||||
SELECT * from t1;
|
||||
f1 f2 f3 f4
|
||||
0 ABC NULL NULL
|
||||
@ -10989,11 +10989,11 @@ f1 bigint(20) YES NULL
|
||||
f2 date YES NULL
|
||||
f4 char(5) YES NULL
|
||||
report char(10) YES NULL
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 order by f1, report;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by f1, report;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
@ -11013,12 +11013,12 @@ f4x char(5) YES NULL
|
||||
report char(10) YES NULL
|
||||
DESCRIBE v1;
|
||||
ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 order by f1, report;
|
||||
f1 f2 f4x report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
0 NULL ABC t1 1
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by f1, report;
|
||||
ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
|
||||
ALTER TABLE t1 CHANGE COLUMN f4x f4 CHAR(5);
|
||||
ALTER TABLE t1 CHANGE COLUMN f4 f4 CHAR(10);
|
||||
@ -11036,14 +11036,14 @@ f1 bigint(20) YES NULL
|
||||
f2 date YES NULL
|
||||
f4 char(10) YES NULL
|
||||
report char(10) YES NULL
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 order by f1, report;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
0 NULL ABC t1 1
|
||||
2 NULL <-- 10 --> t1 2
|
||||
2 NULL <-- 10 --> v1 2
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by f1, report;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
@ -11072,7 +11072,7 @@ f1 bigint(20) YES NULL
|
||||
f2 date YES NULL
|
||||
f4 char(8) YES NULL
|
||||
report char(10) YES NULL
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 order by f1, report;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
@ -11081,7 +11081,7 @@ f1 f2 f4 report
|
||||
2 NULL <-- 10 - v1 2
|
||||
3 NULL <-- 10 - t1 3
|
||||
3 NULL <-- 10 - v1 3
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by f1, report;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
@ -11105,7 +11105,7 @@ f1 bigint(20) YES NULL
|
||||
f2 date YES NULL
|
||||
f4 varchar(20) YES NULL
|
||||
report char(10) YES NULL
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 order by f1, report;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
@ -11116,7 +11116,7 @@ f1 f2 f4 report
|
||||
3 NULL <-- 10 - v1 3
|
||||
4 NULL <------ 20 --------> t1 4
|
||||
4 NULL <------ 20 --------> v1 4
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by f1, report;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
@ -11144,7 +11144,7 @@ f1 varchar(30) YES NULL
|
||||
f2 date YES NULL
|
||||
f4 varchar(20) YES NULL
|
||||
report char(10) YES NULL
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 order by f1, report;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
@ -11157,7 +11157,7 @@ f1 f2 f4 report
|
||||
4 NULL <------ 20 --------> v1 4
|
||||
<------------- 30 -----------> NULL <------ 20 --------> t1 5
|
||||
<------------- 30 -----------> NULL <------ 20 --------> v1 5
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by f1, report;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
@ -11181,7 +11181,7 @@ f4 varchar(20) YES NULL
|
||||
report char(10) YES NULL
|
||||
DESCRIBE v1;
|
||||
ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 order by f1, report;
|
||||
f1 f4 report
|
||||
-1 ABC t1 0
|
||||
-1 ABC v1 0
|
||||
@ -11195,7 +11195,7 @@ f1 f4 report
|
||||
<------------- 30 -----------> <------ 20 --------> t1 5
|
||||
<------------- 30 -----------> <------ 20 --------> v1 5
|
||||
ABC <------ 20 --------> t1 6
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by f1, report;
|
||||
ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
|
||||
ALTER TABLE t1 ADD COLUMN f2 DATE DEFAULT NULL;
|
||||
INSERT INTO t1 SET f1 = 'ABC', f2 = '1500-12-04',
|
||||
@ -11214,7 +11214,7 @@ f1 varchar(30) YES NULL
|
||||
f2 date YES NULL
|
||||
f4 varchar(20) YES NULL
|
||||
report char(10) YES NULL
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 order by f1, report;
|
||||
f1 f4 report f2
|
||||
-1 ABC t1 0 NULL
|
||||
-1 ABC v1 0 NULL
|
||||
@ -11230,7 +11230,7 @@ f1 f4 report f2
|
||||
ABC <------ 20 --------> t1 6 NULL
|
||||
ABC <------ 20 --------> t1 7 1500-12-04
|
||||
ABC <------ 20 --------> v1 7 1500-12-04
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by f1, report;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
@ -11264,7 +11264,7 @@ f1 varchar(30) YES NULL
|
||||
f2 float YES NULL
|
||||
f4 varchar(20) YES NULL
|
||||
report char(10) YES NULL
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 order by f1, report;
|
||||
f1 f4 report f2
|
||||
-1 ABC t1 0 NULL
|
||||
-1 ABC v1 0 NULL
|
||||
@ -11279,10 +11279,10 @@ f1 f4 report f2
|
||||
<------------- 30 -----------> <------ 20 --------> v1 5 NULL
|
||||
ABC <------ 20 --------> t1 6 NULL
|
||||
ABC <------ 20 --------> t1 7 NULL
|
||||
ABC <------ 20 --------> v1 7 NULL
|
||||
ABC <------ 20 --------> t1 8 -0.00033
|
||||
ABC <------ 20 --------> v1 7 NULL
|
||||
ABC <------ 20 --------> v1 8 -0.00033
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by f1, report;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
@ -11297,8 +11297,8 @@ f1 f2 f4 report
|
||||
<------------- 30 -----------> NULL <------ 20 --------> v1 5
|
||||
ABC NULL <------ 20 --------> t1 6
|
||||
ABC NULL <------ 20 --------> t1 7
|
||||
ABC NULL <------ 20 --------> v1 7
|
||||
ABC -0.00033 <------ 20 --------> t1 8
|
||||
ABC NULL <------ 20 --------> v1 7
|
||||
ABC -0.00033 <------ 20 --------> v1 8
|
||||
ALTER TABLE t1 ADD COLUMN f3 NUMERIC(7,2);
|
||||
INSERT INTO t1 SET f1 = 'ABC', f2 = -3.3E-4,
|
||||
@ -11321,7 +11321,7 @@ f1 varchar(30) YES NULL
|
||||
f2 float YES NULL
|
||||
f4 varchar(20) YES NULL
|
||||
report char(10) YES NULL
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 order by f1, report;
|
||||
f1 f4 report f2 f3
|
||||
-1 ABC t1 0 NULL NULL
|
||||
-1 ABC v1 0 NULL NULL
|
||||
@ -11336,12 +11336,12 @@ f1 f4 report f2 f3
|
||||
<------------- 30 -----------> <------ 20 --------> v1 5 NULL NULL
|
||||
ABC <------ 20 --------> t1 6 NULL NULL
|
||||
ABC <------ 20 --------> t1 7 NULL NULL
|
||||
ABC <------ 20 --------> v1 7 NULL NULL
|
||||
ABC <------ 20 --------> t1 8 -0.00033 NULL
|
||||
ABC <------ 20 --------> v1 8 -0.00033 NULL
|
||||
ABC <------ 20 --------> t1 9 -0.00033 -2.20
|
||||
ABC <------ 20 --------> v1 7 NULL NULL
|
||||
ABC <------ 20 --------> v1 8 -0.00033 NULL
|
||||
ABC <------ 20 --------> v1 9a -0.00033 NULL
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by f1, report;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
@ -11356,10 +11356,10 @@ f1 f2 f4 report
|
||||
<------------- 30 -----------> NULL <------ 20 --------> v1 5
|
||||
ABC NULL <------ 20 --------> t1 6
|
||||
ABC NULL <------ 20 --------> t1 7
|
||||
ABC NULL <------ 20 --------> v1 7
|
||||
ABC -0.00033 <------ 20 --------> t1 8
|
||||
ABC -0.00033 <------ 20 --------> v1 8
|
||||
ABC -0.00033 <------ 20 --------> t1 9
|
||||
ABC NULL <------ 20 --------> v1 7
|
||||
ABC -0.00033 <------ 20 --------> v1 8
|
||||
ABC -0.00033 <------ 20 --------> v1 9a
|
||||
DROP TABLE t1;
|
||||
DROP VIEW v1;
|
||||
@ -11374,10 +11374,10 @@ DESCRIBE v1;
|
||||
Field Type Null Key Default Extra
|
||||
f1 char(10) YES NULL
|
||||
my_sqrt double YES NULL
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 order by f1, f2;
|
||||
f1 f2
|
||||
ABC 3
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by 2;
|
||||
f1 my_sqrt
|
||||
ABC 1.7320508075689
|
||||
ALTER TABLE t1 CHANGE COLUMN f2 f2 VARCHAR(30);
|
||||
@ -11390,21 +11390,21 @@ DESCRIBE v1;
|
||||
Field Type Null Key Default Extra
|
||||
f1 char(10) YES NULL
|
||||
my_sqrt double YES NULL
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 order by f1, f2;
|
||||
f1 f2
|
||||
ABC 3
|
||||
ABC DEF
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by 2;
|
||||
f1 my_sqrt
|
||||
ABC 1.7320508075689
|
||||
ABC 0
|
||||
ABC 1.7320508075689
|
||||
SELECT SQRT('DEF');
|
||||
SQRT('DEF')
|
||||
0
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect DOUBLE value: 'DEF'
|
||||
CREATE VIEW v2 AS SELECT SQRT('DEF');
|
||||
SELECT * FROM v2;
|
||||
SELECT * FROM v2 order by 1;
|
||||
SQRT('DEF')
|
||||
0
|
||||
Warnings:
|
||||
@ -11414,27 +11414,27 @@ DESCRIBE v2;
|
||||
Field Type Null Key Default Extra
|
||||
f1 char(10) YES NULL
|
||||
my_sqrt double YES NULL
|
||||
SELECT * FROM v2;
|
||||
SELECT * FROM v2 order by 2;
|
||||
f1 my_sqrt
|
||||
ABC 0
|
||||
ABC 1.7320508075689
|
||||
ABC 0
|
||||
CREATE TABLE t2 AS SELECT f1, SQRT(f2) my_sqrt FROM t1;
|
||||
SELECT * FROM t2;
|
||||
SELECT * FROM t2 order by 2;
|
||||
f1 my_sqrt
|
||||
ABC 1.73205080756888
|
||||
ABC 0
|
||||
ABC 1.73205080756888
|
||||
DROP TABLE t2;
|
||||
CREATE TABLE t2 AS SELECT * FROM v1;
|
||||
SELECT * FROM t2;
|
||||
SELECT * FROM t2 order by 2;
|
||||
f1 my_sqrt
|
||||
ABC 1.73205080756888
|
||||
ABC 0
|
||||
ABC 1.73205080756888
|
||||
DROP TABLE t2;
|
||||
CREATE TABLE t2 AS SELECT * FROM v2;
|
||||
SELECT * FROM t2;
|
||||
SELECT * FROM t2 order by 2;
|
||||
f1 my_sqrt
|
||||
ABC 1.73205080756888
|
||||
ABC 0
|
||||
ABC 1.73205080756888
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
||||
DROP VIEW v1;
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -166,7 +166,7 @@ declare y integer default 1;
|
||||
set @x = x;
|
||||
set @y = y;
|
||||
set @z = 234;
|
||||
SELECT f1, f2 into @x, @y from t2 limit 1;
|
||||
SELECT f1, f2 into @x, @y from t2 where f1='a`' and f2='a`' limit 1;
|
||||
SELECT @x, @y, @z, invar;
|
||||
BEGIN
|
||||
set @x = 2;
|
||||
@ -209,7 +209,7 @@ BEGIN
|
||||
declare x integer; declare y integer;
|
||||
set @x=x;
|
||||
set @y=y;
|
||||
SELECT f4, f3 into @x, @y from t2 limit 1;
|
||||
SELECT f4, f3 into @x, @y from t2 where f4=-5000 and f3='1000-01-01' limit 1;
|
||||
SELECT @x, @y;
|
||||
END//
|
||||
CALL sp1();
|
||||
@ -544,6 +544,9 @@ exit handler 2
|
||||
exit handler 2
|
||||
exit handler 1
|
||||
exit handler 1
|
||||
Warnings:
|
||||
Note 1051 Unknown table 'tqq'
|
||||
Note 1051 Unknown table 'tqq'
|
||||
create table res_t1(w char unique, x char);
|
||||
insert into res_t1 values ('a', 'b');
|
||||
CREATE PROCEDURE h1 ()
|
||||
@ -1084,7 +1087,8 @@ declare f2_value char(20);
|
||||
declare f5_value char(20);
|
||||
declare f4_value integer;
|
||||
declare f6_value integer;
|
||||
declare cur1 cursor for SELECT f1, f2, f4, f5, f6 from t2 limit 3;
|
||||
declare cur1 cursor for SELECT f1, f2, f4, f5, f6 from t2
|
||||
where f4 >=-5000 order by f4 limit 3;
|
||||
open cur1;
|
||||
while proceed do
|
||||
SELECT count AS 'loop';
|
||||
@ -1167,7 +1171,7 @@ of a compound statement ends.
|
||||
DROP TABLE IF EXISTS temp1;
|
||||
DROP PROCEDURE IF EXISTS sp1;
|
||||
create table temp1( f0 char(20), f1 char(20), f2 char(20), f3 int, f4 char(20) );
|
||||
SELECT f1, f2, f4, f5 from t2;
|
||||
SELECT f1, f2, f4, f5 from t2 order by f4;
|
||||
f1 f2 f4 f5
|
||||
a` a` -5000 a`
|
||||
aaa aaa -4999 aaa
|
||||
@ -1187,21 +1191,21 @@ declare newf1 char(20);
|
||||
declare newf2 char(20);
|
||||
declare newf5 char(20);
|
||||
declare newf4 integer;
|
||||
declare cur1 cursor for SELECT f1, f2, f4, f5 from t2 limit 5;
|
||||
declare cur2 cursor for SELECT f1, f2, f4, f5 from t2 limit 5;
|
||||
declare cur1 cursor for SELECT f1, f2, f4, f5 from t2 where f4 >= -5000 order by f4 limit 5;
|
||||
declare cur2 cursor for SELECT f1, f2, f4, f5 from t2 where f4 >= -5000 order by f4 limit 5;
|
||||
open cur1;
|
||||
open cur2;
|
||||
BEGIN
|
||||
declare continue handler for sqlstate '02000' set count = 1;
|
||||
declare continue handler for sqlstate '02000' set count=1;
|
||||
fetch cur1 into newf1, newf2, newf4, newf5;
|
||||
SELECT '-1-', count, newf1, newf2, newf4, newf5;
|
||||
insert into temp1 values ('cur1_out', newf1, newf2, newf4, newf5);
|
||||
set count = 4;
|
||||
set count= 4;
|
||||
BEGIN
|
||||
while count > 0 do
|
||||
while count> 0 do
|
||||
fetch cur1 into newf1, newf2, newf4, newf5;
|
||||
SELECT '-2-', count, newf1, newf2, newf4, newf5;
|
||||
set count = count - 1;
|
||||
set count = count- 1;
|
||||
END while;
|
||||
SELECT '-3-', count, newf1, newf2, newf4, newf4;
|
||||
END;
|
||||
@ -1270,8 +1274,10 @@ declare i_newf11 char(20);
|
||||
declare i_newf12 char(20);
|
||||
declare i_newf13 date;
|
||||
declare i_newf14 integer;
|
||||
declare cur1 cursor for SELECT f1, f2, f3, f4 from t2 limit 4;
|
||||
declare cur2 cursor for SELECT f1, f2, f3, f4 from t2 limit 3;
|
||||
declare cur1 cursor for SELECT f1, f2, f3, f4 from t2
|
||||
where f4>=-5000 order by f4 limit 4;
|
||||
declare cur2 cursor for SELECT f1, f2, f3, f4 from t2
|
||||
where f4>=-5000 order by f4 limit 3;
|
||||
declare continue handler for sqlstate '02000' set proceed=0;
|
||||
open cur1;
|
||||
open cur2;
|
||||
@ -1302,8 +1308,10 @@ DECLARE o_newf11 CHAR(20);
|
||||
DECLARE o_newf12 CHAR(20);
|
||||
DECLARE o_newf13 DATE;
|
||||
DECLARE o_newf14 INTEGER;
|
||||
DECLARE cur1 CURSOR FOR SELECT f1, f2, f3, f4 FROM t2 LIMIT 5;
|
||||
DECLARE cur2 CURSOR FOR SELECT f1, f2, f3, f4 FROM t2 LIMIT 5;
|
||||
DECLARE cur1 CURSOR FOR SELECT f1, f2, f3, f4 FROM t2
|
||||
WHERE f4>=-5000 ORDER BY f4 LIMIT 5;
|
||||
DECLARE cur2 CURSOR FOR SELECT f1, f2, f3, f4 FROM t2
|
||||
WHERE f4>=-5000 ORDER BY f4 LIMIT 5;
|
||||
DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET proceed=0;
|
||||
OPEN cur1;
|
||||
OPEN cur2;
|
||||
|
@ -80,7 +80,7 @@ connect(localhost,user_1,,db_storedproc,MYSQL_PORT,MYSQL_SOCK);
|
||||
user_1@localhost db_storedproc
|
||||
CREATE PROCEDURE sp31102 () SQL SECURITY INVOKER
|
||||
BEGIN
|
||||
SELECT * FROM db_storedproc.t1 LIMIT 1;
|
||||
SELECT * FROM db_storedproc.t1 WHERE f4=-5000 LIMIT 1;
|
||||
END//
|
||||
CREATE FUNCTION fn31105(n INT) RETURNS INT
|
||||
BEGIN
|
||||
@ -209,7 +209,7 @@ CALL sp_ins_1();
|
||||
SELECT row_count();
|
||||
row_count()
|
||||
1
|
||||
SELECT * FROM temp;
|
||||
SELECT * FROM temp ORDER BY f4;
|
||||
f1 f2 f3 f4 f5 f6
|
||||
a` a` 1000-01-01 -5000 a` -5000
|
||||
aaa aaa 1000-01-02 -4999 aaa -4999
|
||||
@ -226,7 +226,7 @@ CALL sp_ins_3();
|
||||
SELECT row_count();
|
||||
row_count()
|
||||
1
|
||||
SELECT * FROM temp;
|
||||
SELECT * FROM temp ORDER BY f4;
|
||||
f1 f2 f3 f4 f5 f6
|
||||
a` a` 1000-01-01 -5000 a` -5000
|
||||
aaa aaa 1000-01-02 -4999 aaa -4999
|
||||
@ -246,7 +246,7 @@ CALL sp_upd();
|
||||
SELECT row_count();
|
||||
row_count()
|
||||
4
|
||||
SELECT * FROM temp;
|
||||
SELECT * FROM temp ORDER BY f4;
|
||||
f1 f2 f3 f4 f5 f6
|
||||
a` a` 1000-01-01 -5000 a` -5000
|
||||
aaa aaa 1000-01-02 -4999 aaa -4999
|
||||
@ -279,7 +279,7 @@ COUNT( f1 ) f1
|
||||
SELECT row_count();
|
||||
row_count()
|
||||
3
|
||||
SELECT * FROM temp;
|
||||
SELECT * FROM temp ORDER BY f4;
|
||||
f1 f2 f3 f4 f5 f6
|
||||
a` a` 1000-01-01 -5000 a` -5000
|
||||
aaa aaa 1000-01-02 -4999 aaa -4999
|
||||
|
@ -199,6 +199,9 @@ CREATE TRIGGER trg5_1 BEFORE INSERT on test.t1
|
||||
for each row set new.f3 = '14';
|
||||
CREATE TRIGGER trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ
|
||||
BEFORE UPDATE on test.t1 for each row set new.f3 = '42';
|
||||
ERROR 42000: Identifier name 'trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ' is too long
|
||||
CREATE TRIGGER trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWX
|
||||
BEFORE UPDATE on test.t1 for each row set new.f3 = '42';
|
||||
insert into t1 (f2) values ('insert 3.5.1.7');
|
||||
select * from t1;
|
||||
f1 f2 f3
|
||||
@ -207,12 +210,14 @@ update t1 set f2='update 3.5.1.7';
|
||||
select * from t1;
|
||||
f1 f2 f3
|
||||
NULL update 3.5.1.7 42
|
||||
select trigger_name from information_schema.triggers;
|
||||
select trigger_name from information_schema.triggers order by trigger_name;
|
||||
trigger_name
|
||||
trg5_1
|
||||
trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWX
|
||||
drop trigger trg5_1;
|
||||
drop trigger trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ;
|
||||
ERROR 42000: Identifier name 'trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ' is too long
|
||||
drop trigger trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWX;
|
||||
drop table t1;
|
||||
|
||||
Testcase 3.5.1.8:
|
||||
@ -314,7 +319,7 @@ insert into trig_db3.t1 (f1,f2) values ('insert to db3 t1 from db1',4);
|
||||
select @test_var1, @test_var2, @test_var3;
|
||||
@test_var1 @test_var2 @test_var3
|
||||
trig1 trig2 trig3
|
||||
select * from t1;
|
||||
select * from t1 order by f2;
|
||||
f1 f2
|
||||
trig1 1
|
||||
trig1 2
|
||||
@ -324,7 +329,7 @@ trig2 3
|
||||
select * from trig_db3.t1;
|
||||
f1 f2
|
||||
trig3 4
|
||||
select * from t1;
|
||||
select * from t1 order by f2;
|
||||
f1 f2
|
||||
trig1 1
|
||||
trig1 2
|
||||
@ -349,10 +354,10 @@ for each row set @test_var2='trig1_a';
|
||||
create trigger trig_db2.trig2 before insert on trig_db2.t1
|
||||
for each row set @test_var3='trig2';
|
||||
select trigger_schema, trigger_name, event_object_table
|
||||
from information_schema.triggers;
|
||||
from information_schema.triggers order by trigger_name;
|
||||
trigger_schema trigger_name event_object_table
|
||||
trig_db1 trig1_b t1
|
||||
trig_db1 trig1_a t1
|
||||
trig_db1 trig1_b t1
|
||||
trig_db2 trig2 t1
|
||||
set @test_var1= '', @test_var2= '', @test_var3= '';
|
||||
insert into t1 (f1,f2) values ('insert to db1 t1 from db1',352);
|
||||
|
@ -82,16 +82,16 @@ Testcase 3.5.3.2/6:
|
||||
-------------------
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
|
||||
grant ALL on *.* to test_noprivs@localhost;
|
||||
revoke SUPER on *.* from test_noprivs@localhost;
|
||||
revoke TRIGGER on *.* from test_noprivs@localhost;
|
||||
show grants for test_noprivs@localhost;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
|
||||
grant SUPER on *.* to test_yesprivs@localhost;
|
||||
grant TRIGGER on *.* to test_yesprivs@localhost;
|
||||
grant SELECT on priv_db.t1 to test_yesprivs@localhost;
|
||||
show grants for test_yesprivs@localhost;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
|
||||
connect(localhost,test_noprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
|
||||
connect(localhost,test_yesprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
|
||||
@ -104,10 +104,10 @@ test_noprivs@localhost
|
||||
use priv_db;
|
||||
create trigger trg1_1 before INSERT on t1 for each row
|
||||
set new.f1 = 'trig 3.5.3.2_1-no';
|
||||
ERROR 42000: Access denied; you need the SUPER privilege for this operation
|
||||
Got one of the listed errors
|
||||
use priv_db;
|
||||
insert into t1 (f1) values ('insert 3.5.3.2-no');
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
select current_user;
|
||||
@ -122,15 +122,12 @@ root@localhost
|
||||
use priv_db;
|
||||
insert into t1 (f1) values ('insert 3.5.3.2-yes');
|
||||
ERROR 42000: UPDATE command denied to user 'test_yesprivs'@'localhost' for column 'f1' in table 't1'
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
grant UPDATE on priv_db.t1 to test_yesprivs@localhost;
|
||||
|
||||
note: once 15166 is fixed a similar case for SELECT needs to be added
|
||||
---------------------------------------------------------------------
|
||||
insert into t1 (f1) values ('insert 3.5.3.2-yes');
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
trig 3.5.3.2_2-yes
|
||||
@ -139,10 +136,10 @@ Testcase 3.5.3.6:
|
||||
-----------------
|
||||
use priv_db;
|
||||
drop trigger trg1_2;
|
||||
ERROR 42000: Access denied; you need the SUPER privilege for this operation
|
||||
Got one of the listed errors
|
||||
use priv_db;
|
||||
insert into t1 (f1) values ('insert 3.5.3.6-yes');
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
trig 3.5.3.2_2-yes
|
||||
@ -151,12 +148,12 @@ use priv_db;
|
||||
drop trigger trg1_2;
|
||||
use priv_db;
|
||||
insert into t1 (f1) values ('insert 3.5.3.6-no');
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
insert 3.5.3.6-no
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
drop trigger trg1_2;
|
||||
|
||||
Testcase 3.5.3.7a:
|
||||
@ -166,12 +163,12 @@ grant ALL on *.* to test_noprivs@localhost;
|
||||
revoke UPDATE on *.* from test_noprivs@localhost;
|
||||
show grants for test_noprivs@localhost;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
|
||||
grant SUPER, UPDATE on *.* to test_yesprivs@localhost;
|
||||
grant TRIGGER, UPDATE on *.* to test_yesprivs@localhost;
|
||||
show grants for test_yesprivs@localhost;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT UPDATE, SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT UPDATE, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
connect(localhost,test_noprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
|
||||
connect(localhost,test_yesprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
|
||||
select current_user;
|
||||
@ -180,24 +177,24 @@ test_noprivs@localhost
|
||||
use priv_db;
|
||||
show grants;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
select f1 from t1;
|
||||
GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
insert 3.5.3.6-no
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
|
||||
Trigger create disabled - should fail - Bug 8884
|
||||
------------------------------------------------
|
||||
insert into t1 (f1) values ('insert 3.5.3.7-1a');
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
insert 3.5.3.6-no
|
||||
insert 3.5.3.7-1a
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
drop trigger trg4a_1;
|
||||
use priv_db;
|
||||
select current_user;
|
||||
@ -205,236 +202,220 @@ current_user
|
||||
test_yesprivs@localhost
|
||||
show grants;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT UPDATE, SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT UPDATE, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
create trigger trg4a_2 before INSERT on t1 for each row
|
||||
set new.f1 = 'trig 3.5.3.7-2a';
|
||||
|
||||
SELECT priv added to bypass bug 15166
|
||||
-------------------------------------
|
||||
grant SELECT on *.* to test_yesprivs@localhost;
|
||||
insert into t1 (f1) values ('insert 3.5.3.7-2b');
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
insert 3.5.3.6-no
|
||||
insert 3.5.3.7-1a
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.7-2a
|
||||
drop trigger trg4a_2;
|
||||
|
||||
Testcase 3.5.3.7b:
|
||||
------------------
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
|
||||
grant SUPER on *.* to test_noprivs;
|
||||
grant TRIGGER on *.* to test_noprivs;
|
||||
grant ALL on priv_db.* to test_noprivs@localhost;
|
||||
revoke UPDATE on priv_db.* from test_noprivs@localhost;
|
||||
show grants for test_noprivs;
|
||||
Grants for test_noprivs@%
|
||||
GRANT SUPER ON *.* TO 'test_noprivs'@'%'
|
||||
GRANT TRIGGER ON *.* TO 'test_noprivs'@'%'
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
|
||||
grant SUPER on *.* to test_yesprivs@localhost;
|
||||
grant TRIGGER on *.* to test_yesprivs@localhost;
|
||||
grant UPDATE on priv_db.* to test_yesprivs@localhost;
|
||||
show grants for test_yesprivs@localhost;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT UPDATE ON `priv_db`.* TO 'test_yesprivs'@'localhost'
|
||||
connect(localhost,test_noprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
|
||||
connect(localhost,test_yesprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
|
||||
show grants;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE ON `priv_db`.* TO 'test_noprivs'@'localhost'
|
||||
GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER ON `priv_db`.* TO 'test_noprivs'@'localhost'
|
||||
use priv_db;
|
||||
|
||||
Trigger create disabled - should fail - Bug 8884
|
||||
------------------------------------------------
|
||||
insert into t1 (f1) values ('insert 3.5.3.7-1b');
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
insert 3.5.3.6-no
|
||||
insert 3.5.3.7-1a
|
||||
trig 3.5.3.7-2a
|
||||
insert 3.5.3.7-1b
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.7-2a
|
||||
update t1 set f1 = 'update 3.5.3.7-1b' where f1 = 'insert 3.5.3.7-1b';
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
insert 3.5.3.6-no
|
||||
insert 3.5.3.7-1a
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.7-2a
|
||||
update 3.5.3.7-1b
|
||||
drop trigger trg4b_1;
|
||||
show grants;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT UPDATE ON `priv_db`.* TO 'test_yesprivs'@'localhost'
|
||||
use priv_db;
|
||||
create trigger trg4b_2 before UPDATE on t1 for each row
|
||||
set new.f1 = 'trig 3.5.3.7-2b';
|
||||
|
||||
SELECT priv added to bypass bug 15166
|
||||
-------------------------------------
|
||||
grant SELECT on priv_db.* to test_yesprivs@localhost;
|
||||
insert into t1 (f1) values ('insert 3.5.3.7-2b');
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
insert 3.5.3.6-no
|
||||
insert 3.5.3.7-1a
|
||||
trig 3.5.3.7-2a
|
||||
update 3.5.3.7-1b
|
||||
insert 3.5.3.7-2b
|
||||
update t1 set f1 = 'update 3.5.3.7-2b' where f1 = 'insert 3.5.3.7-2b';
|
||||
select f1 from t1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
insert 3.5.3.6-no
|
||||
insert 3.5.3.7-1a
|
||||
trig 3.5.3.7-2a
|
||||
update 3.5.3.7-1b
|
||||
update t1 set f1 = 'update 3.5.3.7-2b' where f1 = 'insert 3.5.3.7-2b';
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
insert 3.5.3.6-no
|
||||
insert 3.5.3.7-1a
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.7-2a
|
||||
trig 3.5.3.7-2b
|
||||
update 3.5.3.7-1b
|
||||
drop trigger trg4b_2;
|
||||
|
||||
Testcase 3.5.3.7c
|
||||
-----------------
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
|
||||
grant SUPER on *.* to test_noprivs@localhost;
|
||||
grant TRIGGER on *.* to test_noprivs@localhost;
|
||||
grant ALL on priv_db.t1 to test_noprivs@localhost;
|
||||
revoke UPDATE on priv_db.t1 from test_noprivs@localhost;
|
||||
show grants for test_noprivs;
|
||||
Grants for test_noprivs@%
|
||||
GRANT SUPER ON *.* TO 'test_noprivs'@'%'
|
||||
GRANT TRIGGER ON *.* TO 'test_noprivs'@'%'
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
|
||||
grant SUPER on *.* to test_yesprivs@localhost;
|
||||
grant TRIGGER on *.* to test_yesprivs@localhost;
|
||||
grant UPDATE on priv_db.t1 to test_yesprivs@localhost;
|
||||
show grants for test_yesprivs@localhost;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
|
||||
connect(localhost,test_noprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
|
||||
connect(localhost,test_yesprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
|
||||
show grants;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
|
||||
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
|
||||
use priv_db;
|
||||
|
||||
Trigger create disabled - should fail - Bug 8884
|
||||
------------------------------------------------
|
||||
insert into t1 (f1) values ('insert 3.5.3.7-1c');
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
insert 3.5.3.6-no
|
||||
insert 3.5.3.7-1a
|
||||
trig 3.5.3.7-2a
|
||||
update 3.5.3.7-1b
|
||||
trig 3.5.3.7-2b
|
||||
insert 3.5.3.7-1c
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.7-2a
|
||||
trig 3.5.3.7-2b
|
||||
update 3.5.3.7-1b
|
||||
drop trigger trg4c_1;
|
||||
show grants;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
|
||||
use priv_db;
|
||||
create trigger trg4c_2 before INSERT on t1 for each row
|
||||
set new.f1 = 'trig 3.5.3.7-2c';
|
||||
|
||||
SELECT priv added to bypass bug 15166
|
||||
-------------------------------------
|
||||
grant SELECT on priv_db.t1 to test_yesprivs@localhost;
|
||||
insert into t1 (f1) values ('insert 3.5.3.7-2c');
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
insert 3.5.3.6-no
|
||||
insert 3.5.3.7-1a
|
||||
trig 3.5.3.7-2a
|
||||
update 3.5.3.7-1b
|
||||
trig 3.5.3.7-2b
|
||||
insert 3.5.3.7-1c
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.7-2a
|
||||
trig 3.5.3.7-2b
|
||||
trig 3.5.3.7-2c
|
||||
update 3.5.3.7-1b
|
||||
drop trigger trg4c_2;
|
||||
|
||||
Testcase 3.5.3.7d:
|
||||
------------------
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
|
||||
grant SUPER on *.* to test_noprivs@localhost;
|
||||
grant TRIGGER on *.* to test_noprivs@localhost;
|
||||
grant SELECT (f1), INSERT (f1) on priv_db.t1 to test_noprivs@localhost;
|
||||
show grants for test_noprivs;
|
||||
Grants for test_noprivs@%
|
||||
GRANT SUPER ON *.* TO 'test_noprivs'@'%'
|
||||
GRANT TRIGGER ON *.* TO 'test_noprivs'@'%'
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
|
||||
grant SUPER on *.* to test_yesprivs@localhost;
|
||||
grant TRIGGER on *.* to test_yesprivs@localhost;
|
||||
grant UPDATE (f1) on priv_db.t1 to test_yesprivs@localhost;
|
||||
show grants for test_noprivs;
|
||||
Grants for test_noprivs@%
|
||||
GRANT SUPER ON *.* TO 'test_noprivs'@'%'
|
||||
GRANT TRIGGER ON *.* TO 'test_noprivs'@'%'
|
||||
connect(localhost,test_noprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
|
||||
connect(localhost,test_yesprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
|
||||
show grants;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT (f1), INSERT (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
|
||||
use priv_db;
|
||||
|
||||
Trigger create disabled - should fail - Bug 8884
|
||||
------------------------------------------------
|
||||
insert into t1 (f1) values ('insert 3.5.3.7-1d');
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
insert 3.5.3.6-no
|
||||
insert 3.5.3.7-1a
|
||||
trig 3.5.3.7-2a
|
||||
update 3.5.3.7-1b
|
||||
trig 3.5.3.7-2b
|
||||
insert 3.5.3.7-1c
|
||||
trig 3.5.3.7-2c
|
||||
insert 3.5.3.7-1d
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.7-2a
|
||||
trig 3.5.3.7-2b
|
||||
trig 3.5.3.7-2c
|
||||
update 3.5.3.7-1b
|
||||
drop trigger trg4d_1;
|
||||
show grants;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT UPDATE (f1) ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
|
||||
use priv_db;
|
||||
create trigger trg4d_2 before INSERT on t1 for each row
|
||||
set new.f1 = 'trig 3.5.3.7-2d';
|
||||
|
||||
SELECT priv added to bypass bug 15166
|
||||
-------------------------------------
|
||||
grant SELECT (f1) on priv_db.t1 to test_yesprivs@localhost;
|
||||
insert into t1 (f1) values ('insert 3.5.3.7-2d');
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
insert 3.5.3.6-no
|
||||
insert 3.5.3.7-1a
|
||||
trig 3.5.3.7-2a
|
||||
update 3.5.3.7-1b
|
||||
trig 3.5.3.7-2b
|
||||
insert 3.5.3.7-1c
|
||||
trig 3.5.3.7-2c
|
||||
insert 3.5.3.7-1d
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.2_2-yes
|
||||
trig 3.5.3.7-2a
|
||||
trig 3.5.3.7-2b
|
||||
trig 3.5.3.7-2c
|
||||
trig 3.5.3.7-2d
|
||||
update 3.5.3.7-1b
|
||||
drop trigger trg4d_2;
|
||||
|
||||
Testcase 3.5.3.8a:
|
||||
@ -444,12 +425,12 @@ grant ALL on *.* to test_noprivs@localhost;
|
||||
revoke SELECT on *.* from test_noprivs@localhost;
|
||||
show grants for test_noprivs@localhost;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
|
||||
grant SUPER, SELECT on *.* to test_yesprivs@localhost;
|
||||
grant TRIGGER, SELECT on *.* to test_yesprivs@localhost;
|
||||
show grants for test_yesprivs@localhost;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT SELECT, SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
connect(localhost,test_noprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
|
||||
connect(localhost,test_yesprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
|
||||
select current_user;
|
||||
@ -458,7 +439,7 @@ test_noprivs@localhost
|
||||
use priv_db;
|
||||
show grants;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
|
||||
Trigger create disabled - should fail - Bug 8887
|
||||
------------------------------------------------
|
||||
@ -477,17 +458,13 @@ current_user
|
||||
test_yesprivs@localhost
|
||||
show grants;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT SELECT, SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
create trigger trg5a_2 before INSERT on t1 for each row
|
||||
set @test_var= new.f1;
|
||||
set @test_var= 'before trig 3.5.3.8-2a';
|
||||
select @test_var;
|
||||
@test_var
|
||||
before trig 3.5.3.8-2a
|
||||
|
||||
UPDATE priv added to bypass bug 15166
|
||||
-------------------------------------
|
||||
grant UPDATE on *.* to test_yesprivs@localhost;
|
||||
insert into t1 (f1) values ('insert 3.5.3.8-2a');
|
||||
select @test_var;
|
||||
@test_var
|
||||
@ -497,26 +474,26 @@ drop trigger trg5a_2;
|
||||
Testcase: 3.5.3.8b
|
||||
------------------
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
|
||||
grant SUPER on *.* to test_noprivs@localhost;
|
||||
grant TRIGGER on *.* to test_noprivs@localhost;
|
||||
grant ALL on priv_db.* to test_noprivs@localhost;
|
||||
revoke SELECT on priv_db.* from test_noprivs@localhost;
|
||||
show grants for test_noprivs@localhost;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE ON `priv_db`.* TO 'test_noprivs'@'localhost'
|
||||
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER ON `priv_db`.* TO 'test_noprivs'@'localhost'
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
|
||||
grant SUPER on *.* to test_yesprivs@localhost;
|
||||
grant TRIGGER on *.* to test_yesprivs@localhost;
|
||||
grant SELECT on priv_db.* to test_yesprivs@localhost;
|
||||
show grants for test_yesprivs@localhost;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT ON `priv_db`.* TO 'test_yesprivs'@'localhost'
|
||||
connect(localhost,test_noprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
|
||||
connect(localhost,test_yesprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
|
||||
show grants;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE ON `priv_db`.* TO 'test_noprivs'@'localhost'
|
||||
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER ON `priv_db`.* TO 'test_noprivs'@'localhost'
|
||||
use priv_db;
|
||||
|
||||
Trigger create disabled - should fail - Bug 8887
|
||||
@ -533,7 +510,7 @@ before trig 3.5.3.8-1b
|
||||
drop trigger trg5b_1;
|
||||
show grants;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT ON `priv_db`.* TO 'test_yesprivs'@'localhost'
|
||||
use priv_db;
|
||||
create trigger trg5b_2 before UPDATE on t1 for each row
|
||||
@ -543,10 +520,6 @@ insert into t1 (f1) values ('insert 3.5.3.8-2b');
|
||||
select @test_var;
|
||||
@test_var
|
||||
before trig 3.5.3.8-2b
|
||||
|
||||
UPDATE priv added to bypass bug 15166
|
||||
-------------------------------------
|
||||
grant UPDATE on priv_db.* to test_yesprivs@localhost;
|
||||
update t1 set f1= 'update 3.5.3.8-2b' where f1 = 'insert 3.5.3.8-2b';
|
||||
select @test_var;
|
||||
@test_var
|
||||
@ -556,26 +529,26 @@ drop trigger trg5b_2;
|
||||
Testcase 3.5.3.8c:
|
||||
------------------
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
|
||||
grant SUPER on *.* to test_noprivs@localhost;
|
||||
grant TRIGGER on *.* to test_noprivs@localhost;
|
||||
grant ALL on priv_db.t1 to test_noprivs@localhost;
|
||||
revoke SELECT on priv_db.t1 from test_noprivs@localhost;
|
||||
show grants for test_noprivs@localhost;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
|
||||
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
|
||||
grant SUPER on *.* to test_yesprivs@localhost;
|
||||
grant TRIGGER on *.* to test_yesprivs@localhost;
|
||||
grant SELECT on priv_db.t1 to test_yesprivs@localhost;
|
||||
show grants for test_yesprivs@localhost;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
|
||||
connect(localhost,test_noprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
|
||||
connect(localhost,test_yesprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
|
||||
show grants;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
|
||||
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
|
||||
use priv_db;
|
||||
|
||||
Trigger create disabled - should fail - Bug 8887
|
||||
@ -588,16 +561,12 @@ before trig 3.5.3.8-1c
|
||||
drop trigger trg5c_1;
|
||||
show grants;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
|
||||
use priv_db;
|
||||
create trigger trg5c_2 before INSERT on t1 for each row
|
||||
set @test_var= new.f1;
|
||||
set @test_var='before trig 3.5.3.8-2c';
|
||||
|
||||
UPDATE priv added to bypass bug 15166
|
||||
-------------------------------------
|
||||
grant UPDATE on priv_db.t1 to test_yesprivs@localhost;
|
||||
insert into t1 (f1) values ('insert 3.5.3.8-2c');
|
||||
select @test_var;
|
||||
@test_var
|
||||
@ -607,24 +576,24 @@ drop trigger trg5c_2;
|
||||
Testcase: 3.5.3.8d:
|
||||
-------------------
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
|
||||
grant SUPER on *.* to test_noprivs@localhost;
|
||||
grant TRIGGER on *.* to test_noprivs@localhost;
|
||||
grant UPDATE (f1), INSERT (f1) on priv_db.t1 to test_noprivs@localhost;
|
||||
show grants for test_noprivs@localhost;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
|
||||
grant SUPER on *.* to test_yesprivs@localhost;
|
||||
grant TRIGGER on *.* to test_yesprivs@localhost;
|
||||
grant SELECT (f1) on priv_db.t1 to test_yesprivs@localhost;
|
||||
show grants for test_noprivs@localhost;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
|
||||
connect(localhost,test_noprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
|
||||
connect(localhost,test_yesprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
|
||||
show grants;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
|
||||
use priv_db;
|
||||
|
||||
@ -638,16 +607,12 @@ before trig 3.5.3.8-1d
|
||||
drop trigger trg5d_1;
|
||||
show grants;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT (f1) ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
|
||||
use priv_db;
|
||||
create trigger trg5d_2 before INSERT on t1 for each row
|
||||
set @test_var= new.f1;
|
||||
set @test_var='before trig 3.5.3.8-2d';
|
||||
|
||||
UPDATE priv added to bypass bug 15166
|
||||
-------------------------------------
|
||||
grant UPDATE (f1) on priv_db.t1 to test_yesprivs@localhost;
|
||||
insert into t1 (f1) values ('insert 3.5.3.8-2d');
|
||||
select @test_var;
|
||||
@test_var
|
||||
@ -662,12 +627,12 @@ drop table if exists t2;
|
||||
create table t1 (f1 int) engine= myisam;
|
||||
create table t2 (f2 int) engine= myisam;
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
|
||||
grant SUPER on *.* to test_yesprivs@localhost;
|
||||
grant TRIGGER on *.* to test_yesprivs@localhost;
|
||||
grant SELECT, UPDATE on priv_db.t1 to test_yesprivs@localhost;
|
||||
grant SELECT on priv_db.t2 to test_yesprivs@localhost;
|
||||
show grants for test_yesprivs@localhost;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT ON `priv_db`.`t2` TO 'test_yesprivs'@'localhost'
|
||||
GRANT SELECT, UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
|
||||
connect(localhost,test_yesprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
|
||||
@ -683,10 +648,10 @@ ERROR 42000: INSERT command denied to user 'test_yesprivs'@'localhost' for table
|
||||
revoke SELECT on priv_db.t2 from test_yesprivs@localhost;
|
||||
grant INSERT on priv_db.t2 to test_yesprivs@localhost;
|
||||
insert into t1 (f1) values (4);
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
4
|
||||
select f2 from t2;
|
||||
select f2 from t2 order by f2;
|
||||
f2
|
||||
4
|
||||
use priv_db;
|
||||
@ -699,11 +664,11 @@ ERROR 42000: UPDATE command denied to user 'test_yesprivs'@'localhost' for table
|
||||
revoke INSERT on priv_db.t2 from test_yesprivs@localhost;
|
||||
grant UPDATE on priv_db.t2 to test_yesprivs@localhost;
|
||||
insert into t1 (f1) values (2);
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
4
|
||||
2
|
||||
select f2 from t2;
|
||||
4
|
||||
select f2 from t2 order by f2;
|
||||
f2
|
||||
1
|
||||
use priv_db;
|
||||
@ -716,12 +681,12 @@ ERROR 42000: SELECT command denied to user 'test_yesprivs'@'localhost' for table
|
||||
revoke UPDATE on priv_db.t2 from test_yesprivs@localhost;
|
||||
grant SELECT on priv_db.t2 to test_yesprivs@localhost;
|
||||
insert into t1 (f1) values (1);
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
4
|
||||
2
|
||||
1
|
||||
select f2 from t2;
|
||||
2
|
||||
4
|
||||
select f2 from t2 order by f2;
|
||||
f2
|
||||
1
|
||||
select @aaa;
|
||||
@ -737,13 +702,13 @@ ERROR 42000: DELETE command denied to user 'test_yesprivs'@'localhost' for table
|
||||
revoke SELECT on priv_db.t2 from test_yesprivs@localhost;
|
||||
grant DELETE on priv_db.t2 to test_yesprivs@localhost;
|
||||
insert into t1 (f1) values (1);
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
4
|
||||
1
|
||||
1
|
||||
2
|
||||
1
|
||||
1
|
||||
select f2 from t2;
|
||||
4
|
||||
select f2 from t2 order by f2;
|
||||
f2
|
||||
drop database if exists priv_db;
|
||||
drop user test_yesprivs@localhost;
|
||||
|
@ -93,18 +93,18 @@ Create trigger trg1 BEFORE INSERT on t1
|
||||
for each row set new.f1='Trigger 3.5.4.1';
|
||||
Use db_drop;
|
||||
Insert into t1 values ('Insert error 3.5.4.1');
|
||||
Select * from t1;
|
||||
Select * from t1 order by f1;
|
||||
f1
|
||||
Trigger 3.5.4.1
|
||||
drop trigger trg1;
|
||||
select trigger_schema, trigger_name, event_object_table
|
||||
from information_schema.triggers;
|
||||
from information_schema.triggers order by trigger_name;
|
||||
trigger_schema trigger_name event_object_table
|
||||
Insert into t1 values ('Insert no trigger 3.5.4.1');
|
||||
Select * from t1;
|
||||
Select * from t1 order by f1;
|
||||
f1
|
||||
Trigger 3.5.4.1
|
||||
Insert no trigger 3.5.4.1
|
||||
Trigger 3.5.4.1
|
||||
drop trigger trg1;
|
||||
drop database if exists db_drop;
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM 'test_general'@'localhost';
|
||||
@ -258,7 +258,7 @@ use dbtest_one;
|
||||
Insert into dbtest_two.t2 values ('2nd Insert 3.5.5.4');
|
||||
Warnings:
|
||||
Warning 1265 Data truncated for column 'f1' at row 1
|
||||
Select * from dbtest_two.t2;
|
||||
Select * from dbtest_two.t2 order by f1;
|
||||
f1
|
||||
1st Insert 3.5.
|
||||
2nd Insert 3.5.
|
||||
|
@ -139,10 +139,10 @@ values ('1', 'Test 3.5.8.4', 222, 23456, 1.05);
|
||||
Select f120, f122, f136, f144, f163 from tb3 where f122= 'Test 3.5.8.4';
|
||||
f120 f122 f136 f144 f163
|
||||
1 Test 3.5.8.4 00222 0000023456 1.050000000000000000000000000000
|
||||
select * from db_test.t1_i;
|
||||
select * from db_test.t1_i order by i120;
|
||||
i120 i136 i144 i163
|
||||
1 00222 0000023456 1.050000000000000000000000000000
|
||||
select * from db_test.t1_u;
|
||||
select * from db_test.t1_u order by u120;
|
||||
u120 u136 u144 u163
|
||||
a 00111 0000099999 999.990000000000000000000000000000
|
||||
b 00222 0000023456 1.050000000000000000000000000000
|
||||
@ -150,7 +150,7 @@ c 00333 0000099999 999.990000000000000000000000000000
|
||||
d 00222 0000023456 1.050000000000000000000000000000
|
||||
e 00222 0000023456 1.050000000000000000000000000000
|
||||
f 00333 0000099999 999.990000000000000000000000000000
|
||||
select * from db_test.t1_d;
|
||||
select * from db_test.t1_d order by d120;
|
||||
d120 d136 d144 d163
|
||||
a 00111 0000099999 999.990000000000000000000000000000
|
||||
c 00333 0000099999 999.990000000000000000000000000000
|
||||
@ -162,14 +162,22 @@ select @test_var;
|
||||
3.5.8.4 - single SQL - insert
|
||||
-----------------------------
|
||||
Create trigger trg2 BEFORE UPDATE on tb3 for each row
|
||||
BEGIN
|
||||
insert into db_test.t1_i
|
||||
values (new.f120, new.f136, new.f144, new.f163);
|
||||
END//
|
||||
Select f120, f122, f136, f144, f163 from tb3 where f122 like 'Test 3.5.8.4%';
|
||||
f120 f122 f136 f144 f163
|
||||
1 Test 3.5.8.4 00222 0000023456 1.050000000000000000000000000000
|
||||
select * from db_test.t1_i order by i120;
|
||||
i120 i136 i144 i163
|
||||
1 00222 0000023456 1.050000000000000000000000000000
|
||||
update tb3 set f120='I', f122='Test 3.5.8.4-Single Insert'
|
||||
where f122='Test 3.5.8.4';
|
||||
Select f120, f122, f136, f144, f163 from tb3 where f122 like 'Test 3.5.8.4%';
|
||||
f120 f122 f136 f144 f163
|
||||
I Test 3.5.8.4-Single Insert 00222 0000023456 1.050000000000000000000000000000
|
||||
select * from db_test.t1_i;
|
||||
select * from db_test.t1_i order by i120;
|
||||
i120 i136 i144 i163
|
||||
1 00222 0000023456 1.050000000000000000000000000000
|
||||
I 00222 0000023456 1.050000000000000000000000000000
|
||||
@ -186,14 +194,14 @@ update tb3 set f120='U', f122='Test 3.5.8.4-Single Update'
|
||||
Select f120, f122, f136, f144, f163 from tb3 where f122 like 'Test 3.5.8.4%';
|
||||
f120 f122 f136 f144 f163
|
||||
U Test 3.5.8.4-Single Update 00222 0000023456 1.050000000000000000000000000000
|
||||
select * from db_test.t1_u;
|
||||
select * from db_test.t1_u order by u120;
|
||||
u120 u136 u144 u163
|
||||
a 00111 0000099999 999.990000000000000000000000000000
|
||||
U 00222 0000023456 1.050000000000000000000000000000
|
||||
c 00333 0000099999 999.990000000000000000000000000000
|
||||
U 00222 0000023456 1.050000000000000000000000000000
|
||||
U 00222 0000023456 1.050000000000000000000000000000
|
||||
f 00333 0000099999 999.990000000000000000000000000000
|
||||
U 00222 0000023456 1.050000000000000000000000000000
|
||||
U 00222 0000023456 1.050000000000000000000000000000
|
||||
U 00222 0000023456 1.050000000000000000000000000000
|
||||
|
||||
3.5.8.3/4 - single SQL - delete
|
||||
-------------------------------
|
||||
@ -206,7 +214,7 @@ f122='Test 3.5.8.4-Single Delete'
|
||||
Select f120, f122, f136, f144, f163 from tb3 where f122 like 'Test 3.5.8.4%';
|
||||
f120 f122 f136 f144 f163
|
||||
D Test 3.5.8.4-Single Delete 00444 0000023456 1.050000000000000000000000000000
|
||||
select * from db_test.t1_d;
|
||||
select * from db_test.t1_d order by d120;
|
||||
d120 d136 d144 d163
|
||||
a 00111 0000099999 999.990000000000000000000000000000
|
||||
c 00333 0000099999 999.990000000000000000000000000000
|
||||
@ -253,29 +261,29 @@ END//
|
||||
set @test_var='Empty', @test_var2=0;
|
||||
Insert into tb3 (f120, f122, f136) values ('1', 'Test 3.5.8.5-if', 101);
|
||||
select f120, f122, f136, @test_var, @test_var2
|
||||
from tb3 where f122 = 'Test 3.5.8.5-if';
|
||||
from tb3 where f122 = 'Test 3.5.8.5-if' order by f136;
|
||||
f120 f122 f136 @test_var @test_var2
|
||||
D Test 3.5.8.5-if 00101 one 2nd else
|
||||
Insert into tb3 (f120, f122, f136) values ('2', 'Test 3.5.8.5-if', 102);
|
||||
select f120, f122, f136, @test_var, @test_var2
|
||||
from tb3 where f122 = 'Test 3.5.8.5-if';
|
||||
from tb3 where f122 = 'Test 3.5.8.5-if' order by f136;
|
||||
f120 f122 f136 @test_var @test_var2
|
||||
D Test 3.5.8.5-if 00101 two 2nd else
|
||||
D Test 3.5.8.5-if 00102 two 2nd else
|
||||
Insert into tb3 (f120, f122, f136) values ('3', 'Test 3.5.8.5-if', 10);
|
||||
select f120, f122, f136, @test_var, @test_var2
|
||||
from tb3 where f122 = 'Test 3.5.8.5-if';
|
||||
from tb3 where f122 = 'Test 3.5.8.5-if' order by f136;
|
||||
f120 f122 f136 @test_var @test_var2
|
||||
d Test 3.5.8.5-if 00010 three 2nd if
|
||||
D Test 3.5.8.5-if 00101 three 2nd if
|
||||
D Test 3.5.8.5-if 00102 three 2nd if
|
||||
d Test 3.5.8.5-if 00010 three 2nd if
|
||||
Insert into tb3 (f120, f122, f136) values ('3', 'Test 3.5.8.5-if', 103);
|
||||
select f120, f122, f136, @test_var, @test_var2
|
||||
from tb3 where f122 = 'Test 3.5.8.5-if';
|
||||
from tb3 where f122 = 'Test 3.5.8.5-if' order by f136;
|
||||
f120 f122 f136 @test_var @test_var2
|
||||
d Test 3.5.8.5-if 00010 three 2nd else
|
||||
D Test 3.5.8.5-if 00101 three 2nd else
|
||||
D Test 3.5.8.5-if 00102 three 2nd else
|
||||
d Test 3.5.8.5-if 00010 three 2nd else
|
||||
D Test 3.5.8.5-if 00103 three 2nd else
|
||||
create trigger trg3 before update on tb3 for each row
|
||||
BEGIN
|
||||
@ -335,20 +343,20 @@ set @test_var='Empty';
|
||||
Insert into tb3 (f120, f122, f136, f144)
|
||||
values ('a', 'Test 3.5.8.5-case', 5, 7);
|
||||
select f120, f122, f136, f144, @test_var
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case';
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
|
||||
f120 f122 f136 f144 @test_var
|
||||
A Test 3.5.8.5-case 00125 0000000007 A*seven
|
||||
Insert into tb3 (f120, f122, f136, f144)
|
||||
values ('b', 'Test 3.5.8.5-case', 71,16);
|
||||
select f120, f122, f136, f144, @test_var
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case';
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
|
||||
f120 f122 f136 f144 @test_var
|
||||
A Test 3.5.8.5-case 00125 0000000007 B*0000000016
|
||||
B Test 3.5.8.5-case 00191 0000000016 B*0000000016
|
||||
Insert into tb3 (f120, f122, f136, f144)
|
||||
values ('c', 'Test 3.5.8.5-case', 80,1);
|
||||
select f120, f122, f136, f144, @test_var
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case';
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
|
||||
f120 f122 f136 f144 @test_var
|
||||
A Test 3.5.8.5-case 00125 0000000007 C=one
|
||||
B Test 3.5.8.5-case 00191 0000000016 C=one
|
||||
@ -358,34 +366,34 @@ values ('d', 'Test 3.5.8.5-case', 152);
|
||||
Warnings:
|
||||
Warning 1265 Data truncated for column 'f120' at row 1
|
||||
select f120, f122, f136, f144, @test_var
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case';
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
|
||||
f120 f122 f136 f144 @test_var
|
||||
1 Test 3.5.8.5-case 00152 0000099999 1*0000099999
|
||||
A Test 3.5.8.5-case 00125 0000000007 1*0000099999
|
||||
B Test 3.5.8.5-case 00191 0000000016 1*0000099999
|
||||
C Test 3.5.8.5-case 00200 0000000001 1*0000099999
|
||||
1 Test 3.5.8.5-case 00152 0000099999 1*0000099999
|
||||
Insert into tb3 (f120, f122, f136, f144)
|
||||
values ('e', 'Test 3.5.8.5-case', 200, 8);
|
||||
Warnings:
|
||||
Warning 1265 Data truncated for column 'f120' at row 1
|
||||
select f120, f122, f136, f144, @test_var
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case';
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
|
||||
f120 f122 f136 f144 @test_var
|
||||
1 Test 3.5.8.5-case 00152 0000099999 1=eight
|
||||
1 Test 3.5.8.5-case 00200 0000000008 1=eight
|
||||
A Test 3.5.8.5-case 00125 0000000007 1=eight
|
||||
B Test 3.5.8.5-case 00191 0000000016 1=eight
|
||||
C Test 3.5.8.5-case 00200 0000000001 1=eight
|
||||
1 Test 3.5.8.5-case 00152 0000099999 1=eight
|
||||
1 Test 3.5.8.5-case 00200 0000000008 1=eight
|
||||
Insert into tb3 (f120, f122, f136, f144)
|
||||
values ('f', 'Test 3.5.8.5-case', 100, 8);
|
||||
select f120, f122, f136, f144, @test_var
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case';
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
|
||||
f120 f122 f136 f144 @test_var
|
||||
1 Test 3.5.8.5-case 00152 0000099999 1=eight
|
||||
1 Test 3.5.8.5-case 00200 0000000008 1=eight
|
||||
A Test 3.5.8.5-case 00125 0000000007 1=eight
|
||||
B Test 3.5.8.5-case 00191 0000000016 1=eight
|
||||
C Test 3.5.8.5-case 00200 0000000001 1=eight
|
||||
1 Test 3.5.8.5-case 00152 0000099999 1=eight
|
||||
1 Test 3.5.8.5-case 00200 0000000008 1=eight
|
||||
create trigger trg3a before update on tb3 for each row
|
||||
BEGIN
|
||||
CASE
|
||||
|
@ -120,7 +120,7 @@ set @tr_var_af_118=old.f118, @tr_var_af_121=old.f121,
|
||||
Insert into tb3 (f122, f136, f163)
|
||||
values ('Test 3.5.9.3', 7, 123.17);
|
||||
Update tb3 Set f136=8 where f122='Test 3.5.9.3';
|
||||
select f118, f121, f122, f136, f163 from tb3 where f122='Test 3.5.9.3';
|
||||
select f118, f121, f122, f136, f163 from tb3 where f122='Test 3.5.9.3' order by f136;
|
||||
f118 f121 f122 f136 f163
|
||||
a NULL Test 3.5.9.3 00008 123.170000000000000000000000000000
|
||||
select @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122,
|
||||
@ -136,7 +136,7 @@ a NULL Test 3.5.9.3 7 123.170000000000000000000000000000
|
||||
@tr_var_af_118 @tr_var_af_121 @tr_var_af_122 @tr_var_af_136 @tr_var_af_163
|
||||
0 0 0 0 0
|
||||
delete from tb3 where f122='Test 3.5.9.3';
|
||||
select f118, f121, f122, f136, f163 from tb3 where f122='Test 3.5.9.3';
|
||||
select f118, f121, f122, f136, f163 from tb3 where f122='Test 3.5.9.3' order by f136;
|
||||
f118 f121 f122 f136 f163
|
||||
select @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122,
|
||||
@tr_var_b4_136, @tr_var_b4_163;
|
||||
@ -176,7 +176,7 @@ set @tr_var_af_118=new.f118, @tr_var_af_121=new.f121,
|
||||
Insert into tb3 (f122, f136, f151, f163)
|
||||
values ('Test 3.5.9.4', 7, DEFAULT, 995.24);
|
||||
select f118, f121, f122, f136, f151, f163 from tb3
|
||||
where f122 like 'Test 3.5.9.4%';
|
||||
where f122 like 'Test 3.5.9.4%' order by f163;
|
||||
f118 f121 f122 f136 f151 f163
|
||||
a NULL Test 3.5.9.4 00007 999 995.240000000000000000000000000000
|
||||
select @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122,
|
||||
@ -194,9 +194,9 @@ a NULL Test 3.5.9.4 7 999 995.240000000000000000000000000000
|
||||
Update tb3 Set f122='Test 3.5.9.4-trig', f136=NULL, f151=DEFAULT, f163=NULL
|
||||
where f122='Test 3.5.9.4';
|
||||
Warnings:
|
||||
Warning 1263 Column was set to data type implicit default; NULL supplied for NOT NULL column 'f136' at row 11
|
||||
Warning 1048 Column 'f136' cannot be null
|
||||
select f118, f121, f122, f136, f151, f163 from tb3
|
||||
where f122 like 'Test 3.5.9.4-trig';
|
||||
where f122 like 'Test 3.5.9.4-trig' order by f163;
|
||||
f118 f121 f122 f136 f151 f163
|
||||
a NULL Test 3.5.9.4-trig 00000 999 NULL
|
||||
select @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122,
|
||||
|
@ -87,7 +87,7 @@ Insert into vw11 (f122, f151) values ('Test 3.5.10.1/2/3', 1);
|
||||
Insert into vw11 (f122, f151) values ('Test 3.5.10.1/2/3', 2);
|
||||
Insert into vw11 (f122, f151) values ('Not in View', 3);
|
||||
select f121, f122, f151, f163
|
||||
from tb3 where f122 like 'Test 3.5.10.1/2/3%';
|
||||
from tb3 where f122 like 'Test 3.5.10.1/2/3%' order by f151;
|
||||
f121 f122 f151 f163
|
||||
NULL Test 3.5.10.1/2/3 1 111.110000000000000000000000000000
|
||||
NULL Test 3.5.10.1/2/3 2 111.110000000000000000000000000000
|
||||
@ -101,7 +101,7 @@ f121 f122 f151 f163
|
||||
NULL Not in View 3 111.110000000000000000000000000000
|
||||
Update vw11 set f163=1;
|
||||
select f121, f122, f151, f163 from tb3
|
||||
where f122 like 'Test 3.5.10.1/2/3%';
|
||||
where f122 like 'Test 3.5.10.1/2/3%' order by f151;
|
||||
f121 f122 f151 f163
|
||||
Y Test 3.5.10.1/2/3-Update 1 1.000000000000000000000000000000
|
||||
Y Test 3.5.10.1/2/3-Update 2 1.000000000000000000000000000000
|
||||
@ -115,7 +115,7 @@ before delete
|
||||
0
|
||||
delete from vw11 where f151=1;
|
||||
select f121, f122, f151, f163 from tb3
|
||||
where f122 like 'Test 3.5.10.1/2/3%';
|
||||
where f122 like 'Test 3.5.10.1/2/3%' order by f151;
|
||||
f121 f122 f151 f163
|
||||
Y Test 3.5.10.1/2/3-Update 2 1.000000000000000000000000000000
|
||||
select f121, f122, f151, f163 from vw11;
|
||||
@ -146,7 +146,7 @@ load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t9.txt' into table tb_load;
|
||||
select @counter as 'Rows Loaded After';
|
||||
Rows Loaded After
|
||||
10
|
||||
Select * from tb_load limit 10;
|
||||
Select * from tb_load order by f1 limit 10;
|
||||
f1 f2 f3
|
||||
-5000 a` 1000
|
||||
-4999 aaa 999
|
||||
@ -241,7 +241,7 @@ insert into t3 (f1) values (new.f1+1000);
|
||||
create trigger tr2_4 after insert on t2_4 for each row
|
||||
insert into t3 (f1) values (new.f1+10000);
|
||||
insert into t1 values (1);
|
||||
select * from t3;
|
||||
select * from t3 order by f1;
|
||||
f1
|
||||
12
|
||||
102
|
||||
@ -276,17 +276,17 @@ create trigger tr4 after insert on t4
|
||||
for each row insert into t1 (f1) values (new.f4+1);
|
||||
insert into t1 values (1);
|
||||
ERROR HY000: Can't update table 't1' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
|
||||
select * from t1;
|
||||
select * from t1 order by f1;
|
||||
f1
|
||||
0
|
||||
1
|
||||
select * from t2;
|
||||
select * from t2 order by f2;
|
||||
f2
|
||||
2
|
||||
select * from t3;
|
||||
select * from t3 order by f3;
|
||||
f3
|
||||
3
|
||||
select * from t4;
|
||||
select * from t4 order by f4;
|
||||
f4
|
||||
4
|
||||
drop trigger tr1;
|
||||
@ -373,7 +373,7 @@ create table t4 (f4 tinyint) engine = myisam;
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`f1` int(11) default NULL
|
||||
`f1` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
insert into t1 values (1);
|
||||
create trigger tr1 after insert on t1
|
||||
@ -385,16 +385,16 @@ for each row insert into t4 (f4) values (new.f3+1000);
|
||||
set autocommit=0;
|
||||
start transaction;
|
||||
insert into t1 values (1);
|
||||
ERROR 22003: Out of range value adjusted for column 'f4' at row 1
|
||||
ERROR 22003: Out of range value for column 'f4' at row 1
|
||||
commit;
|
||||
select * from t1;
|
||||
select * from t1 order by f1;
|
||||
f1
|
||||
1
|
||||
1
|
||||
select * from t2;
|
||||
select * from t2 order by f2;
|
||||
f2
|
||||
2
|
||||
select * from t3;
|
||||
select * from t3 order by f3;
|
||||
f3
|
||||
3
|
||||
drop trigger tr1;
|
||||
|
@ -470,7 +470,8 @@ SET @x=0;
|
||||
CREATE or REPLACE VIEW v1 AS Select 1 INTO @x;
|
||||
ERROR HY000: View's SELECT contains a 'INTO' clause
|
||||
Select @x;
|
||||
ERROR HY000: View's SELECT contains a variable or parameter
|
||||
@x
|
||||
0
|
||||
CREATE or REPLACE VIEW v1 AS Select 1
|
||||
FROM (SELECT 1 FROM t1) my_table;
|
||||
ERROR HY000: View's SELECT contains a subquery in the FROM clause
|
||||
@ -607,7 +608,9 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
|
||||
CREATE or REPLACE view v1 as Select f59, f60
|
||||
from tb2 by group f59 ;
|
||||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'by group f59' at line 2
|
||||
ERROR HY000: View's SELECT contains a variable or parameter
|
||||
|
||||
Testcase 3.3.1.5
|
||||
--------------------------------------------------------------------------------
|
||||
DROP VIEW IF EXISTS v1 ;
|
||||
CREATE VIEW v1 SELECT * FROM tb2 limit 100 ;
|
||||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT * FROM tb2 limit 100' at line 1
|
||||
@ -627,7 +630,9 @@ CREATE VIEW v1 SELECT 1;
|
||||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT 1' at line 1
|
||||
CREATE VIEW v1 AS ;
|
||||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
|
||||
ERROR HY000: View's SELECT contains a variable or parameter
|
||||
|
||||
Testcase 3.3.1.6
|
||||
--------------------------------------------------------------------------------
|
||||
DROP VIEW IF EXISTS v1 ;
|
||||
CREATE or REPLACE VIEW v1
|
||||
as SELECT * from tb2 limit 100 ;
|
||||
@ -1812,7 +1817,9 @@ ERROR HY000: View's SELECT contains a subquery in the FROM clause
|
||||
SELECT * FROM test.v1 ;
|
||||
ERROR 42S02: Table 'test.v1' doesn't exist
|
||||
Drop view if exists test.v1 ;
|
||||
ERROR HY000: View's SELECT contains a variable or parameter
|
||||
|
||||
Testcase 3.3.1.40
|
||||
--------------------------------------------------------------------------------
|
||||
Drop view if exists test.v1 ;
|
||||
Set @var1 = 'ABC' ;
|
||||
Set @var2 = 'XYZ' ;
|
||||
@ -1821,7 +1828,9 @@ ERROR HY000: View's SELECT contains a variable or parameter
|
||||
CREATE VIEW test.v1 AS SELECT @@global.sort_buffer_size;
|
||||
ERROR HY000: View's SELECT contains a variable or parameter
|
||||
Drop view if exists test.v1 ;
|
||||
ERROR HY000: View's SELECT contains a variable or parameter
|
||||
|
||||
Testcase 3.3.1.41
|
||||
--------------------------------------------------------------------------------
|
||||
Drop view if exists test.v1 ;
|
||||
Drop procedure if exists sp1 ;
|
||||
Create procedure sp1() DETERMINISTIC
|
||||
@ -1838,7 +1847,9 @@ Warnings:
|
||||
Note 1051 Unknown table 'test.v1'
|
||||
Drop procedure sp1 ;
|
||||
ERROR 42000: PROCEDURE test.sp1 does not exist
|
||||
ERROR HY000: View's SELECT contains a variable or parameter
|
||||
|
||||
Testcase 3.3.1.42
|
||||
--------------------------------------------------------------------------------
|
||||
Drop VIEW if exists test.v1 ;
|
||||
CREATE TEMPORARY VIEW test.v1 AS
|
||||
SELECT * FROM test.tb2 limit 2 ;
|
||||
@ -1850,7 +1861,9 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
|
||||
SELECT * FROM test.tb2 limit 2' at line 1
|
||||
Drop view if exists test.v1 ;
|
||||
Use test;
|
||||
ERROR HY000: View's SELECT contains a variable or parameter
|
||||
|
||||
Testcase 3.3.1.43
|
||||
--------------------------------------------------------------------------------
|
||||
Drop view if exists test.v1 ;
|
||||
CREATE VIEW test.v1 AS SELECT f59,f60 FROM test.tb2;
|
||||
INSERT INTO test.v1 values(122,432);
|
||||
@ -1935,7 +1948,7 @@ f1 f2
|
||||
2 two
|
||||
4 four
|
||||
INSERT INTO v1 VALUES(2,'two');
|
||||
ERROR 23000: Duplicate entry '2' for key 1
|
||||
ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
|
||||
INSERT INTO v1 VALUES(3,'three');
|
||||
affected rows: 1
|
||||
INSERT INTO v1 VALUES(6,'six');
|
||||
@ -1954,7 +1967,7 @@ f1 f2
|
||||
3 three
|
||||
4 four
|
||||
UPDATE v1 SET f1 = 2 WHERE f1 = 3;
|
||||
ERROR 23000: Duplicate entry '2' for key 1
|
||||
ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
|
||||
UPDATE v1 SET f2 = 'number' WHERE f1 = 3;
|
||||
affected rows: 1
|
||||
info: Rows matched: 1 Changed: 1 Warnings: 0
|
||||
@ -2001,12 +2014,12 @@ DROP VIEW IF EXISTS test.v1;
|
||||
CREATE TABLE t1 (f1 ENUM('A', 'B', 'C') NOT NULL, f2 INTEGER)
|
||||
ENGINE = myisam;
|
||||
INSERT INTO t1 VALUES ('A', 1);
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 order by f1, f2;
|
||||
f1 f2
|
||||
A 1
|
||||
CREATE VIEW v1 AS SELECT * FROM t1 WHERE f2 BETWEEN 1 AND 2
|
||||
WITH CASCADED CHECK OPTION ;
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by f1, f2;
|
||||
f1 f2
|
||||
A 1
|
||||
UPDATE v1 SET f2 = 2 WHERE f2 = 1;
|
||||
@ -2014,7 +2027,7 @@ affected rows: 1
|
||||
info: Rows matched: 1 Changed: 1 Warnings: 0
|
||||
INSERT INTO v1 VALUES('B',2);
|
||||
affected rows: 1
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by f1, f2;
|
||||
f1 f2
|
||||
A 2
|
||||
B 2
|
||||
@ -2022,7 +2035,7 @@ UPDATE v1 SET f2 = 4;
|
||||
ERROR HY000: CHECK OPTION failed 'test.v1'
|
||||
INSERT INTO v1 VALUES('B',3);
|
||||
ERROR HY000: CHECK OPTION failed 'test.v1'
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by f1, f2;
|
||||
f1 f2
|
||||
A 2
|
||||
B 2
|
||||
@ -10562,7 +10575,7 @@ f1 f2 f3 f4
|
||||
DELETE FROM t1;
|
||||
INSERT INTO v1 SET f2 = 'ABC';
|
||||
INSERT INTO v1 SET f2 = 'ABC';
|
||||
ERROR 23000: Duplicate entry '0' for key 1
|
||||
ERROR 23000: Duplicate entry '0' for key 'PRIMARY'
|
||||
SELECT * from t1;
|
||||
f1 f2 f3 f4
|
||||
0 ABC NULL NULL
|
||||
@ -10631,7 +10644,7 @@ DROP VIEW v1;
|
||||
CREATE VIEW v1 AS SELECT f2, f3 FROM t1;
|
||||
INSERT INTO v1 SET f2 = 'ABC';
|
||||
INSERT INTO v1 SET f2 = 'ABC';
|
||||
ERROR 23000: Duplicate entry '0' for key 1
|
||||
ERROR 23000: Duplicate entry '0' for key 'PRIMARY'
|
||||
SELECT * from t1;
|
||||
f1 f2 f3 f4
|
||||
0 ABC NULL NULL
|
||||
@ -10966,11 +10979,11 @@ f1 bigint(20) YES NULL
|
||||
f2 date YES NULL
|
||||
f4 char(5) YES NULL
|
||||
report char(10) YES NULL
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 order by f1, report;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by f1, report;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
@ -10990,12 +11003,12 @@ f4x char(5) YES NULL
|
||||
report char(10) YES NULL
|
||||
DESCRIBE v1;
|
||||
ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 order by f1, report;
|
||||
f1 f2 f4x report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
0 NULL ABC t1 1
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by f1, report;
|
||||
ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
|
||||
ALTER TABLE t1 CHANGE COLUMN f4x f4 CHAR(5);
|
||||
ALTER TABLE t1 CHANGE COLUMN f4 f4 CHAR(10);
|
||||
@ -11013,14 +11026,14 @@ f1 bigint(20) YES NULL
|
||||
f2 date YES NULL
|
||||
f4 char(10) YES NULL
|
||||
report char(10) YES NULL
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 order by f1, report;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
0 NULL ABC t1 1
|
||||
2 NULL <-- 10 --> t1 2
|
||||
2 NULL <-- 10 --> v1 2
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by f1, report;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
@ -11049,7 +11062,7 @@ f1 bigint(20) YES NULL
|
||||
f2 date YES NULL
|
||||
f4 char(8) YES NULL
|
||||
report char(10) YES NULL
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 order by f1, report;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
@ -11058,7 +11071,7 @@ f1 f2 f4 report
|
||||
2 NULL <-- 10 - v1 2
|
||||
3 NULL <-- 10 - t1 3
|
||||
3 NULL <-- 10 - v1 3
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by f1, report;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
@ -11082,7 +11095,7 @@ f1 bigint(20) YES NULL
|
||||
f2 date YES NULL
|
||||
f4 varchar(20) YES NULL
|
||||
report char(10) YES NULL
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 order by f1, report;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
@ -11093,7 +11106,7 @@ f1 f2 f4 report
|
||||
3 NULL <-- 10 - v1 3
|
||||
4 NULL <------ 20 --------> t1 4
|
||||
4 NULL <------ 20 --------> v1 4
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by f1, report;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
@ -11121,7 +11134,7 @@ f1 varchar(30) YES NULL
|
||||
f2 date YES NULL
|
||||
f4 varchar(20) YES NULL
|
||||
report char(10) YES NULL
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 order by f1, report;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
@ -11134,7 +11147,7 @@ f1 f2 f4 report
|
||||
4 NULL <------ 20 --------> v1 4
|
||||
<------------- 30 -----------> NULL <------ 20 --------> t1 5
|
||||
<------------- 30 -----------> NULL <------ 20 --------> v1 5
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by f1, report;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
@ -11158,7 +11171,7 @@ f4 varchar(20) YES NULL
|
||||
report char(10) YES NULL
|
||||
DESCRIBE v1;
|
||||
ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 order by f1, report;
|
||||
f1 f4 report
|
||||
-1 ABC t1 0
|
||||
-1 ABC v1 0
|
||||
@ -11172,7 +11185,7 @@ f1 f4 report
|
||||
<------------- 30 -----------> <------ 20 --------> t1 5
|
||||
<------------- 30 -----------> <------ 20 --------> v1 5
|
||||
ABC <------ 20 --------> t1 6
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by f1, report;
|
||||
ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
|
||||
ALTER TABLE t1 ADD COLUMN f2 DATE DEFAULT NULL;
|
||||
INSERT INTO t1 SET f1 = 'ABC', f2 = '1500-12-04',
|
||||
@ -11191,7 +11204,7 @@ f1 varchar(30) YES NULL
|
||||
f2 date YES NULL
|
||||
f4 varchar(20) YES NULL
|
||||
report char(10) YES NULL
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 order by f1, report;
|
||||
f1 f4 report f2
|
||||
-1 ABC t1 0 NULL
|
||||
-1 ABC v1 0 NULL
|
||||
@ -11207,7 +11220,7 @@ f1 f4 report f2
|
||||
ABC <------ 20 --------> t1 6 NULL
|
||||
ABC <------ 20 --------> t1 7 1500-12-04
|
||||
ABC <------ 20 --------> v1 7 1500-12-04
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by f1, report;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
@ -11241,7 +11254,7 @@ f1 varchar(30) YES NULL
|
||||
f2 float YES NULL
|
||||
f4 varchar(20) YES NULL
|
||||
report char(10) YES NULL
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 order by f1, report;
|
||||
f1 f4 report f2
|
||||
-1 ABC t1 0 NULL
|
||||
-1 ABC v1 0 NULL
|
||||
@ -11256,10 +11269,10 @@ f1 f4 report f2
|
||||
<------------- 30 -----------> <------ 20 --------> v1 5 NULL
|
||||
ABC <------ 20 --------> t1 6 NULL
|
||||
ABC <------ 20 --------> t1 7 NULL
|
||||
ABC <------ 20 --------> v1 7 NULL
|
||||
ABC <------ 20 --------> t1 8 -0.00033
|
||||
ABC <------ 20 --------> v1 7 NULL
|
||||
ABC <------ 20 --------> v1 8 -0.00033
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by f1, report;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
@ -11274,8 +11287,8 @@ f1 f2 f4 report
|
||||
<------------- 30 -----------> NULL <------ 20 --------> v1 5
|
||||
ABC NULL <------ 20 --------> t1 6
|
||||
ABC NULL <------ 20 --------> t1 7
|
||||
ABC NULL <------ 20 --------> v1 7
|
||||
ABC -0.00033 <------ 20 --------> t1 8
|
||||
ABC NULL <------ 20 --------> v1 7
|
||||
ABC -0.00033 <------ 20 --------> v1 8
|
||||
ALTER TABLE t1 ADD COLUMN f3 NUMERIC(7,2);
|
||||
INSERT INTO t1 SET f1 = 'ABC', f2 = -3.3E-4,
|
||||
@ -11298,7 +11311,7 @@ f1 varchar(30) YES NULL
|
||||
f2 float YES NULL
|
||||
f4 varchar(20) YES NULL
|
||||
report char(10) YES NULL
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 order by f1, report;
|
||||
f1 f4 report f2 f3
|
||||
-1 ABC t1 0 NULL NULL
|
||||
-1 ABC v1 0 NULL NULL
|
||||
@ -11313,12 +11326,12 @@ f1 f4 report f2 f3
|
||||
<------------- 30 -----------> <------ 20 --------> v1 5 NULL NULL
|
||||
ABC <------ 20 --------> t1 6 NULL NULL
|
||||
ABC <------ 20 --------> t1 7 NULL NULL
|
||||
ABC <------ 20 --------> v1 7 NULL NULL
|
||||
ABC <------ 20 --------> t1 8 -0.00033 NULL
|
||||
ABC <------ 20 --------> v1 8 -0.00033 NULL
|
||||
ABC <------ 20 --------> t1 9 -0.00033 -2.20
|
||||
ABC <------ 20 --------> v1 7 NULL NULL
|
||||
ABC <------ 20 --------> v1 8 -0.00033 NULL
|
||||
ABC <------ 20 --------> v1 9a -0.00033 NULL
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by f1, report;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
@ -11333,10 +11346,10 @@ f1 f2 f4 report
|
||||
<------------- 30 -----------> NULL <------ 20 --------> v1 5
|
||||
ABC NULL <------ 20 --------> t1 6
|
||||
ABC NULL <------ 20 --------> t1 7
|
||||
ABC NULL <------ 20 --------> v1 7
|
||||
ABC -0.00033 <------ 20 --------> t1 8
|
||||
ABC -0.00033 <------ 20 --------> v1 8
|
||||
ABC -0.00033 <------ 20 --------> t1 9
|
||||
ABC NULL <------ 20 --------> v1 7
|
||||
ABC -0.00033 <------ 20 --------> v1 8
|
||||
ABC -0.00033 <------ 20 --------> v1 9a
|
||||
DROP TABLE t1;
|
||||
DROP VIEW v1;
|
||||
@ -11351,10 +11364,10 @@ DESCRIBE v1;
|
||||
Field Type Null Key Default Extra
|
||||
f1 char(10) YES NULL
|
||||
my_sqrt double YES NULL
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 order by f1, f2;
|
||||
f1 f2
|
||||
ABC 3
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by 2;
|
||||
f1 my_sqrt
|
||||
ABC 1.7320508075689
|
||||
ALTER TABLE t1 CHANGE COLUMN f2 f2 VARCHAR(30);
|
||||
@ -11367,21 +11380,21 @@ DESCRIBE v1;
|
||||
Field Type Null Key Default Extra
|
||||
f1 char(10) YES NULL
|
||||
my_sqrt double YES NULL
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 order by f1, f2;
|
||||
f1 f2
|
||||
ABC 3
|
||||
ABC DEF
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by 2;
|
||||
f1 my_sqrt
|
||||
ABC 1.7320508075689
|
||||
ABC 0
|
||||
ABC 1.7320508075689
|
||||
SELECT SQRT('DEF');
|
||||
SQRT('DEF')
|
||||
0
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect DOUBLE value: 'DEF'
|
||||
CREATE VIEW v2 AS SELECT SQRT('DEF');
|
||||
SELECT * FROM v2;
|
||||
SELECT * FROM v2 order by 1;
|
||||
SQRT('DEF')
|
||||
0
|
||||
Warnings:
|
||||
@ -11391,27 +11404,27 @@ DESCRIBE v2;
|
||||
Field Type Null Key Default Extra
|
||||
f1 char(10) YES NULL
|
||||
my_sqrt double YES NULL
|
||||
SELECT * FROM v2;
|
||||
SELECT * FROM v2 order by 2;
|
||||
f1 my_sqrt
|
||||
ABC 0
|
||||
ABC 1.7320508075689
|
||||
ABC 0
|
||||
CREATE TABLE t2 AS SELECT f1, SQRT(f2) my_sqrt FROM t1;
|
||||
SELECT * FROM t2;
|
||||
SELECT * FROM t2 order by 2;
|
||||
f1 my_sqrt
|
||||
ABC 1.73205080756888
|
||||
ABC 0
|
||||
ABC 1.73205080756888
|
||||
DROP TABLE t2;
|
||||
CREATE TABLE t2 AS SELECT * FROM v1;
|
||||
SELECT * FROM t2;
|
||||
SELECT * FROM t2 order by 2;
|
||||
f1 my_sqrt
|
||||
ABC 1.73205080756888
|
||||
ABC 0
|
||||
ABC 1.73205080756888
|
||||
DROP TABLE t2;
|
||||
CREATE TABLE t2 AS SELECT * FROM v2;
|
||||
SELECT * FROM t2;
|
||||
SELECT * FROM t2 order by 2;
|
||||
f1 my_sqrt
|
||||
ABC 1.73205080756888
|
||||
ABC 0
|
||||
ABC 1.73205080756888
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
||||
DROP VIEW v1;
|
||||
|
@ -209,7 +209,7 @@ BEGIN
|
||||
set @x = x;
|
||||
set @y = y;
|
||||
set @z = 234;
|
||||
SELECT f1, f2 into @x, @y from t2 limit 1;
|
||||
SELECT f1, f2 into @x, @y from t2 where f1='a`' and f2='a`' limit 1;
|
||||
SELECT @x, @y, @z, invar;
|
||||
BEGIN
|
||||
set @x = 2;
|
||||
@ -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 limit 1;
|
||||
SELECT f4, f3 into @x, @y from t2 where f4=-5000 and f3='1000-01-01' limit 1;
|
||||
SELECT @x, @y;
|
||||
END//
|
||||
delimiter ;//
|
||||
@ -1271,7 +1271,8 @@ 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 limit 3;
|
||||
declare cur1 cursor for SELECT f1, f2, f4, f5, f6 from t2
|
||||
where f4 >=-5000 order by f4 limit 3;
|
||||
open cur1;
|
||||
while proceed do
|
||||
SELECT count AS 'loop';
|
||||
@ -1368,7 +1369,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;
|
||||
SELECT f1, f2, f4, f5 from t2 order by f4;
|
||||
|
||||
delimiter //;
|
||||
CREATE PROCEDURE sp1( )
|
||||
@ -1379,21 +1380,21 @@ BEGIN
|
||||
declare newf2 char(20);
|
||||
declare newf5 char(20);
|
||||
declare newf4 integer;
|
||||
declare cur1 cursor for SELECT f1, f2, f4, f5 from t2 limit 5;
|
||||
declare cur2 cursor for SELECT f1, f2, f4, f5 from t2 limit 5;
|
||||
declare cur1 cursor for SELECT f1, f2, f4, f5 from t2 where f4 >= -5000 order by f4 limit 5;
|
||||
declare cur2 cursor for SELECT f1, f2, f4, f5 from t2 where f4 >= -5000 order by f4 limit 5;
|
||||
open cur1;
|
||||
open cur2;
|
||||
BEGIN
|
||||
declare continue handler for sqlstate '02000' set count = 1;
|
||||
declare continue handler for sqlstate '02000' set count=1;
|
||||
fetch cur1 into newf1, newf2, newf4, newf5;
|
||||
SELECT '-1-', count, newf1, newf2, newf4, newf5;
|
||||
insert into temp1 values ('cur1_out', newf1, newf2, newf4, newf5);
|
||||
set count = 4;
|
||||
set count= 4;
|
||||
BEGIN
|
||||
while count > 0 do
|
||||
while count> 0 do
|
||||
fetch cur1 into newf1, newf2, newf4, newf5;
|
||||
SELECT '-2-', count, newf1, newf2, newf4, newf5;
|
||||
set count = count - 1;
|
||||
set count = count- 1;
|
||||
END while;
|
||||
SELECT '-3-', count, newf1, newf2, newf4, newf4;
|
||||
END;
|
||||
@ -1453,8 +1454,10 @@ 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 limit 4;
|
||||
declare cur2 cursor for SELECT f1, f2, f3, f4 from t2 limit 3;
|
||||
declare cur1 cursor for SELECT f1, f2, f3, f4 from t2
|
||||
where f4>=-5000 order by f4 limit 4;
|
||||
declare cur2 cursor for SELECT f1, f2, f3, f4 from t2
|
||||
where f4>=-5000 order by f4 limit 3;
|
||||
declare continue handler for sqlstate '02000' set proceed=0;
|
||||
open cur1;
|
||||
open cur2;
|
||||
@ -1486,8 +1489,10 @@ 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 LIMIT 5;
|
||||
DECLARE cur2 CURSOR FOR SELECT f1, f2, f3, f4 FROM t2 LIMIT 5;
|
||||
DECLARE cur1 CURSOR FOR SELECT f1, f2, f3, f4 FROM t2
|
||||
WHERE f4>=-5000 ORDER BY f4 LIMIT 5;
|
||||
DECLARE cur2 CURSOR FOR SELECT f1, f2, f3, f4 FROM t2
|
||||
WHERE f4>=-5000 ORDER BY f4 LIMIT 5;
|
||||
DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET proceed=0;
|
||||
OPEN cur1;
|
||||
OPEN cur2;
|
||||
|
@ -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 LIMIT 1;
|
||||
SELECT * FROM db_storedproc.t1 WHERE f4=-5000 LIMIT 1;
|
||||
END//
|
||||
delimiter ;//
|
||||
|
||||
@ -244,21 +244,21 @@ delimiter ;//
|
||||
|
||||
CALL sp_ins_1();
|
||||
SELECT row_count();
|
||||
SELECT * FROM temp;
|
||||
SELECT * FROM temp ORDER BY f4;
|
||||
|
||||
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;
|
||||
SELECT * FROM temp ORDER BY f4;
|
||||
|
||||
CALL sp_upd();
|
||||
SELECT row_count();
|
||||
SELECT * FROM temp;
|
||||
SELECT * FROM temp ORDER BY f4;
|
||||
|
||||
#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;
|
||||
SELECT * FROM temp ORDER BY f4;
|
||||
|
||||
# cleanup
|
||||
DROP PROCEDURE sp_ins_1;
|
||||
|
@ -6,19 +6,16 @@ let $message= .
|
||||
. IMPORTANT NOTICE:
|
||||
. -----------------
|
||||
.
|
||||
. FIXME: The <engine>_storedproc.result files are still NOT CHECKED
|
||||
. for correctness!
|
||||
. FIXME: The .result files are still NOT CHECKED for correctness!
|
||||
.
|
||||
. FIXME: Several tests are affected by known problems around DECIMAL
|
||||
. FIXME: and NUMERIC that needs to be checked again after WL#2984
|
||||
. FIXME: and NUMERIC that will be checked again after WL#2984 once
|
||||
. FIXME: has been completed. Some of them are marked in the result.
|
||||
.
|
||||
. 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.
|
||||
. 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).
|
||||
.;
|
||||
--source include/show_msg80.inc
|
||||
|
||||
@ -914,7 +911,7 @@ SELECT * from t1 where f2 = f1;
|
||||
#/t'ql/mysql-test
|
||||
#t]# t@localhost t
|
||||
|
||||
#FIXME check this is OK:--error 1064
|
||||
--error 0,1064
|
||||
CREATE PROCEDURE function()
|
||||
SELECT * from t1 where f2=f1;
|
||||
DROP PROCEDURE function;
|
||||
@ -1015,7 +1012,7 @@ CREATE PROCEDURE collate()
|
||||
CREATE PROCEDURE column()
|
||||
SELECT * from t1 where f2=f1;
|
||||
|
||||
#FIXME check this is OK:--error 1064
|
||||
--error 1064
|
||||
CREATE PROCEDURE columns()
|
||||
SELECT * from t1 where f2=f1;
|
||||
DROP PROCEDURE columns;
|
||||
@ -1192,7 +1189,7 @@ CREATE PROCEDURE false()
|
||||
CREATE PROCEDURE fetch()
|
||||
SELECT * from t1 where f2=f1;
|
||||
|
||||
#FIXME check this is OK:--error 1064
|
||||
--error 1064
|
||||
CREATE PROCEDURE fields()
|
||||
SELECT * from t1 where f2=f1;
|
||||
DROP PROCEDURE fields;
|
||||
@ -1213,7 +1210,7 @@ CREATE PROCEDURE force()
|
||||
CREATE PROCEDURE foreign()
|
||||
SELECT * from t1 where f2=f1;
|
||||
|
||||
#FIXME check this is OK:--error 1064
|
||||
--error 1064
|
||||
CREATE PROCEDURE found()
|
||||
SELECT * from t1 where f2=f1;
|
||||
DROP PROCEDURE found;
|
||||
@ -1226,7 +1223,7 @@ CREATE PROCEDURE from()
|
||||
CREATE PROCEDURE fulltext()
|
||||
SELECT * from t1 where f2=f1;
|
||||
|
||||
#FIXME check this is OK:--error 1064
|
||||
--error 1064
|
||||
CREATE PROCEDURE goto()
|
||||
SELECT * from t1 where f2=f1;
|
||||
DROP PROCEDURE goto;
|
||||
@ -1495,7 +1492,7 @@ CREATE PROCEDURE precision()
|
||||
CREATE PROCEDURE primary()
|
||||
SELECT * from t1 where f2=f1;
|
||||
|
||||
#FIXME check this is OK:--error 1064
|
||||
--error 1064
|
||||
CREATE PROCEDURE privileges()
|
||||
SELECT * from t1 where f2=f1;
|
||||
DROP PROCEDURE privileges;
|
||||
@ -1656,7 +1653,7 @@ CREATE PROCEDURE straight_join()
|
||||
CREATE PROCEDURE table()
|
||||
SELECT * from t1 where f2=f1;
|
||||
|
||||
#FIXME check this is OK:--error 1064
|
||||
--error 1064
|
||||
CREATE PROCEDURE tables()
|
||||
SELECT * from t1 where f2=f1;
|
||||
DROP PROCEDURE tables;
|
||||
@ -1837,7 +1834,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;
|
||||
|
||||
#FIXME check this is OK:--error 1064
|
||||
--error 1064
|
||||
CREATE FUNCTION text(f1 text) returns text
|
||||
return f1;
|
||||
DROP FUNCTION text;
|
||||
@ -10128,7 +10125,7 @@ DROP PROCEDURE IF EXISTS sp1;
|
||||
--enable_warnings
|
||||
|
||||
delimiter //;
|
||||
--error 1064
|
||||
#FIXME check this is OK:--error 1064
|
||||
CREATE PROCEDURE sp1()
|
||||
BEGIN
|
||||
declare precision char;
|
||||
@ -10430,7 +10427,7 @@ delimiter ;//
|
||||
DROP PROCEDURE IF EXISTS sp1;
|
||||
|
||||
delimiter //;
|
||||
--error 1064
|
||||
#FIXME check this is OK:--error 1064
|
||||
CREATE PROCEDURE sp1()
|
||||
BEGIN
|
||||
declare soname char;
|
||||
|
@ -214,21 +214,29 @@ 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;
|
||||
select trigger_name from information_schema.triggers order by trigger_name;
|
||||
|
||||
#Cleanup
|
||||
--disable_warnings
|
||||
--error 0, 1360
|
||||
drop trigger trg5_1;
|
||||
# The above trigger should be dropped since the name was trimmed.
|
||||
# In 5.1 the long name should generate an error that is to long
|
||||
--error 1059
|
||||
drop trigger trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ;
|
||||
drop trigger trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWX;
|
||||
drop table t1;
|
||||
|
||||
#Section 3.5.1.8
|
||||
@ -385,10 +393,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;
|
||||
select * from t1 order by f2;
|
||||
select * from trig_db2.t2;
|
||||
select * from trig_db3.t1;
|
||||
select * from t1;
|
||||
select * from t1 order by f2;
|
||||
use test;
|
||||
|
||||
#Cleanup
|
||||
@ -434,7 +442,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;
|
||||
from information_schema.triggers order by trigger_name;
|
||||
|
||||
set @test_var1= '', @test_var2= '', @test_var3= '';
|
||||
insert into t1 (f1,f2) values ('insert to db1 t1 from db1',352);
|
||||
|
@ -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 SUPER privilege is required to create a trigger
|
||||
# Test case: Ensure TRIGGER privilege is required to create a trigger
|
||||
#Section 3.5.3.3 / 3.5.3.4
|
||||
# Test case: Ensure that root always has the SUPER privilege.
|
||||
# Test case: Ensure that root always has the TRIGGER 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 SUPER privilege is required to drop a trigger.
|
||||
# Test case: Ensure that the TRIGGER 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 SUPER on *.* from test_noprivs@localhost;
|
||||
revoke TRIGGER on *.* from test_noprivs@localhost;
|
||||
show grants for test_noprivs@localhost;
|
||||
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
|
||||
grant SUPER on *.* to test_yesprivs@localhost;
|
||||
grant TRIGGER on *.* to test_yesprivs@localhost;
|
||||
# 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,14 +63,15 @@ let $message= Testcase 3.5.3.2:;
|
||||
select current_user;
|
||||
use priv_db;
|
||||
|
||||
--error 1227
|
||||
# error 1227 is better, as it says, that not the privilege
|
||||
--error 1142,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;
|
||||
select f1 from t1 order by f1;
|
||||
|
||||
connection yes_privs;
|
||||
select current_user;
|
||||
@ -83,29 +84,27 @@ let $message= Testcase 3.5.3.2:;
|
||||
select current_user;
|
||||
use priv_db;
|
||||
|
||||
# Added following the fix to bug 5861
|
||||
--error 1143
|
||||
--error 1143
|
||||
insert into t1 (f1) values ('insert 3.5.3.2-yes');
|
||||
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
|
||||
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;
|
||||
|
||||
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 1227
|
||||
--error 1142,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;
|
||||
select f1 from t1 order by f1;
|
||||
|
||||
connection yes_privs;
|
||||
use priv_db;
|
||||
@ -115,7 +114,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;
|
||||
select f1 from t1 order by f1;
|
||||
|
||||
# Cleanup
|
||||
--disable_warnings
|
||||
@ -144,7 +143,7 @@ let $message=Testcase 3.5.3.7a:;
|
||||
show grants for test_noprivs@localhost;
|
||||
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
|
||||
grant SUPER, UPDATE on *.* to test_yesprivs@localhost;
|
||||
grant TRIGGER, UPDATE on *.* to test_yesprivs@localhost;
|
||||
show grants for test_yesprivs@localhost;
|
||||
|
||||
--replace_result $MASTER_MYPORT MASTER_MYPORT $MASTER_MYSOCK MASTER_MYSOCK
|
||||
@ -156,7 +155,7 @@ let $message=Testcase 3.5.3.7a:;
|
||||
select current_user;
|
||||
use priv_db;
|
||||
show grants;
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
|
||||
let $message= Trigger create disabled - should fail - Bug 8884;
|
||||
--source include/show_msg.inc
|
||||
@ -166,7 +165,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;
|
||||
select f1 from t1 order by f1;
|
||||
--error 0, 1360
|
||||
drop trigger trg4a_1;
|
||||
|
||||
@ -179,14 +178,8 @@ 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;
|
||||
select f1 from t1 order by f1;
|
||||
|
||||
# Cleanup
|
||||
--disable_warnings
|
||||
@ -200,13 +193,13 @@ let $message= Testcase 3.5.3.7b:;
|
||||
--source include/show_msg.inc
|
||||
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
|
||||
grant SUPER on *.* to test_noprivs;
|
||||
grant TRIGGER on *.* to test_noprivs;
|
||||
grant ALL on priv_db.* to test_noprivs@localhost;
|
||||
revoke UPDATE on priv_db.* from test_noprivs@localhost;
|
||||
show grants for test_noprivs;
|
||||
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
|
||||
grant SUPER on *.* to test_yesprivs@localhost;
|
||||
grant TRIGGER on *.* to test_yesprivs@localhost;
|
||||
grant UPDATE on priv_db.* to test_yesprivs@localhost;
|
||||
show grants for test_yesprivs@localhost;
|
||||
|
||||
@ -228,9 +221,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;
|
||||
select f1 from t1 order by f1;
|
||||
update t1 set f1 = 'update 3.5.3.7-1b' where f1 = 'insert 3.5.3.7-1b';
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
--error 0, 1360
|
||||
drop trigger trg4b_1;
|
||||
|
||||
@ -242,15 +235,10 @@ 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;
|
||||
select f1 from t1 order by f1;
|
||||
update t1 set f1 = 'update 3.5.3.7-2b' where f1 = 'insert 3.5.3.7-2b';
|
||||
select f1 from t1;
|
||||
select f1 from t1 order by f1;
|
||||
# Cleanup
|
||||
--disable_warnings
|
||||
drop trigger trg4b_2;
|
||||
@ -263,13 +251,13 @@ let $message= Testcase 3.5.3.7c;
|
||||
--source include/show_msg.inc
|
||||
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
|
||||
grant SUPER on *.* to test_noprivs@localhost;
|
||||
grant TRIGGER on *.* to test_noprivs@localhost;
|
||||
grant ALL on priv_db.t1 to test_noprivs@localhost;
|
||||
revoke UPDATE on priv_db.t1 from test_noprivs@localhost;
|
||||
show grants for test_noprivs;
|
||||
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
|
||||
grant SUPER on *.* to test_yesprivs@localhost;
|
||||
grant TRIGGER on *.* to test_yesprivs@localhost;
|
||||
grant UPDATE on priv_db.t1 to test_yesprivs@localhost;
|
||||
show grants for test_yesprivs@localhost;
|
||||
|
||||
@ -291,7 +279,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;
|
||||
select f1 from t1 order by f1;
|
||||
--error 0, 1360
|
||||
drop trigger trg4c_1;
|
||||
|
||||
@ -303,13 +291,8 @@ 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;
|
||||
select f1 from t1 order by f1;
|
||||
|
||||
# Cleanup
|
||||
--disable_warnings
|
||||
@ -325,13 +308,13 @@ let $message= Testcase 3.5.3.7d:;
|
||||
--source include/show_msg.inc
|
||||
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
|
||||
grant SUPER on *.* to test_noprivs@localhost;
|
||||
grant TRIGGER 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 SUPER on *.* to test_yesprivs@localhost;
|
||||
grant TRIGGER on *.* to test_yesprivs@localhost;
|
||||
grant UPDATE (f1) on priv_db.t1 to test_yesprivs@localhost;
|
||||
show grants for test_noprivs;
|
||||
|
||||
@ -352,7 +335,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;
|
||||
select f1 from t1 order by f1;
|
||||
--error 0, 1360
|
||||
drop trigger trg4d_1;
|
||||
|
||||
@ -364,13 +347,8 @@ 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;
|
||||
select f1 from t1 order by f1;
|
||||
|
||||
# Cleanup
|
||||
--disable_warnings
|
||||
@ -394,7 +372,7 @@ let $message= Testcase 3.5.3.8a:;
|
||||
show grants for test_noprivs@localhost;
|
||||
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
|
||||
grant SUPER, SELECT on *.* to test_yesprivs@localhost;
|
||||
grant TRIGGER, SELECT on *.* to test_yesprivs@localhost;
|
||||
show grants for test_yesprivs@localhost;
|
||||
|
||||
--replace_result $MASTER_MYPORT MASTER_MYPORT $MASTER_MYSOCK MASTER_MYSOCK
|
||||
@ -433,11 +411,6 @@ 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;
|
||||
|
||||
@ -453,13 +426,13 @@ let $message= Testcase: 3.5.3.8b;
|
||||
--source include/show_msg.inc
|
||||
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
|
||||
grant SUPER on *.* to test_noprivs@localhost;
|
||||
grant TRIGGER on *.* to test_noprivs@localhost;
|
||||
grant ALL on priv_db.* to test_noprivs@localhost;
|
||||
revoke SELECT on priv_db.* from test_noprivs@localhost;
|
||||
show grants for test_noprivs@localhost;
|
||||
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
|
||||
grant SUPER on *.* to test_yesprivs@localhost;
|
||||
grant TRIGGER on *.* to test_yesprivs@localhost;
|
||||
grant SELECT on priv_db.* to test_yesprivs@localhost;
|
||||
show grants for test_yesprivs@localhost;
|
||||
|
||||
@ -499,11 +472,6 @@ 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
|
||||
@ -518,13 +486,13 @@ let $message= Testcase 3.5.3.8c:;
|
||||
--source include/show_msg.inc
|
||||
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
|
||||
grant SUPER on *.* to test_noprivs@localhost;
|
||||
grant TRIGGER on *.* to test_noprivs@localhost;
|
||||
grant ALL on priv_db.t1 to test_noprivs@localhost;
|
||||
revoke SELECT on priv_db.t1 from test_noprivs@localhost;
|
||||
show grants for test_noprivs@localhost;
|
||||
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
|
||||
grant SUPER on *.* to test_yesprivs@localhost;
|
||||
grant TRIGGER on *.* to test_yesprivs@localhost;
|
||||
grant SELECT on priv_db.t1 to test_yesprivs@localhost;
|
||||
show grants for test_yesprivs@localhost;
|
||||
|
||||
@ -560,11 +528,6 @@ 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
|
||||
@ -579,13 +542,13 @@ let $message=Testcase: 3.5.3.8d:;
|
||||
--source include/show_msg.inc
|
||||
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
|
||||
grant SUPER on *.* to test_noprivs@localhost;
|
||||
grant TRIGGER 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 SUPER on *.* to test_yesprivs@localhost;
|
||||
grant TRIGGER on *.* to test_yesprivs@localhost;
|
||||
grant SELECT (f1) on priv_db.t1 to test_yesprivs@localhost;
|
||||
show grants for test_noprivs@localhost;
|
||||
|
||||
@ -620,11 +583,6 @@ 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;
|
||||
|
||||
@ -650,7 +608,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 SUPER on *.* to test_yesprivs@localhost;
|
||||
grant TRIGGER on *.* to test_yesprivs@localhost;
|
||||
grant SELECT, UPDATE on priv_db.t1 to test_yesprivs@localhost;
|
||||
grant SELECT on priv_db.t2 to test_yesprivs@localhost;
|
||||
show grants for test_yesprivs@localhost;
|
||||
@ -671,8 +629,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;
|
||||
select f2 from t2;
|
||||
select f1 from t1 order by f1;
|
||||
select f2 from t2 order by f2;
|
||||
|
||||
connection yes_353x;
|
||||
use priv_db;
|
||||
@ -687,8 +645,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;
|
||||
select f2 from t2;
|
||||
select f1 from t1 order by f1;
|
||||
select f2 from t2 order by f2;
|
||||
|
||||
connection yes_353x;
|
||||
use priv_db;
|
||||
@ -703,8 +661,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;
|
||||
select f2 from t2;
|
||||
select f1 from t1 order by f1;
|
||||
select f2 from t2 order by f2;
|
||||
select @aaa;
|
||||
|
||||
connection yes_353x;
|
||||
@ -720,8 +678,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;
|
||||
select f2 from t2;
|
||||
select f1 from t1 order by f1;
|
||||
select f2 from t2 order by f2;
|
||||
|
||||
|
||||
|
||||
|
@ -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;
|
||||
Select * from t1 order by f1;
|
||||
connection con1_super;
|
||||
drop trigger trg1;
|
||||
select trigger_schema, trigger_name, event_object_table
|
||||
from information_schema.triggers;
|
||||
from information_schema.triggers order by trigger_name;
|
||||
connection con1_general;
|
||||
Insert into t1 values ('Insert no trigger 3.5.4.1');
|
||||
Select * from t1;
|
||||
Select * from t1 order by f1;
|
||||
|
||||
#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;
|
||||
Select * from dbtest_two.t2 order by f1;
|
||||
|
||||
#Cleanup
|
||||
connection con1_super;
|
||||
|
@ -111,9 +111,10 @@ 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';
|
||||
select * from db_test.t1_i;
|
||||
select * from db_test.t1_u;
|
||||
select * from db_test.t1_d;
|
||||
# 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 @test_var;
|
||||
|
||||
|
||||
@ -121,16 +122,22 @@ 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;
|
||||
select * from db_test.t1_i order by i120;
|
||||
|
||||
|
||||
let $message= 3.5.8.4 - single SQL - update;
|
||||
@ -148,7 +155,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;
|
||||
select * from db_test.t1_u order by u120;
|
||||
|
||||
|
||||
let $message= 3.5.8.3/4 - single SQL - delete;
|
||||
@ -167,7 +174,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;
|
||||
select * from db_test.t1_d order by d120;
|
||||
|
||||
|
||||
let $message= 3.5.8.3/4 - single SQL - select;
|
||||
@ -228,16 +235,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';
|
||||
from tb3 where f122 = 'Test 3.5.8.5-if' order by f136;
|
||||
Insert into tb3 (f120, f122, f136) values ('2', 'Test 3.5.8.5-if', 102);
|
||||
select f120, f122, f136, @test_var, @test_var2
|
||||
from tb3 where f122 = 'Test 3.5.8.5-if';
|
||||
from tb3 where f122 = 'Test 3.5.8.5-if' order by f136;
|
||||
Insert into tb3 (f120, f122, f136) values ('3', 'Test 3.5.8.5-if', 10);
|
||||
select f120, f122, f136, @test_var, @test_var2
|
||||
from tb3 where f122 = 'Test 3.5.8.5-if';
|
||||
from tb3 where f122 = 'Test 3.5.8.5-if' order by f136;
|
||||
Insert into tb3 (f120, f122, f136) values ('3', 'Test 3.5.8.5-if', 103);
|
||||
select f120, f122, f136, @test_var, @test_var2
|
||||
from tb3 where f122 = 'Test 3.5.8.5-if';
|
||||
from tb3 where f122 = 'Test 3.5.8.5-if' order by f136;
|
||||
|
||||
delimiter //;
|
||||
--error 1064
|
||||
@ -313,28 +320,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';
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
|
||||
Insert into tb3 (f120, f122, f136, f144)
|
||||
values ('b', 'Test 3.5.8.5-case', 71,16);
|
||||
select f120, f122, f136, f144, @test_var
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case';
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
|
||||
Insert into tb3 (f120, f122, f136, f144)
|
||||
values ('c', 'Test 3.5.8.5-case', 80,1);
|
||||
select f120, f122, f136, f144, @test_var
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case';
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
|
||||
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';
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
|
||||
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';
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
|
||||
--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';
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
|
||||
|
||||
delimiter //;
|
||||
--error 1064
|
||||
|
@ -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';
|
||||
select f118, f121, f122, f136, f163 from tb3 where f122='Test 3.5.9.3' order by f136;
|
||||
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';
|
||||
select f118, f121, f122, f136, f163 from tb3 where f122='Test 3.5.9.3' order by f136;
|
||||
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%';
|
||||
where f122 like 'Test 3.5.9.4%' order by f163;
|
||||
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';
|
||||
where f122 like 'Test 3.5.9.4-trig' order by f163;
|
||||
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,
|
||||
|
@ -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%';
|
||||
from tb3 where f122 like 'Test 3.5.10.1/2/3%' order by f151;
|
||||
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%';
|
||||
where f122 like 'Test 3.5.10.1/2/3%' order by f151;
|
||||
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%';
|
||||
where f122 like 'Test 3.5.10.1/2/3%' order by f151;
|
||||
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 limit 10;
|
||||
Select * from tb_load order by f1 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;
|
||||
select * from t3 order by f1;
|
||||
|
||||
#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;
|
||||
select * from t2;
|
||||
select * from t3;
|
||||
select * from t4;
|
||||
select * from t1 order by f1;
|
||||
select * from t2 order by f2;
|
||||
select * from t3 order by f3;
|
||||
select * from t4 order by f4;
|
||||
|
||||
#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;
|
||||
select * from t2;
|
||||
select * from t3;
|
||||
select * from t1 order by f1;
|
||||
select * from t2 order by f2;
|
||||
select * from t3 order by f3;
|
||||
#unlock tables;
|
||||
#Cleanup
|
||||
--disable_warnings
|
||||
|
@ -3,7 +3,8 @@
|
||||
# Functions within VIEWs #
|
||||
# #
|
||||
###################################################
|
||||
# 14.09.2005 ML
|
||||
# 2006-12-08 ML Maintenance + refinements
|
||||
# 2005-09-14 ML Create this test
|
||||
|
||||
let $message= ! Attention: The file with the expected results suffers from
|
||||
Bug#10713: mysqldump includes database in create view and referenced tables;
|
||||
@ -68,7 +69,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 5083 5913 9809";
|
||||
# The file with expected results suffers from Bug 5913";
|
||||
# means, the file with expected results contains result sets which
|
||||
# are known to be wrong.
|
||||
# "Attention: The last <whatever> failed"
|
||||
@ -187,6 +188,7 @@ 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,
|
||||
@ -416,8 +418,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
|
||||
@ -587,15 +589,10 @@ let $col_type= my_bigint;
|
||||
eval INSERT INTO t1_values SET select_id = @select_id,
|
||||
$col_type = 1758;
|
||||
let $col_type= my_double;
|
||||
let $message= some statements disabled because of
|
||||
Bug#12440: CAST(data type DOUBLE AS TIME) strange results;
|
||||
--source include/show_msg80.inc
|
||||
if (0)
|
||||
{
|
||||
# Bug#12440: CAST(data type DOUBLE AS TIME) strange results;
|
||||
--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;
|
||||
@ -631,16 +628,11 @@ 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
|
||||
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)
|
||||
{
|
||||
# Bug#13349: CAST(1.0E+300 TO DECIMAL) returns wrong result + diff little/big endian;
|
||||
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;
|
||||
@ -658,11 +650,8 @@ 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
|
||||
Both have the status: To be fixed later";
|
||||
Status: To be fixed later";
|
||||
--source include/show_msg80.inc
|
||||
let $col_type= my_char_30;
|
||||
--source suite/funcs_1/views/fv_cast.inc
|
||||
@ -676,14 +665,9 @@ 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
|
||||
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)
|
||||
{
|
||||
# Bug #13344: CAST(1E+300 TO signed int) on little endian CPU, wrong result;
|
||||
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;
|
||||
@ -701,7 +685,7 @@ let $target_type= UNSIGNED INTEGER;
|
||||
#
|
||||
let $message=
|
||||
"Attention: CAST --> UNSIGNED INTEGER
|
||||
The file with expected results suffers from Bug 5083 5913 9809";
|
||||
The file with expected results suffers from Bug 5913";
|
||||
--source include/show_msg80.inc
|
||||
let $col_type= my_char_30;
|
||||
--source suite/funcs_1/views/fv_cast.inc
|
||||
@ -716,10 +700,11 @@ 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
|
||||
Bugs#8663: cant use bgint unsigned as input to cast;
|
||||
Bug#5913 Traditional mode: BIGINT range not correctly delimited;
|
||||
--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
|
||||
}
|
||||
@ -847,11 +832,6 @@ 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
|
||||
@ -1030,7 +1010,7 @@ eval SET @my_select =
|
||||
#
|
||||
let $message=
|
||||
"Attention: LEFT(''AaBbCcDdEeFfGgHhIiJjÄäÜüÖö'', <numeric column>)
|
||||
The file with expected results suffers from Bug 10963 11728"
|
||||
The file with expected results suffers from Bug 10963"
|
||||
and the testcases with length = BIGINT or DOUBLE column are deactivated,
|
||||
because there are 32/64 Bit differences;
|
||||
--source include/show_msg80.inc
|
||||
@ -1084,8 +1064,10 @@ $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(''../log/current_test''), id FROM t1_values';
|
||||
'SELECT LOAD_FILE(''../tmp/func_view.dat''), id FROM t1_values';
|
||||
--source suite/funcs_1/views/fv1.inc
|
||||
|
||||
|
||||
@ -1309,14 +1291,13 @@ while ($select_id)
|
||||
--disable_query_log
|
||||
eval set @got_errno= $mysql_errno ;
|
||||
let $run0= `SELECT @got_errno = 0`;
|
||||
let $print_warning= `SELECT @got_errno`;
|
||||
if ($print_warning)
|
||||
{
|
||||
SELECT 'Attention: The last CREATE VIEW failed ' AS ""
|
||||
UNION
|
||||
SELECT '' ;
|
||||
}
|
||||
--enable_query_log
|
||||
if (!$run0)
|
||||
{
|
||||
--echo
|
||||
--echo Attention: The last CREATE VIEW failed
|
||||
--echo
|
||||
}
|
||||
}
|
||||
|
||||
# FIXME The loop over the modes will start here.
|
||||
@ -1330,21 +1311,17 @@ while ($select_id)
|
||||
--disable_result_log
|
||||
}
|
||||
eval $my_select
|
||||
WHERE select_id = $select_id OR select_id IS NULL;
|
||||
WHERE select_id = $select_id OR select_id IS NULL order by id;
|
||||
if ($run_no_result)
|
||||
{
|
||||
--enable_result_log
|
||||
}
|
||||
--disable_query_log
|
||||
eval set @got_errno= $mysql_errno ;
|
||||
let $print_warning= `SELECT @got_errno`;
|
||||
if ($print_warning)
|
||||
if ($mysql_errno)
|
||||
{
|
||||
SELECT 'Attention: The last SELECT on the base table failed' AS ""
|
||||
UNION
|
||||
SELECT '' ;
|
||||
--echo
|
||||
--echo Attention: The last SELECT on the base table failed
|
||||
--echo
|
||||
}
|
||||
--enable_query_log
|
||||
}
|
||||
|
||||
# $run0 is 1, if CREATE VIEW was successful.
|
||||
@ -1353,16 +1330,12 @@ while ($select_id)
|
||||
{
|
||||
# Check the CREATE VIEW statement
|
||||
SHOW CREATE VIEW v1;
|
||||
--disable_query_log
|
||||
eval set @got_errno= $mysql_errno ;
|
||||
let $print_warning= `SELECT @got_errno`;
|
||||
if ($print_warning)
|
||||
if ($mysql_errno)
|
||||
{
|
||||
SELECT 'Attention: The last SHOW CREATE VIEW failed' AS ""
|
||||
UNION
|
||||
SELECT '' ;
|
||||
--echo
|
||||
--echo Attention: The last SHOW CREATE VIEW failed
|
||||
--echo
|
||||
}
|
||||
--enable_query_log
|
||||
|
||||
# Maybe a Join is faster
|
||||
if ($run_no_result)
|
||||
@ -1371,21 +1344,17 @@ 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);
|
||||
WHERE select_id = $select_id OR select_id IS NULL) order by id;
|
||||
if ($run_no_result)
|
||||
{
|
||||
--enable_result_log
|
||||
}
|
||||
--disable_query_log
|
||||
eval set @got_errno= $mysql_errno ;
|
||||
let $print_warning= `SELECT @got_errno`;
|
||||
if ($print_warning)
|
||||
if ($mysql_errno)
|
||||
{
|
||||
SELECT 'Attention: The last SELECT from VIEW failed' AS ""
|
||||
UNION
|
||||
SELECT '' ;
|
||||
--echo
|
||||
--echo Attention: The last SELECT from VIEW failed
|
||||
--echo
|
||||
}
|
||||
--enable_query_log
|
||||
|
||||
DROP VIEW v1;
|
||||
}
|
||||
@ -1394,11 +1363,11 @@ while ($select_id)
|
||||
|
||||
# Produce two empty lines as separator between different SELECTS
|
||||
# to be tested.
|
||||
--disable_query_log
|
||||
SELECT '' AS "";
|
||||
--enable_query_log
|
||||
--echo
|
||||
--echo
|
||||
|
||||
dec $select_id ;
|
||||
}
|
||||
|
||||
DROP TABLE t1_selects, t1_modes, t1_values;
|
||||
--exec rm $MYSQLTEST_VARDIR/tmp/func_view.dat
|
||||
|
@ -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 1062
|
||||
--error ER_DUP_ENTRY_WITH_KEY_NAME
|
||||
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 1062
|
||||
--error ER_DUP_ENTRY_WITH_KEY_NAME
|
||||
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;
|
||||
SELECT * FROM t1 order by f1, f2;
|
||||
|
||||
CREATE VIEW v1 AS SELECT * FROM t1 WHERE f2 BETWEEN 1 AND 2
|
||||
WITH CASCADED CHECK OPTION ;
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by f1, f2;
|
||||
--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;
|
||||
SELECT * FROM v1 order by f1, f2;
|
||||
# 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;
|
||||
SELECT * FROM v1 order by f1, f2;
|
||||
|
||||
|
||||
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 1062
|
||||
--error ER_DUP_ENTRY_WITH_KEY_NAME
|
||||
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 1062
|
||||
--error ER_DUP_ENTRY_WITH_KEY_NAME
|
||||
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;
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM t1 order by f1, report;
|
||||
SELECT * FROM v1 order by f1, report;
|
||||
#
|
||||
# 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;
|
||||
SELECT * FROM t1 order by f1, report;
|
||||
--error 1356
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by f1, report;
|
||||
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;
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM t1 order by f1, report;
|
||||
SELECT * FROM v1 order by f1, report;
|
||||
#
|
||||
# 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;
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM t1 order by f1, report;
|
||||
SELECT * FROM v1 order by f1, report;
|
||||
#
|
||||
# 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;
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM t1 order by f1, report;
|
||||
SELECT * FROM v1 order by f1, report;
|
||||
#
|
||||
# 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;
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM t1 order by f1, report;
|
||||
SELECT * FROM v1 order by f1, report;
|
||||
#
|
||||
# 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;
|
||||
SELECT * FROM t1 order by f1, report;
|
||||
--error 1356
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM v1 order by f1, report;
|
||||
#
|
||||
# 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;
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM t1 order by f1, report;
|
||||
SELECT * FROM v1 order by f1, report;
|
||||
#
|
||||
# 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;
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM t1 order by f1, report;
|
||||
SELECT * FROM v1 order by f1, report;
|
||||
#
|
||||
# 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;
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM t1 order by f1, report;
|
||||
SELECT * FROM v1 order by f1, report;
|
||||
#
|
||||
# 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;
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM t1 order by f1, f2;
|
||||
SELECT * FROM v1 order by 2;
|
||||
ALTER TABLE t1 CHANGE COLUMN f2 f2 VARCHAR(30);
|
||||
INSERT INTO t1 SET f1 = 'ABC', f2 = 'DEF';
|
||||
DESCRIBE t1;
|
||||
DESCRIBE v1;
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM v1;
|
||||
SELECT * FROM t1 order by f1, f2;
|
||||
SELECT * FROM v1 order by 2;
|
||||
# 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;
|
||||
SELECT * FROM v2 order by 1;
|
||||
# - 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;
|
||||
SELECT * FROM v2 order by 2;
|
||||
# - 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;
|
||||
SELECT * FROM t2 order by 2;
|
||||
--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;
|
||||
SELECT * FROM t2 order by 2;
|
||||
--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;
|
||||
SELECT * FROM t2 order by 2;
|
||||
--enable_ps_protocol
|
||||
#
|
||||
DROP TABLE t1;
|
||||
|
Reference in New Issue
Block a user