Commit 8ed5fb5a authored by kent@kent-amd64.(none)'s avatar kent@kent-amd64.(none)

Merge kboortz@bk-internal.mysql.com:/home/bk/mysql-5.1-build

into  mysql.com:/home/kent/bk/build/mysql-5.1-build
parents ea442919 2038eeb8
......@@ -3012,3 +3012,6 @@ win/vs8cache.txt
ylwrap
zlib/*.ds?
zlib/*.vcproj
mysql-test/funcs_1.log
mysql-test/funcs_1.tar
mysql-test/suite/funcs_1.tar.gz
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -58,6 +58,7 @@ load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t11;
Section 3.1.10 - CALL checks:
--------------------------------------------------------------------------------
USE db_storedproc;
Testcase 3.1.10.2 + 3.1.10.5:
-----------------------------
......@@ -94,6 +95,7 @@ CALL sp31102();
ERROR 42000: execute command denied to user 'user_2'@'localhost' for routine 'db_storedproc.sp31102'
SELECT fn31105( 9 );
ERROR 42000: execute command denied to user 'user_2'@'localhost' for routine 'db_storedproc.fn31105'
connection default;
USE db_storedproc;
root@localhost db_storedproc
......@@ -114,6 +116,7 @@ a` a` 1000-01-01 -5000 a` -5000
SELECT fn31105( 9 );
fn31105( 9 )
81
connection default;
USE db_storedproc;
root@localhost db_storedproc
......@@ -180,6 +183,8 @@ DROP PROCEDURE IF EXISTS sp_ins_1;
DROP PROCEDURE IF EXISTS sp_ins_3;
DROP PROCEDURE IF EXISTS sp_upd;
DROP PROCEDURE IF EXISTS sp_ins_upd;
DROP PROCEDURE IF EXISTS sp_del;
DROP PROCEDURE IF EXISTS sp_with_rowcount;
CREATE TABLE temp(f1 CHAR(20),f2 CHAR(25),f3 DATE,f4 INT,f5 CHAR(25),f6 INT);
INSERT INTO temp SELECT * FROM t10;
CREATE PROCEDURE sp_ins_1()
......@@ -207,49 +212,72 @@ END;
SELECT COUNT( f1 ), f1 FROM temp GROUP BY f1;
UPDATE temp SET temp.f1 = 'updated_2' WHERE temp.f1 ='qwe' AND temp.f2 = 'abc';
END//
CREATE PROCEDURE sp_del()
BEGIN
DELETE FROM temp WHERE temp.f1 ='qwe' OR temp.f1 = 'updated_2';
END//
CREATE PROCEDURE sp_with_rowcount()
BEGIN
BEGIN
INSERT INTO temp VALUES ('qwe', 'abc', '1989-11-09', 100, 'uvw', 1000),
('qwe', 'xyz', '1998-03-26', 100, 'uvw', 1000),
('qwe', 'abc', '2000-11-09', 100, 'uvw', 1000),
('qwe', 'xyz', '2005-11-07', 100, 'uvw', 1000);
END;
SELECT row_count() AS 'row_count() after insert';
SELECT row_count() AS 'row_count() after select row_count()';
SELECT f1,f2,f3 FROM temp ORDER BY f1,f2,f3;
UPDATE temp SET temp.f1 = 'updated_2' WHERE temp.f2 = 'abc';
SELECT row_count() AS 'row_count() after update';
SELECT f1,f2,f3 FROM temp ORDER BY f1,f2,f3;
DELETE FROM temp WHERE temp.f1 = 'updated_2';
SELECT row_count() AS 'row_count() after delete';
END//
CALL sp_ins_1();
SELECT row_count();
row_count()
1
SELECT * FROM temp ORDER BY f4;
SELECT * FROM temp;
f1 f2 f3 f4 f5 f6
a^aaaaaaaa a^aaaaaaaa 1000-01-09 -4992 a^aaaaaaaa -4992
a_aaaaaaaaa a_aaaaaaaaa 1000-01-10 -4991 a_aaaaaaaaa -4991
a` a` 1000-01-01 -5000 a` -5000
aaa aaa 1000-01-02 -4999 aaa -4999
abaa abaa 1000-01-03 -4998 abaa -4998
abc abc 2005-10-03 100 uvw 1000
acaaa acaaa 1000-01-04 -4997 acaaa -4997
adaaaa adaaaa 1000-01-05 -4996 adaaaa -4996
aeaaaaa aeaaaaa 1000-01-06 -4995 aeaaaaa -4995
afaaaaaa afaaaaaa 1000-01-07 -4994 afaaaaaa -4994
agaaaaaaa agaaaaaaa 1000-01-08 -4993 agaaaaaaa -4993
a^aaaaaaaa a^aaaaaaaa 1000-01-09 -4992 a^aaaaaaaa -4992
a_aaaaaaaaa a_aaaaaaaaa 1000-01-10 -4991 a_aaaaaaaaa -4991
abc abc 2005-10-03 100 uvw 1000
CALL sp_ins_3();
SELECT row_count();
row_count()
1
SELECT * FROM temp ORDER BY f4;
SELECT * FROM temp;
f1 f2 f3 f4 f5 f6
a^aaaaaaaa a^aaaaaaaa 1000-01-09 -4992 a^aaaaaaaa -4992
a_aaaaaaaaa a_aaaaaaaaa 1000-01-10 -4991 a_aaaaaaaaa -4991
a` a` 1000-01-01 -5000 a` -5000
aaa aaa 1000-01-02 -4999 aaa -4999
abaa abaa 1000-01-03 -4998 abaa -4998
abc abc 2005-10-03 100 uvw 1000
abc xyz 1949-05-23 100 uvw 1000
abc xyz 1989-11-09 100 uvw 1000
abc xyz 2005-10-24 100 uvw 1000
acaaa acaaa 1000-01-04 -4997 acaaa -4997
adaaaa adaaaa 1000-01-05 -4996 adaaaa -4996
aeaaaaa aeaaaaa 1000-01-06 -4995 aeaaaaa -4995
afaaaaaa afaaaaaa 1000-01-07 -4994 afaaaaaa -4994
agaaaaaaa agaaaaaaa 1000-01-08 -4993 agaaaaaaa -4993
a^aaaaaaaa a^aaaaaaaa 1000-01-09 -4992 a^aaaaaaaa -4992
a_aaaaaaaaa a_aaaaaaaaa 1000-01-10 -4991 a_aaaaaaaaa -4991
abc abc 2005-10-03 100 uvw 1000
abc xyz 1949-05-23 100 uvw 1000
abc xyz 1989-11-09 100 uvw 1000
abc xyz 2005-10-24 100 uvw 1000
CALL sp_upd();
SELECT row_count();
row_count()
4
SELECT * FROM temp ORDER BY f4;
SELECT * FROM temp;
f1 f2 f3 f4 f5 f6
a^aaaaaaaa a^aaaaaaaa 1000-01-09 -4992 a^aaaaaaaa -4992
a_aaaaaaaaa a_aaaaaaaaa 1000-01-10 -4991 a_aaaaaaaaa -4991
a` a` 1000-01-01 -5000 a` -5000
aaa aaa 1000-01-02 -4999 aaa -4999
abaa abaa 1000-01-03 -4998 abaa -4998
......@@ -258,8 +286,6 @@ adaaaa adaaaa 1000-01-05 -4996 adaaaa -4996
aeaaaaa aeaaaaa 1000-01-06 -4995 aeaaaaa -4995
afaaaaaa afaaaaaa 1000-01-07 -4994 afaaaaaa -4994
agaaaaaaa agaaaaaaa 1000-01-08 -4993 agaaaaaaa -4993
a^aaaaaaaa a^aaaaaaaa 1000-01-09 -4992 a^aaaaaaaa -4992
a_aaaaaaaaa a_aaaaaaaaa 1000-01-10 -4991 a_aaaaaaaaa -4991
updated abc 2005-10-03 100 uvw 1000
updated xyz 1949-05-23 100 uvw 1000
updated xyz 1989-11-09 100 uvw 1000
......@@ -281,8 +307,10 @@ COUNT( f1 ) f1
SELECT row_count();
row_count()
3
SELECT * FROM temp ORDER BY f4;
SELECT * FROM temp;
f1 f2 f3 f4 f5 f6
a^aaaaaaaa a^aaaaaaaa 1000-01-09 -4992 a^aaaaaaaa -4992
a_aaaaaaaaa a_aaaaaaaaa 1000-01-10 -4991 a_aaaaaaaaa -4991
a` a` 1000-01-01 -5000 a` -5000
aaa aaa 1000-01-02 -4999 aaa -4999
abaa abaa 1000-01-03 -4998 abaa -4998
......@@ -291,20 +319,67 @@ adaaaa adaaaa 1000-01-05 -4996 adaaaa -4996
aeaaaaa aeaaaaa 1000-01-06 -4995 aeaaaaa -4995
afaaaaaa afaaaaaa 1000-01-07 -4994 afaaaaaa -4994
agaaaaaaa agaaaaaaa 1000-01-08 -4993 agaaaaaaa -4993
a^aaaaaaaa a^aaaaaaaa 1000-01-09 -4992 a^aaaaaaaa -4992
a_aaaaaaaaa a_aaaaaaaaa 1000-01-10 -4991 a_aaaaaaaaa -4991
qwe xyz 1998-03-26 100 uvw 1000
updated abc 2005-10-03 100 uvw 1000
updated xyz 1949-05-23 100 uvw 1000
updated xyz 1989-11-09 100 uvw 1000
updated xyz 2005-10-24 100 uvw 1000
updated_2 abc 1989-11-09 100 uvw 1000
qwe xyz 1998-03-26 100 uvw 1000
updated_2 abc 2000-11-09 100 uvw 1000
updated_2 abc 2005-11-07 100 uvw 1000
CALL sp_del();
SELECT row_count();
row_count()
4
SELECT * FROM temp;
f1 f2 f3 f4 f5 f6
a^aaaaaaaa a^aaaaaaaa 1000-01-09 -4992 a^aaaaaaaa -4992
a_aaaaaaaaa a_aaaaaaaaa 1000-01-10 -4991 a_aaaaaaaaa -4991
a` a` 1000-01-01 -5000 a` -5000
aaa aaa 1000-01-02 -4999 aaa -4999
abaa abaa 1000-01-03 -4998 abaa -4998
acaaa acaaa 1000-01-04 -4997 acaaa -4997
adaaaa adaaaa 1000-01-05 -4996 adaaaa -4996
aeaaaaa aeaaaaa 1000-01-06 -4995 aeaaaaa -4995
afaaaaaa afaaaaaa 1000-01-07 -4994 afaaaaaa -4994
agaaaaaaa agaaaaaaa 1000-01-08 -4993 agaaaaaaa -4993
updated abc 2005-10-03 100 uvw 1000
updated xyz 1949-05-23 100 uvw 1000
updated xyz 1989-11-09 100 uvw 1000
updated xyz 2005-10-24 100 uvw 1000
DELETE FROM temp;
CALL sp_with_rowcount();
row_count() after insert
4
row_count() after select row_count()
-1
f1 f2 f3
qwe abc 1989-11-09
qwe abc 2000-11-09
qwe xyz 1998-03-26
qwe xyz 2005-11-07
row_count() after update
2
f1 f2 f3
qwe xyz 1998-03-26
qwe xyz 2005-11-07
updated_2 abc 1989-11-09
updated_2 abc 2000-11-09
row_count() after delete
2
SELECT row_count();
row_count()
-1
SELECT * FROM temp;
f1 f2 f3 f4 f5 f6
qwe xyz 1998-03-26 100 uvw 1000
qwe xyz 2005-11-07 100 uvw 1000
DROP PROCEDURE sp_ins_1;
DROP PROCEDURE sp_ins_3;
DROP PROCEDURE sp_upd;
DROP PROCEDURE sp_ins_upd;
DROP PROCEDURE sp_del;
DROP PROCEDURE sp_with_rowcount;
DROP TABLE temp;
Testcase 3.1.10.8:
......
......@@ -184,15 +184,14 @@ insert 3.5.3.2-no
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
------------------------------------------------
create trigger trg4a_1 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-1a';
insert into t1 (f1) values ('insert 3.5.3.7-1a');
ERROR 42000: UPDATE command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
select f1 from t1 order by f1;
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
drop trigger trg4a_1;
......@@ -210,7 +209,6 @@ 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
......@@ -239,29 +237,27 @@ Grants for test_noprivs@localhost
GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER ON `priv_db`.* TO 'test_noprivs'@'localhost'
use priv_db;
Trigger create disabled - should fail - Bug 8884
------------------------------------------------
create trigger trg4b_1 before UPDATE on t1 for each row
set new.f1 = 'trig 3.5.3.7-1b';
insert into t1 (f1) values ('insert 3.5.3.7-1b');
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
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';
ERROR 42000: UPDATE command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
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
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 3.5.3.7-1b
drop trigger trg4b_1;
show grants;
Grants for test_yesprivs@localhost
......@@ -275,23 +271,21 @@ 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
insert 3.5.3.7-1b
insert 3.5.3.7-2b
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
trig 3.5.3.7-2a
update 3.5.3.7-1b
update t1 set f1 = 'update 3.5.3.7-2b' where f1 = 'insert 3.5.3.7-2b';
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
insert 3.5.3.6-no
insert 3.5.3.7-1a
insert 3.5.3.7-1b
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
trig 3.5.3.7-2a
trig 3.5.3.7-2b
update 3.5.3.7-1b
drop trigger trg4b_2;
Testcase 3.5.3.7c
......@@ -317,21 +311,19 @@ Grants for test_noprivs@localhost
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
use priv_db;
Trigger create disabled - should fail - Bug 8884
------------------------------------------------
create trigger trg4c_1 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-1c';
insert into t1 (f1) values ('insert 3.5.3.7-1c');
ERROR 42000: UPDATE command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
insert 3.5.3.6-no
insert 3.5.3.7-1a
insert 3.5.3.7-1c
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
trig 3.5.3.7-2b
update 3.5.3.7-1b
drop trigger trg4c_1;
show grants;
Grants for test_yesprivs@localhost
......@@ -345,14 +337,12 @@ 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
insert 3.5.3.7-1c
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
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:
......@@ -376,23 +366,20 @@ Grants for test_noprivs@localhost
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
------------------------------------------------
create trigger trg4d_1 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-1d';
insert into t1 (f1) values ('insert 3.5.3.7-1d');
ERROR 42000: UPDATE command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
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
insert 3.5.3.7-1c
insert 3.5.3.7-1d
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
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
......@@ -406,16 +393,13 @@ 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
insert 3.5.3.7-1c
insert 3.5.3.7-1d
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
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,14 +424,14 @@ use priv_db;
show grants;
Grants for test_noprivs@localhost
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
Trigger create disabled - should fail - Bug 8887
------------------------------------------------
create trigger trg5a_1 before INSERT on t1 for each row
set @test_var = new.f1;
set @test_var = 'before trig 3.5.3.8-1a';
select @test_var;
@test_var
before trig 3.5.3.8-1a
insert into t1 (f1) values ('insert 3.5.3.8-1a');
ERROR 42000: SELECT command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
select @test_var;
@test_var
before trig 3.5.3.8-1a
......@@ -495,15 +479,15 @@ Grants for test_noprivs@localhost
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER ON `priv_db`.* TO 'test_noprivs'@'localhost'
use priv_db;
Trigger create disabled - should fail - Bug 8887
------------------------------------------------
create trigger trg5b_1 before UPDATE on t1 for each row
set @test_var= new.f1;
set @test_var= 'before trig 3.5.3.8-1b';
insert into t1 (f1) values ('insert 3.5.3.8-1b');
select @test_var;
@test_var
before trig 3.5.3.8-1b
update t1 set f1= 'update 3.5.3.8-1b' where f1 = 'insert 3.5.3.8-1b';
ERROR 42000: SELECT command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
select @test_var;
@test_var
before trig 3.5.3.8-1b
......@@ -550,11 +534,11 @@ Grants for test_noprivs@localhost
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
use priv_db;
Trigger create disabled - should fail - Bug 8887
------------------------------------------------
create trigger trg5c_1 before INSERT on t1 for each row
set @test_var= new.f1;
set @test_var= 'before trig 3.5.3.8-1c';
insert into t1 (f1) values ('insert 3.5.3.8-1c');
ERROR 42000: SELECT command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
select @test_var;
@test_var
before trig 3.5.3.8-1c
......@@ -596,11 +580,11 @@ Grants for test_noprivs@localhost
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;
Trigger create disabled - should fail - Bug 8887
------------------------------------------------
create trigger trg5d_1 before INSERT on t1 for each row
set @test_var= new.f1;
set @test_var='before trig 3.5.3.8-1d';
insert into t1 (f1) values ('insert 3.5.3.8-1d');
ERROR 42000: SELECT command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
select @test_var;
@test_var
before trig 3.5.3.8-1d
......
......@@ -139,10 +139,10 @@ values ('1', 'Test 3.5.8.4', 222, 23456, 1.05);
Select f120, f122, f136, f144, f163 from tb3 where f122= 'Test 3.5.8.4';
f120 f122 f136 f144 f163
1 Test 3.5.8.4 00222 0000023456 1.050000000000000000000000000000
select * from db_test.t1_i order by i120;
select * from db_test.t1_i;
i120 i136 i144 i163
1 00222 0000023456 1.050000000000000000000000000000
select * from db_test.t1_u order by u120;
select * from db_test.t1_u;
u120 u136 u144 u163
a 00111 0000099999 999.990000000000000000000000000000
b 00222 0000023456 1.050000000000000000000000000000
......@@ -150,7 +150,7 @@ c 00333 0000099999 999.990000000000000000000000000000
d 00222 0000023456 1.050000000000000000000000000000
e 00222 0000023456 1.050000000000000000000000000000
f 00333 0000099999 999.990000000000000000000000000000
select * from db_test.t1_d order by d120;
select * from db_test.t1_d;
d120 d136 d144 d163
a 00111 0000099999 999.990000000000000000000000000000
c 00333 0000099999 999.990000000000000000000000000000
......@@ -343,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' order by f120;
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120,f136;
f120 f122 f136 f144 @test_var
A Test 3.5.8.5-case 00125 0000000007 A*seven
Insert into tb3 (f120, f122, f136, f144)
values ('b', 'Test 3.5.8.5-case', 71,16);
select f120, f122, f136, f144, @test_var
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120,f136;
f120 f122 f136 f144 @test_var
A Test 3.5.8.5-case 00125 0000000007 B*0000000016
B Test 3.5.8.5-case 00191 0000000016 B*0000000016
Insert into tb3 (f120, f122, f136, f144)
values ('c', 'Test 3.5.8.5-case', 80,1);
select f120, f122, f136, f144, @test_var
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120,f136;
f120 f122 f136 f144 @test_var
A Test 3.5.8.5-case 00125 0000000007 C=one
B Test 3.5.8.5-case 00191 0000000016 C=one
......@@ -366,7 +366,7 @@ values ('d', 'Test 3.5.8.5-case', 152);
Warnings:
Warning 1265 Data truncated for column 'f120' at row 1
select f120, f122, f136, f144, @test_var
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120,f136;
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
......@@ -377,7 +377,7 @@ values ('e', 'Test 3.5.8.5-case', 200, 8);
Warnings:
Warning 1265 Data truncated for column 'f120' at row 1
select f120, f122, f136, f144, @test_var
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120,f136;
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
......@@ -387,7 +387,7 @@ C Test 3.5.8.5-case 00200 0000000001 1=eight
Insert into tb3 (f120, f122, f136, f144)
values ('f', 'Test 3.5.8.5-case', 100, 8);
select f120, f122, f136, f144, @test_var
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120,f136;
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
......@@ -499,9 +499,38 @@ drop trigger trg7;
Testcase 3.5.8.6: (requirement void)
------------------------------------
CREATE PROCEDURE sp_01 () BEGIN set @v1=1; END//
CREATE TRIGGER trg8_1 BEFORE UPDATE ON tb3 FOR EACH ROW
BEGIN
CALL sp_01 ();
END//
Insert into tb3 (f120, f122, f136) values ('6', 'Test 3.5.8.6-insert', 101);
update tb3 set f120='S', f136=111,
f122='Test 3.5.8.6-tr8_1'
where f122='Test 3.5.8.6-insert';
select f120, f122
from tb3 where f122 like 'Test 3.5.8.6%' order by f120;
f120 f122
S Test 3.5.8.6-tr8_1
DROP TRIGGER trg8_1;
DROP PROCEDURE sp_01;
Testcase 3.5.8.7: (Disabled as a result of bug _____)
-----------------------------------------------------
Testcase 3.5.8.7
----------------
Create trigger trg9_1 before update on tb3 for each row
BEGIN
Start transaction;
Set new.f120='U';
Commit;
END//
ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
Create trigger trg9_2 before delete on tb3 for each row
BEGIN
Start transaction;
Set @var2=old.f120;
Rollback;
END//
ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
drop user test_general@localhost;
drop user test_general;
drop user test_super@localhost;
......@@ -294,8 +294,8 @@ drop table t2;
drop table t3;
drop table t4;
Testcase y.y.y.4: Recursive trigger/SP references (disabled bug 11889)
----------------------------------------------------------------------
Testcase y.y.y.4: Recursive trigger/SP references
-------------------------------------------------
set @sql_mode='traditional';
create table t1_sp (
count integer,
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -58,6 +58,7 @@ load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t11;
Section 3.1.10 - CALL checks:
--------------------------------------------------------------------------------
USE db_storedproc;
Testcase 3.1.10.2 + 3.1.10.5:
-----------------------------
......@@ -94,6 +95,7 @@ CALL sp31102();
ERROR 42000: execute command denied to user 'user_2'@'localhost' for routine 'db_storedproc.sp31102'
SELECT fn31105( 9 );
ERROR 42000: execute command denied to user 'user_2'@'localhost' for routine 'db_storedproc.fn31105'
connection default;
USE db_storedproc;
root@localhost db_storedproc
......@@ -114,6 +116,7 @@ a` a` 1000-01-01 -5000 a` -5000
SELECT fn31105( 9 );
fn31105( 9 )
81
connection default;
USE db_storedproc;
root@localhost db_storedproc
......@@ -180,6 +183,8 @@ DROP PROCEDURE IF EXISTS sp_ins_1;
DROP PROCEDURE IF EXISTS sp_ins_3;
DROP PROCEDURE IF EXISTS sp_upd;
DROP PROCEDURE IF EXISTS sp_ins_upd;
DROP PROCEDURE IF EXISTS sp_del;
DROP PROCEDURE IF EXISTS sp_with_rowcount;
CREATE TABLE temp(f1 CHAR(20),f2 CHAR(25),f3 DATE,f4 INT,f5 CHAR(25),f6 INT);
INSERT INTO temp SELECT * FROM t10;
CREATE PROCEDURE sp_ins_1()
......@@ -207,49 +212,72 @@ END;
SELECT COUNT( f1 ), f1 FROM temp GROUP BY f1;
UPDATE temp SET temp.f1 = 'updated_2' WHERE temp.f1 ='qwe' AND temp.f2 = 'abc';
END//
CREATE PROCEDURE sp_del()
BEGIN
DELETE FROM temp WHERE temp.f1 ='qwe' OR temp.f1 = 'updated_2';
END//
CREATE PROCEDURE sp_with_rowcount()
BEGIN
BEGIN
INSERT INTO temp VALUES ('qwe', 'abc', '1989-11-09', 100, 'uvw', 1000),
('qwe', 'xyz', '1998-03-26', 100, 'uvw', 1000),
('qwe', 'abc', '2000-11-09', 100, 'uvw', 1000),
('qwe', 'xyz', '2005-11-07', 100, 'uvw', 1000);
END;
SELECT row_count() AS 'row_count() after insert';
SELECT row_count() AS 'row_count() after select row_count()';
SELECT f1,f2,f3 FROM temp ORDER BY f1,f2,f3;
UPDATE temp SET temp.f1 = 'updated_2' WHERE temp.f2 = 'abc';
SELECT row_count() AS 'row_count() after update';
SELECT f1,f2,f3 FROM temp ORDER BY f1,f2,f3;
DELETE FROM temp WHERE temp.f1 = 'updated_2';
SELECT row_count() AS 'row_count() after delete';
END//
CALL sp_ins_1();
SELECT row_count();
row_count()
1
SELECT * FROM temp ORDER BY f4;
SELECT * FROM temp;
f1 f2 f3 f4 f5 f6
a^aaaaaaaa a^aaaaaaaa 1000-01-09 -4992 a^aaaaaaaa -4992
a_aaaaaaaaa a_aaaaaaaaa 1000-01-10 -4991 a_aaaaaaaaa -4991
a` a` 1000-01-01 -5000 a` -5000
aaa aaa 1000-01-02 -4999 aaa -4999
abaa abaa 1000-01-03 -4998 abaa -4998
abc abc 2005-10-03 100 uvw 1000
acaaa acaaa 1000-01-04 -4997 acaaa -4997
adaaaa adaaaa 1000-01-05 -4996 adaaaa -4996
aeaaaaa aeaaaaa 1000-01-06 -4995 aeaaaaa -4995
afaaaaaa afaaaaaa 1000-01-07 -4994 afaaaaaa -4994
agaaaaaaa agaaaaaaa 1000-01-08 -4993 agaaaaaaa -4993
a^aaaaaaaa a^aaaaaaaa 1000-01-09 -4992 a^aaaaaaaa -4992
a_aaaaaaaaa a_aaaaaaaaa 1000-01-10 -4991 a_aaaaaaaaa -4991
abc abc 2005-10-03 100 uvw 1000
CALL sp_ins_3();
SELECT row_count();
row_count()
1
SELECT * FROM temp ORDER BY f4;
SELECT * FROM temp;
f1 f2 f3 f4 f5 f6
a^aaaaaaaa a^aaaaaaaa 1000-01-09 -4992 a^aaaaaaaa -4992
a_aaaaaaaaa a_aaaaaaaaa 1000-01-10 -4991 a_aaaaaaaaa -4991
a` a` 1000-01-01 -5000 a` -5000
aaa aaa 1000-01-02 -4999 aaa -4999
abaa abaa 1000-01-03 -4998 abaa -4998
abc abc 2005-10-03 100 uvw 1000
abc xyz 1949-05-23 100 uvw 1000
abc xyz 1989-11-09 100 uvw 1000
abc xyz 2005-10-24 100 uvw 1000
acaaa acaaa 1000-01-04 -4997 acaaa -4997
adaaaa adaaaa 1000-01-05 -4996 adaaaa -4996
aeaaaaa aeaaaaa 1000-01-06 -4995 aeaaaaa -4995
afaaaaaa afaaaaaa 1000-01-07 -4994 afaaaaaa -4994
agaaaaaaa agaaaaaaa 1000-01-08 -4993 agaaaaaaa -4993
a^aaaaaaaa a^aaaaaaaa 1000-01-09 -4992 a^aaaaaaaa -4992
a_aaaaaaaaa a_aaaaaaaaa 1000-01-10 -4991 a_aaaaaaaaa -4991
abc abc 2005-10-03 100 uvw 1000
abc xyz 1949-05-23 100 uvw 1000
abc xyz 1989-11-09 100 uvw 1000
abc xyz 2005-10-24 100 uvw 1000
CALL sp_upd();
SELECT row_count();
row_count()
4
SELECT * FROM temp ORDER BY f4;
SELECT * FROM temp;
f1 f2 f3 f4 f5 f6
a^aaaaaaaa a^aaaaaaaa 1000-01-09 -4992 a^aaaaaaaa -4992
a_aaaaaaaaa a_aaaaaaaaa 1000-01-10 -4991 a_aaaaaaaaa -4991
a` a` 1000-01-01 -5000 a` -5000
aaa aaa 1000-01-02 -4999 aaa -4999
abaa abaa 1000-01-03 -4998 abaa -4998
......@@ -258,8 +286,6 @@ adaaaa adaaaa 1000-01-05 -4996 adaaaa -4996
aeaaaaa aeaaaaa 1000-01-06 -4995 aeaaaaa -4995
afaaaaaa afaaaaaa 1000-01-07 -4994 afaaaaaa -4994
agaaaaaaa agaaaaaaa 1000-01-08 -4993 agaaaaaaa -4993
a^aaaaaaaa a^aaaaaaaa 1000-01-09 -4992 a^aaaaaaaa -4992
a_aaaaaaaaa a_aaaaaaaaa 1000-01-10 -4991 a_aaaaaaaaa -4991
updated abc 2005-10-03 100 uvw 1000
updated xyz 1949-05-23 100 uvw 1000
updated xyz 1989-11-09 100 uvw 1000
......@@ -281,8 +307,10 @@ COUNT( f1 ) f1
SELECT row_count();
row_count()
3
SELECT * FROM temp ORDER BY f4;
SELECT * FROM temp;
f1 f2 f3 f4 f5 f6
a^aaaaaaaa a^aaaaaaaa 1000-01-09 -4992 a^aaaaaaaa -4992
a_aaaaaaaaa a_aaaaaaaaa 1000-01-10 -4991 a_aaaaaaaaa -4991
a` a` 1000-01-01 -5000 a` -5000
aaa aaa 1000-01-02 -4999 aaa -4999
abaa abaa 1000-01-03 -4998 abaa -4998
......@@ -291,20 +319,67 @@ adaaaa adaaaa 1000-01-05 -4996 adaaaa -4996
aeaaaaa aeaaaaa 1000-01-06 -4995 aeaaaaa -4995
afaaaaaa afaaaaaa 1000-01-07 -4994 afaaaaaa -4994
agaaaaaaa agaaaaaaa 1000-01-08 -4993 agaaaaaaa -4993
a^aaaaaaaa a^aaaaaaaa 1000-01-09 -4992 a^aaaaaaaa -4992
a_aaaaaaaaa a_aaaaaaaaa 1000-01-10 -4991 a_aaaaaaaaa -4991
qwe xyz 1998-03-26 100 uvw 1000
updated abc 2005-10-03 100 uvw 1000
updated xyz 1949-05-23 100 uvw 1000
updated xyz 1989-11-09 100 uvw 1000
updated xyz 2005-10-24 100 uvw 1000
updated_2 abc 1989-11-09 100 uvw 1000
qwe xyz 1998-03-26 100 uvw 1000
updated_2 abc 2000-11-09 100 uvw 1000
updated_2 abc 2005-11-07 100 uvw 1000
CALL sp_del();
SELECT row_count();
row_count()
4
SELECT * FROM temp;
f1 f2 f3 f4 f5 f6
a^aaaaaaaa a^aaaaaaaa 1000-01-09 -4992 a^aaaaaaaa -4992
a_aaaaaaaaa a_aaaaaaaaa 1000-01-10 -4991 a_aaaaaaaaa -4991
a` a` 1000-01-01 -5000 a` -5000
aaa aaa 1000-01-02 -4999 aaa -4999
abaa abaa 1000-01-03 -4998 abaa -4998
acaaa acaaa 1000-01-04 -4997 acaaa -4997
adaaaa adaaaa 1000-01-05 -4996 adaaaa -4996
aeaaaaa aeaaaaa 1000-01-06 -4995 aeaaaaa -4995
afaaaaaa afaaaaaa 1000-01-07 -4994 afaaaaaa -4994
agaaaaaaa agaaaaaaa 1000-01-08 -4993 agaaaaaaa -4993
updated abc 2005-10-03 100 uvw 1000
updated xyz 1949-05-23 100 uvw 1000
updated xyz 1989-11-09 100 uvw 1000
updated xyz 2005-10-24 100 uvw 1000
DELETE FROM temp;
CALL sp_with_rowcount();
row_count() after insert
4
row_count() after select row_count()
-1
f1 f2 f3
qwe abc 1989-11-09
qwe abc 2000-11-09
qwe xyz 1998-03-26
qwe xyz 2005-11-07
row_count() after update
2
f1 f2 f3
qwe xyz 1998-03-26
qwe xyz 2005-11-07
updated_2 abc 1989-11-09
updated_2 abc 2000-11-09
row_count() after delete
2
SELECT row_count();
row_count()
-1
SELECT * FROM temp;
f1 f2 f3 f4 f5 f6
qwe xyz 1998-03-26 100 uvw 1000
qwe xyz 2005-11-07 100 uvw 1000
DROP PROCEDURE sp_ins_1;
DROP PROCEDURE sp_ins_3;
DROP PROCEDURE sp_upd;
DROP PROCEDURE sp_ins_upd;
DROP PROCEDURE sp_del;
DROP PROCEDURE sp_with_rowcount;
DROP TABLE temp;
Testcase 3.1.10.8:
......
......@@ -180,15 +180,14 @@ insert 3.5.3.2-no
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
------------------------------------------------
create trigger trg4a_1 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-1a';
insert into t1 (f1) values ('insert 3.5.3.7-1a');
ERROR 42000: UPDATE command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
select f1 from t1 order by f1;
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
drop trigger trg4a_1;
......@@ -206,7 +205,6 @@ 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
......@@ -235,29 +233,27 @@ Grants for test_noprivs@localhost
GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER ON `priv_db`.* TO 'test_noprivs'@'localhost'
use priv_db;
Trigger create disabled - should fail - Bug 8884
------------------------------------------------
create trigger trg4b_1 before UPDATE on t1 for each row
set new.f1 = 'trig 3.5.3.7-1b';
insert into t1 (f1) values ('insert 3.5.3.7-1b');
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
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';
ERROR 42000: UPDATE command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
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
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 3.5.3.7-1b
drop trigger trg4b_1;
show grants;
Grants for test_yesprivs@localhost
......@@ -271,23 +267,21 @@ 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
insert 3.5.3.7-1b
insert 3.5.3.7-2b
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
trig 3.5.3.7-2a
update 3.5.3.7-1b
update t1 set f1 = 'update 3.5.3.7-2b' where f1 = 'insert 3.5.3.7-2b';
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
insert 3.5.3.6-no
insert 3.5.3.7-1a
insert 3.5.3.7-1b
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
trig 3.5.3.7-2a
trig 3.5.3.7-2b
update 3.5.3.7-1b
drop trigger trg4b_2;
Testcase 3.5.3.7c
......@@ -313,21 +307,19 @@ Grants for test_noprivs@localhost
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
use priv_db;
Trigger create disabled - should fail - Bug 8884
------------------------------------------------
create trigger trg4c_1 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-1c';
insert into t1 (f1) values ('insert 3.5.3.7-1c');
ERROR 42000: UPDATE command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
insert 3.5.3.6-no
insert 3.5.3.7-1a
insert 3.5.3.7-1c
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
trig 3.5.3.7-2b
update 3.5.3.7-1b
drop trigger trg4c_1;
show grants;
Grants for test_yesprivs@localhost
......@@ -341,14 +333,12 @@ 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
insert 3.5.3.7-1c
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
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:
......@@ -372,23 +362,20 @@ Grants for test_noprivs@localhost
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
------------------------------------------------
create trigger trg4d_1 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-1d';
insert into t1 (f1) values ('insert 3.5.3.7-1d');
ERROR 42000: UPDATE command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
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
insert 3.5.3.7-1c
insert 3.5.3.7-1d
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
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
......@@ -402,16 +389,13 @@ 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
insert 3.5.3.7-1c
insert 3.5.3.7-1d
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
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:
......@@ -436,14 +420,14 @@ use priv_db;
show grants;
Grants for test_noprivs@localhost
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
Trigger create disabled - should fail - Bug 8887
------------------------------------------------
create trigger trg5a_1 before INSERT on t1 for each row
set @test_var = new.f1;
set @test_var = 'before trig 3.5.3.8-1a';
select @test_var;
@test_var
before trig 3.5.3.8-1a
insert into t1 (f1) values ('insert 3.5.3.8-1a');
ERROR 42000: SELECT command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
select @test_var;
@test_var
before trig 3.5.3.8-1a
......@@ -491,15 +475,15 @@ Grants for test_noprivs@localhost
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER ON `priv_db`.* TO 'test_noprivs'@'localhost'
use priv_db;
Trigger create disabled - should fail - Bug 8887
------------------------------------------------
create trigger trg5b_1 before UPDATE on t1 for each row
set @test_var= new.f1;
set @test_var= 'before trig 3.5.3.8-1b';
insert into t1 (f1) values ('insert 3.5.3.8-1b');
select @test_var;
@test_var
before trig 3.5.3.8-1b
update t1 set f1= 'update 3.5.3.8-1b' where f1 = 'insert 3.5.3.8-1b';
ERROR 42000: SELECT command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
select @test_var;
@test_var
before trig 3.5.3.8-1b
......@@ -546,11 +530,11 @@ Grants for test_noprivs@localhost
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
use priv_db;
Trigger create disabled - should fail - Bug 8887
------------------------------------------------
create trigger trg5c_1 before INSERT on t1 for each row
set @test_var= new.f1;
set @test_var= 'before trig 3.5.3.8-1c';
insert into t1 (f1) values ('insert 3.5.3.8-1c');
ERROR 42000: SELECT command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
select @test_var;
@test_var
before trig 3.5.3.8-1c
......@@ -592,11 +576,11 @@ Grants for test_noprivs@localhost
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;
Trigger create disabled - should fail - Bug 8887
------------------------------------------------
create trigger trg5d_1 before INSERT on t1 for each row
set @test_var= new.f1;
set @test_var='before trig 3.5.3.8-1d';
insert into t1 (f1) values ('insert 3.5.3.8-1d');
ERROR 42000: SELECT command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
select @test_var;
@test_var
before trig 3.5.3.8-1d
......
......@@ -135,10 +135,10 @@ values ('1', 'Test 3.5.8.4', 222, 23456, 1.05);
Select f120, f122, f136, f144, f163 from tb3 where f122= 'Test 3.5.8.4';
f120 f122 f136 f144 f163
1 Test 3.5.8.4 00222 0000023456 1.050000000000000000000000000000
select * from db_test.t1_i order by i120;
select * from db_test.t1_i;
i120 i136 i144 i163
1 00222 0000023456 1.050000000000000000000000000000
select * from db_test.t1_u order by u120;
select * from db_test.t1_u;
u120 u136 u144 u163
a 00111 0000099999 999.990000000000000000000000000000
b 00222 0000023456 1.050000000000000000000000000000
......@@ -146,7 +146,7 @@ c 00333 0000099999 999.990000000000000000000000000000
d 00222 0000023456 1.050000000000000000000000000000
e 00222 0000023456 1.050000000000000000000000000000
f 00333 0000099999 999.990000000000000000000000000000
select * from db_test.t1_d order by d120;
select * from db_test.t1_d;
d120 d136 d144 d163
a 00111 0000099999 999.990000000000000000000000000000
c 00333 0000099999 999.990000000000000000000000000000
......@@ -339,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' order by f120;
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120,f136;
f120 f122 f136 f144 @test_var
A Test 3.5.8.5-case 00125 0000000007 A*seven
Insert into tb3 (f120, f122, f136, f144)
values ('b', 'Test 3.5.8.5-case', 71,16);
select f120, f122, f136, f144, @test_var
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120,f136;
f120 f122 f136 f144 @test_var
A Test 3.5.8.5-case 00125 0000000007 B*0000000016
B Test 3.5.8.5-case 00191 0000000016 B*0000000016
Insert into tb3 (f120, f122, f136, f144)
values ('c', 'Test 3.5.8.5-case', 80,1);
select f120, f122, f136, f144, @test_var
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120,f136;
f120 f122 f136 f144 @test_var
A Test 3.5.8.5-case 00125 0000000007 C=one
B Test 3.5.8.5-case 00191 0000000016 C=one
......@@ -362,7 +362,7 @@ values ('d', 'Test 3.5.8.5-case', 152);
Warnings:
Warning 1265 Data truncated for column 'f120' at row 1
select f120, f122, f136, f144, @test_var
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120,f136;
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
......@@ -373,7 +373,7 @@ values ('e', 'Test 3.5.8.5-case', 200, 8);
Warnings:
Warning 1265 Data truncated for column 'f120' at row 1
select f120, f122, f136, f144, @test_var
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120,f136;
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
......@@ -383,7 +383,7 @@ C Test 3.5.8.5-case 00200 0000000001 1=eight
Insert into tb3 (f120, f122, f136, f144)
values ('f', 'Test 3.5.8.5-case', 100, 8);
select f120, f122, f136, f144, @test_var
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120,f136;
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
......@@ -495,9 +495,38 @@ drop trigger trg7;
Testcase 3.5.8.6: (requirement void)
------------------------------------
CREATE PROCEDURE sp_01 () BEGIN set @v1=1; END//
CREATE TRIGGER trg8_1 BEFORE UPDATE ON tb3 FOR EACH ROW
BEGIN
CALL sp_01 ();
END//
Insert into tb3 (f120, f122, f136) values ('6', 'Test 3.5.8.6-insert', 101);
update tb3 set f120='S', f136=111,
f122='Test 3.5.8.6-tr8_1'
where f122='Test 3.5.8.6-insert';
select f120, f122
from tb3 where f122 like 'Test 3.5.8.6%' order by f120;
f120 f122
S Test 3.5.8.6-tr8_1
DROP TRIGGER trg8_1;
DROP PROCEDURE sp_01;
Testcase 3.5.8.7: (Disabled as a result of bug _____)
-----------------------------------------------------
Testcase 3.5.8.7
----------------
Create trigger trg9_1 before update on tb3 for each row
BEGIN
Start transaction;
Set new.f120='U';
Commit;
END//
ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
Create trigger trg9_2 before delete on tb3 for each row
BEGIN
Start transaction;
Set @var2=old.f120;
Rollback;
END//
ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
drop user test_general@localhost;
drop user test_general;
drop user test_super@localhost;
......@@ -294,8 +294,8 @@ drop table t2;
drop table t3;
drop table t4;
Testcase y.y.y.4: Recursive trigger/SP references (disabled bug 11889)
----------------------------------------------------------------------
Testcase y.y.y.4: Recursive trigger/SP references
-------------------------------------------------
set @sql_mode='traditional';
create table t1_sp (
count integer,
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -58,6 +58,7 @@ load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t11;
Section 3.1.10 - CALL checks:
--------------------------------------------------------------------------------
USE db_storedproc;
Testcase 3.1.10.2 + 3.1.10.5:
-----------------------------
......@@ -94,6 +95,7 @@ CALL sp31102();
ERROR 42000: execute command denied to user 'user_2'@'localhost' for routine 'db_storedproc.sp31102'
SELECT fn31105( 9 );
ERROR 42000: execute command denied to user 'user_2'@'localhost' for routine 'db_storedproc.fn31105'
connection default;
USE db_storedproc;
root@localhost db_storedproc
......@@ -114,6 +116,7 @@ a` a` 1000-01-01 -5000 a` -5000
SELECT fn31105( 9 );
fn31105( 9 )
81
connection default;
USE db_storedproc;
root@localhost db_storedproc
......@@ -180,6 +183,8 @@ DROP PROCEDURE IF EXISTS sp_ins_1;
DROP PROCEDURE IF EXISTS sp_ins_3;
DROP PROCEDURE IF EXISTS sp_upd;
DROP PROCEDURE IF EXISTS sp_ins_upd;
DROP PROCEDURE IF EXISTS sp_del;
DROP PROCEDURE IF EXISTS sp_with_rowcount;
CREATE TABLE temp(f1 CHAR(20),f2 CHAR(25),f3 DATE,f4 INT,f5 CHAR(25),f6 INT);
INSERT INTO temp SELECT * FROM t10;
CREATE PROCEDURE sp_ins_1()
......@@ -207,49 +212,72 @@ END;
SELECT COUNT( f1 ), f1 FROM temp GROUP BY f1;
UPDATE temp SET temp.f1 = 'updated_2' WHERE temp.f1 ='qwe' AND temp.f2 = 'abc';
END//
CREATE PROCEDURE sp_del()
BEGIN
DELETE FROM temp WHERE temp.f1 ='qwe' OR temp.f1 = 'updated_2';
END//
CREATE PROCEDURE sp_with_rowcount()
BEGIN
BEGIN
INSERT INTO temp VALUES ('qwe', 'abc', '1989-11-09', 100, 'uvw', 1000),
('qwe', 'xyz', '1998-03-26', 100, 'uvw', 1000),
('qwe', 'abc', '2000-11-09', 100, 'uvw', 1000),
('qwe', 'xyz', '2005-11-07', 100, 'uvw', 1000);
END;
SELECT row_count() AS 'row_count() after insert';
SELECT row_count() AS 'row_count() after select row_count()';
SELECT f1,f2,f3 FROM temp ORDER BY f1,f2,f3;
UPDATE temp SET temp.f1 = 'updated_2' WHERE temp.f2 = 'abc';
SELECT row_count() AS 'row_count() after update';
SELECT f1,f2,f3 FROM temp ORDER BY f1,f2,f3;
DELETE FROM temp WHERE temp.f1 = 'updated_2';
SELECT row_count() AS 'row_count() after delete';
END//
CALL sp_ins_1();
SELECT row_count();
row_count()
1
SELECT * FROM temp ORDER BY f4;
SELECT * FROM temp;
f1 f2 f3 f4 f5 f6
a^aaaaaaaa a^aaaaaaaa 1000-01-09 -4992 a^aaaaaaaa -4992
a_aaaaaaaaa a_aaaaaaaaa 1000-01-10 -4991 a_aaaaaaaaa -4991
a` a` 1000-01-01 -5000 a` -5000
aaa aaa 1000-01-02 -4999 aaa -4999
abaa abaa 1000-01-03 -4998 abaa -4998
abc abc 2005-10-03 100 uvw 1000
acaaa acaaa 1000-01-04 -4997 acaaa -4997
adaaaa adaaaa 1000-01-05 -4996 adaaaa -4996
aeaaaaa aeaaaaa 1000-01-06 -4995 aeaaaaa -4995
afaaaaaa afaaaaaa 1000-01-07 -4994 afaaaaaa -4994
agaaaaaaa agaaaaaaa 1000-01-08 -4993 agaaaaaaa -4993
a^aaaaaaaa a^aaaaaaaa 1000-01-09 -4992 a^aaaaaaaa -4992
a_aaaaaaaaa a_aaaaaaaaa 1000-01-10 -4991 a_aaaaaaaaa -4991
abc abc 2005-10-03 100 uvw 1000
CALL sp_ins_3();
SELECT row_count();
row_count()
1
SELECT * FROM temp ORDER BY f4;
SELECT * FROM temp;
f1 f2 f3 f4 f5 f6
a^aaaaaaaa a^aaaaaaaa 1000-01-09 -4992 a^aaaaaaaa -4992
a_aaaaaaaaa a_aaaaaaaaa 1000-01-10 -4991 a_aaaaaaaaa -4991
a` a` 1000-01-01 -5000 a` -5000
aaa aaa 1000-01-02 -4999 aaa -4999
abaa abaa 1000-01-03 -4998 abaa -4998
abc abc 2005-10-03 100 uvw 1000
abc xyz 1949-05-23 100 uvw 1000
abc xyz 1989-11-09 100 uvw 1000
abc xyz 2005-10-24 100 uvw 1000
acaaa acaaa 1000-01-04 -4997 acaaa -4997
adaaaa adaaaa 1000-01-05 -4996 adaaaa -4996
aeaaaaa aeaaaaa 1000-01-06 -4995 aeaaaaa -4995
afaaaaaa afaaaaaa 1000-01-07 -4994 afaaaaaa -4994
agaaaaaaa agaaaaaaa 1000-01-08 -4993 agaaaaaaa -4993
a^aaaaaaaa a^aaaaaaaa 1000-01-09 -4992 a^aaaaaaaa -4992
a_aaaaaaaaa a_aaaaaaaaa 1000-01-10 -4991 a_aaaaaaaaa -4991
abc abc 2005-10-03 100 uvw 1000
abc xyz 1949-05-23 100 uvw 1000
abc xyz 1989-11-09 100 uvw 1000
abc xyz 2005-10-24 100 uvw 1000
CALL sp_upd();
SELECT row_count();
row_count()
4
SELECT * FROM temp ORDER BY f4;
SELECT * FROM temp;
f1 f2 f3 f4 f5 f6
a^aaaaaaaa a^aaaaaaaa 1000-01-09 -4992 a^aaaaaaaa -4992
a_aaaaaaaaa a_aaaaaaaaa 1000-01-10 -4991 a_aaaaaaaaa -4991
a` a` 1000-01-01 -5000 a` -5000
aaa aaa 1000-01-02 -4999 aaa -4999
abaa abaa 1000-01-03 -4998 abaa -4998
......@@ -258,8 +286,6 @@ adaaaa adaaaa 1000-01-05 -4996 adaaaa -4996
aeaaaaa aeaaaaa 1000-01-06 -4995 aeaaaaa -4995
afaaaaaa afaaaaaa 1000-01-07 -4994 afaaaaaa -4994
agaaaaaaa agaaaaaaa 1000-01-08 -4993 agaaaaaaa -4993
a^aaaaaaaa a^aaaaaaaa 1000-01-09 -4992 a^aaaaaaaa -4992
a_aaaaaaaaa a_aaaaaaaaa 1000-01-10 -4991 a_aaaaaaaaa -4991
updated abc 2005-10-03 100 uvw 1000
updated xyz 1949-05-23 100 uvw 1000
updated xyz 1989-11-09 100 uvw 1000
......@@ -281,8 +307,10 @@ COUNT( f1 ) f1
SELECT row_count();
row_count()
3
SELECT * FROM temp ORDER BY f4;
SELECT * FROM temp;
f1 f2 f3 f4 f5 f6
a^aaaaaaaa a^aaaaaaaa 1000-01-09 -4992 a^aaaaaaaa -4992
a_aaaaaaaaa a_aaaaaaaaa 1000-01-10 -4991 a_aaaaaaaaa -4991
a` a` 1000-01-01 -5000 a` -5000
aaa aaa 1000-01-02 -4999 aaa -4999
abaa abaa 1000-01-03 -4998 abaa -4998
......@@ -291,20 +319,67 @@ adaaaa adaaaa 1000-01-05 -4996 adaaaa -4996
aeaaaaa aeaaaaa 1000-01-06 -4995 aeaaaaa -4995
afaaaaaa afaaaaaa 1000-01-07 -4994 afaaaaaa -4994
agaaaaaaa agaaaaaaa 1000-01-08 -4993 agaaaaaaa -4993
a^aaaaaaaa a^aaaaaaaa 1000-01-09 -4992 a^aaaaaaaa -4992
a_aaaaaaaaa a_aaaaaaaaa 1000-01-10 -4991 a_aaaaaaaaa -4991
qwe xyz 1998-03-26 100 uvw 1000
updated abc 2005-10-03 100 uvw 1000
updated xyz 1949-05-23 100 uvw 1000
updated xyz 1989-11-09 100 uvw 1000
updated xyz 2005-10-24 100 uvw 1000
updated_2 abc 1989-11-09 100 uvw 1000
qwe xyz 1998-03-26 100 uvw 1000
updated_2 abc 2000-11-09 100 uvw 1000
updated_2 abc 2005-11-07 100 uvw 1000
CALL sp_del();
SELECT row_count();
row_count()
4
SELECT * FROM temp;
f1 f2 f3 f4 f5 f6
a^aaaaaaaa a^aaaaaaaa 1000-01-09 -4992 a^aaaaaaaa -4992
a_aaaaaaaaa a_aaaaaaaaa 1000-01-10 -4991 a_aaaaaaaaa -4991
a` a` 1000-01-01 -5000 a` -5000
aaa aaa 1000-01-02 -4999 aaa -4999
abaa abaa 1000-01-03 -4998 abaa -4998
acaaa acaaa 1000-01-04 -4997 acaaa -4997
adaaaa adaaaa 1000-01-05 -4996 adaaaa -4996
aeaaaaa aeaaaaa 1000-01-06 -4995 aeaaaaa -4995
afaaaaaa afaaaaaa 1000-01-07 -4994 afaaaaaa -4994
agaaaaaaa agaaaaaaa 1000-01-08 -4993 agaaaaaaa -4993
updated abc 2005-10-03 100 uvw 1000
updated xyz 1949-05-23 100 uvw 1000
updated xyz 1989-11-09 100 uvw 1000
updated xyz 2005-10-24 100 uvw 1000
DELETE FROM temp;
CALL sp_with_rowcount();
row_count() after insert
4
row_count() after select row_count()
-1
f1 f2 f3
qwe abc 1989-11-09
qwe abc 2000-11-09
qwe xyz 1998-03-26
qwe xyz 2005-11-07
row_count() after update
2
f1 f2 f3
qwe xyz 1998-03-26
qwe xyz 2005-11-07
updated_2 abc 1989-11-09
updated_2 abc 2000-11-09
row_count() after delete
2
SELECT row_count();
row_count()
-1
SELECT * FROM temp;
f1 f2 f3 f4 f5 f6
qwe xyz 1998-03-26 100 uvw 1000
qwe xyz 2005-11-07 100 uvw 1000
DROP PROCEDURE sp_ins_1;
DROP PROCEDURE sp_ins_3;
DROP PROCEDURE sp_upd;
DROP PROCEDURE sp_ins_upd;
DROP PROCEDURE sp_del;
DROP PROCEDURE sp_with_rowcount;
DROP TABLE temp;
Testcase 3.1.10.8:
......
......@@ -184,15 +184,14 @@ insert 3.5.3.2-no
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
------------------------------------------------
create trigger trg4a_1 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-1a';
insert into t1 (f1) values ('insert 3.5.3.7-1a');
ERROR 42000: UPDATE command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
select f1 from t1 order by f1;
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
drop trigger trg4a_1;
......@@ -210,7 +209,6 @@ 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
......@@ -239,29 +237,27 @@ Grants for test_noprivs@localhost
GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER ON `priv_db`.* TO 'test_noprivs'@'localhost'
use priv_db;
Trigger create disabled - should fail - Bug 8884
------------------------------------------------
create trigger trg4b_1 before UPDATE on t1 for each row
set new.f1 = 'trig 3.5.3.7-1b';
insert into t1 (f1) values ('insert 3.5.3.7-1b');
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
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';
ERROR 42000: UPDATE command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
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
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 3.5.3.7-1b
drop trigger trg4b_1;
show grants;
Grants for test_yesprivs@localhost
......@@ -275,23 +271,21 @@ 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
insert 3.5.3.7-1b
insert 3.5.3.7-2b
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
trig 3.5.3.7-2a
update 3.5.3.7-1b
update t1 set f1 = 'update 3.5.3.7-2b' where f1 = 'insert 3.5.3.7-2b';
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
insert 3.5.3.6-no
insert 3.5.3.7-1a
insert 3.5.3.7-1b
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
trig 3.5.3.7-2a
trig 3.5.3.7-2b
update 3.5.3.7-1b
drop trigger trg4b_2;
Testcase 3.5.3.7c
......@@ -317,21 +311,19 @@ Grants for test_noprivs@localhost
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
use priv_db;
Trigger create disabled - should fail - Bug 8884
------------------------------------------------
create trigger trg4c_1 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-1c';
insert into t1 (f1) values ('insert 3.5.3.7-1c');
ERROR 42000: UPDATE command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
insert 3.5.3.6-no
insert 3.5.3.7-1a
insert 3.5.3.7-1c
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
trig 3.5.3.7-2b
update 3.5.3.7-1b
drop trigger trg4c_1;
show grants;
Grants for test_yesprivs@localhost
......@@ -345,14 +337,12 @@ 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
insert 3.5.3.7-1c
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
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:
......@@ -376,23 +366,20 @@ Grants for test_noprivs@localhost
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
------------------------------------------------
create trigger trg4d_1 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-1d';
insert into t1 (f1) values ('insert 3.5.3.7-1d');
ERROR 42000: UPDATE command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
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
insert 3.5.3.7-1c
insert 3.5.3.7-1d
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
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
......@@ -406,16 +393,13 @@ 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
insert 3.5.3.7-1c
insert 3.5.3.7-1d
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
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,14 +424,14 @@ use priv_db;
show grants;
Grants for test_noprivs@localhost
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
Trigger create disabled - should fail - Bug 8887
------------------------------------------------
create trigger trg5a_1 before INSERT on t1 for each row
set @test_var = new.f1;
set @test_var = 'before trig 3.5.3.8-1a';
select @test_var;
@test_var
before trig 3.5.3.8-1a
insert into t1 (f1) values ('insert 3.5.3.8-1a');
ERROR 42000: SELECT command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
select @test_var;
@test_var
before trig 3.5.3.8-1a
......@@ -495,15 +479,15 @@ Grants for test_noprivs@localhost
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER ON `priv_db`.* TO 'test_noprivs'@'localhost'
use priv_db;
Trigger create disabled - should fail - Bug 8887
------------------------------------------------
create trigger trg5b_1 before UPDATE on t1 for each row
set @test_var= new.f1;
set @test_var= 'before trig 3.5.3.8-1b';
insert into t1 (f1) values ('insert 3.5.3.8-1b');
select @test_var;
@test_var
before trig 3.5.3.8-1b
update t1 set f1= 'update 3.5.3.8-1b' where f1 = 'insert 3.5.3.8-1b';
ERROR 42000: SELECT command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
select @test_var;
@test_var
before trig 3.5.3.8-1b
......@@ -550,11 +534,11 @@ Grants for test_noprivs@localhost
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
use priv_db;
Trigger create disabled - should fail - Bug 8887
------------------------------------------------
create trigger trg5c_1 before INSERT on t1 for each row
set @test_var= new.f1;
set @test_var= 'before trig 3.5.3.8-1c';
insert into t1 (f1) values ('insert 3.5.3.8-1c');
ERROR 42000: SELECT command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
select @test_var;
@test_var
before trig 3.5.3.8-1c
......@@ -596,11 +580,11 @@ Grants for test_noprivs@localhost
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;
Trigger create disabled - should fail - Bug 8887
------------------------------------------------
create trigger trg5d_1 before INSERT on t1 for each row
set @test_var= new.f1;
set @test_var='before trig 3.5.3.8-1d';
insert into t1 (f1) values ('insert 3.5.3.8-1d');
ERROR 42000: SELECT command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
select @test_var;
@test_var
before trig 3.5.3.8-1d
......
......@@ -139,10 +139,10 @@ values ('1', 'Test 3.5.8.4', 222, 23456, 1.05);
Select f120, f122, f136, f144, f163 from tb3 where f122= 'Test 3.5.8.4';
f120 f122 f136 f144 f163
1 Test 3.5.8.4 00222 0000023456 1.050000000000000000000000000000
select * from db_test.t1_i order by i120;
select * from db_test.t1_i;
i120 i136 i144 i163
1 00222 0000023456 1.050000000000000000000000000000
select * from db_test.t1_u order by u120;
select * from db_test.t1_u;
u120 u136 u144 u163
a 00111 0000099999 999.990000000000000000000000000000
b 00222 0000023456 1.050000000000000000000000000000
......@@ -150,7 +150,7 @@ c 00333 0000099999 999.990000000000000000000000000000
d 00222 0000023456 1.050000000000000000000000000000
e 00222 0000023456 1.050000000000000000000000000000
f 00333 0000099999 999.990000000000000000000000000000
select * from db_test.t1_d order by d120;
select * from db_test.t1_d;
d120 d136 d144 d163
a 00111 0000099999 999.990000000000000000000000000000
c 00333 0000099999 999.990000000000000000000000000000
......@@ -343,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' order by f120;
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120,f136;
f120 f122 f136 f144 @test_var
A Test 3.5.8.5-case 00125 0000000007 A*seven
Insert into tb3 (f120, f122, f136, f144)
values ('b', 'Test 3.5.8.5-case', 71,16);
select f120, f122, f136, f144, @test_var
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120,f136;
f120 f122 f136 f144 @test_var
A Test 3.5.8.5-case 00125 0000000007 B*0000000016
B Test 3.5.8.5-case 00191 0000000016 B*0000000016
Insert into tb3 (f120, f122, f136, f144)
values ('c', 'Test 3.5.8.5-case', 80,1);
select f120, f122, f136, f144, @test_var
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120,f136;
f120 f122 f136 f144 @test_var
A Test 3.5.8.5-case 00125 0000000007 C=one
B Test 3.5.8.5-case 00191 0000000016 C=one
......@@ -366,7 +366,7 @@ values ('d', 'Test 3.5.8.5-case', 152);
Warnings:
Warning 1265 Data truncated for column 'f120' at row 1
select f120, f122, f136, f144, @test_var
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120,f136;
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
......@@ -377,7 +377,7 @@ values ('e', 'Test 3.5.8.5-case', 200, 8);
Warnings:
Warning 1265 Data truncated for column 'f120' at row 1
select f120, f122, f136, f144, @test_var
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120,f136;
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
......@@ -387,7 +387,7 @@ C Test 3.5.8.5-case 00200 0000000001 1=eight
Insert into tb3 (f120, f122, f136, f144)
values ('f', 'Test 3.5.8.5-case', 100, 8);
select f120, f122, f136, f144, @test_var
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120,f136;
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
......@@ -499,9 +499,38 @@ drop trigger trg7;
Testcase 3.5.8.6: (requirement void)
------------------------------------
CREATE PROCEDURE sp_01 () BEGIN set @v1=1; END//
CREATE TRIGGER trg8_1 BEFORE UPDATE ON tb3 FOR EACH ROW
BEGIN
CALL sp_01 ();
END//
Insert into tb3 (f120, f122, f136) values ('6', 'Test 3.5.8.6-insert', 101);
update tb3 set f120='S', f136=111,
f122='Test 3.5.8.6-tr8_1'
where f122='Test 3.5.8.6-insert';
select f120, f122
from tb3 where f122 like 'Test 3.5.8.6%' order by f120;
f120 f122
S Test 3.5.8.6-tr8_1
DROP TRIGGER trg8_1;
DROP PROCEDURE sp_01;
Testcase 3.5.8.7: (Disabled as a result of bug _____)
-----------------------------------------------------
Testcase 3.5.8.7
----------------
Create trigger trg9_1 before update on tb3 for each row
BEGIN
Start transaction;
Set new.f120='U';
Commit;
END//
ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
Create trigger trg9_2 before delete on tb3 for each row
BEGIN
Start transaction;
Set @var2=old.f120;
Rollback;
END//
ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
drop user test_general@localhost;
drop user test_general;
drop user test_super@localhost;
......@@ -298,8 +298,8 @@ drop table t2;
drop table t3;
drop table t4;
Testcase y.y.y.4: Recursive trigger/SP references (disabled bug 11889)
----------------------------------------------------------------------
Testcase y.y.y.4: Recursive trigger/SP references
-------------------------------------------------
set @sql_mode='traditional';
create table t1_sp (
count integer,
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -58,6 +58,7 @@ load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t11;
Section 3.1.10 - CALL checks:
--------------------------------------------------------------------------------
USE db_storedproc;
Testcase 3.1.10.2 + 3.1.10.5:
-----------------------------
......@@ -94,6 +95,7 @@ CALL sp31102();
ERROR 42000: execute command denied to user 'user_2'@'localhost' for routine 'db_storedproc.sp31102'
SELECT fn31105( 9 );
ERROR 42000: execute command denied to user 'user_2'@'localhost' for routine 'db_storedproc.fn31105'
connection default;
USE db_storedproc;
root@localhost db_storedproc
......@@ -114,6 +116,7 @@ a` a` 1000-01-01 -5000 a` -5000
SELECT fn31105( 9 );
fn31105( 9 )
81
connection default;
USE db_storedproc;
root@localhost db_storedproc
......@@ -180,6 +183,8 @@ DROP PROCEDURE IF EXISTS sp_ins_1;
DROP PROCEDURE IF EXISTS sp_ins_3;
DROP PROCEDURE IF EXISTS sp_upd;
DROP PROCEDURE IF EXISTS sp_ins_upd;
DROP PROCEDURE IF EXISTS sp_del;
DROP PROCEDURE IF EXISTS sp_with_rowcount;
CREATE TABLE temp(f1 CHAR(20),f2 CHAR(25),f3 DATE,f4 INT,f5 CHAR(25),f6 INT);
INSERT INTO temp SELECT * FROM t10;
CREATE PROCEDURE sp_ins_1()
......@@ -207,49 +212,72 @@ END;
SELECT COUNT( f1 ), f1 FROM temp GROUP BY f1;
UPDATE temp SET temp.f1 = 'updated_2' WHERE temp.f1 ='qwe' AND temp.f2 = 'abc';
END//
CREATE PROCEDURE sp_del()
BEGIN
DELETE FROM temp WHERE temp.f1 ='qwe' OR temp.f1 = 'updated_2';
END//
CREATE PROCEDURE sp_with_rowcount()
BEGIN
BEGIN
INSERT INTO temp VALUES ('qwe', 'abc', '1989-11-09', 100, 'uvw', 1000),
('qwe', 'xyz', '1998-03-26', 100, 'uvw', 1000),
('qwe', 'abc', '2000-11-09', 100, 'uvw', 1000),
('qwe', 'xyz', '2005-11-07', 100, 'uvw', 1000);
END;
SELECT row_count() AS 'row_count() after insert';
SELECT row_count() AS 'row_count() after select row_count()';
SELECT f1,f2,f3 FROM temp ORDER BY f1,f2,f3;
UPDATE temp SET temp.f1 = 'updated_2' WHERE temp.f2 = 'abc';
SELECT row_count() AS 'row_count() after update';
SELECT f1,f2,f3 FROM temp ORDER BY f1,f2,f3;
DELETE FROM temp WHERE temp.f1 = 'updated_2';
SELECT row_count() AS 'row_count() after delete';
END//
CALL sp_ins_1();
SELECT row_count();
row_count()
1
SELECT * FROM temp ORDER BY f4;
SELECT * FROM temp;
f1 f2 f3 f4 f5 f6
a^aaaaaaaa a^aaaaaaaa 1000-01-09 -4992 a^aaaaaaaa -4992
a_aaaaaaaaa a_aaaaaaaaa 1000-01-10 -4991 a_aaaaaaaaa -4991
a` a` 1000-01-01 -5000 a` -5000
aaa aaa 1000-01-02 -4999 aaa -4999
abaa abaa 1000-01-03 -4998 abaa -4998
abc abc 2005-10-03 100 uvw 1000
acaaa acaaa 1000-01-04 -4997 acaaa -4997
adaaaa adaaaa 1000-01-05 -4996 adaaaa -4996
aeaaaaa aeaaaaa 1000-01-06 -4995 aeaaaaa -4995
afaaaaaa afaaaaaa 1000-01-07 -4994 afaaaaaa -4994
agaaaaaaa agaaaaaaa 1000-01-08 -4993 agaaaaaaa -4993
a^aaaaaaaa a^aaaaaaaa 1000-01-09 -4992 a^aaaaaaaa -4992
a_aaaaaaaaa a_aaaaaaaaa 1000-01-10 -4991 a_aaaaaaaaa -4991
abc abc 2005-10-03 100 uvw 1000
CALL sp_ins_3();
SELECT row_count();
row_count()
1
SELECT * FROM temp ORDER BY f4;
SELECT * FROM temp;
f1 f2 f3 f4 f5 f6
a^aaaaaaaa a^aaaaaaaa 1000-01-09 -4992 a^aaaaaaaa -4992
a_aaaaaaaaa a_aaaaaaaaa 1000-01-10 -4991 a_aaaaaaaaa -4991
a` a` 1000-01-01 -5000 a` -5000
aaa aaa 1000-01-02 -4999 aaa -4999
abaa abaa 1000-01-03 -4998 abaa -4998
abc abc 2005-10-03 100 uvw 1000
abc xyz 1949-05-23 100 uvw 1000
abc xyz 1989-11-09 100 uvw 1000
abc xyz 2005-10-24 100 uvw 1000
acaaa acaaa 1000-01-04 -4997 acaaa -4997
adaaaa adaaaa 1000-01-05 -4996 adaaaa -4996
aeaaaaa aeaaaaa 1000-01-06 -4995 aeaaaaa -4995
afaaaaaa afaaaaaa 1000-01-07 -4994 afaaaaaa -4994
agaaaaaaa agaaaaaaa 1000-01-08 -4993 agaaaaaaa -4993
a^aaaaaaaa a^aaaaaaaa 1000-01-09 -4992 a^aaaaaaaa -4992
a_aaaaaaaaa a_aaaaaaaaa 1000-01-10 -4991 a_aaaaaaaaa -4991
abc abc 2005-10-03 100 uvw 1000
abc xyz 1949-05-23 100 uvw 1000
abc xyz 1989-11-09 100 uvw 1000
abc xyz 2005-10-24 100 uvw 1000
CALL sp_upd();
SELECT row_count();
row_count()
4
SELECT * FROM temp ORDER BY f4;
SELECT * FROM temp;
f1 f2 f3 f4 f5 f6
a^aaaaaaaa a^aaaaaaaa 1000-01-09 -4992 a^aaaaaaaa -4992
a_aaaaaaaaa a_aaaaaaaaa 1000-01-10 -4991 a_aaaaaaaaa -4991
a` a` 1000-01-01 -5000 a` -5000
aaa aaa 1000-01-02 -4999 aaa -4999
abaa abaa 1000-01-03 -4998 abaa -4998
......@@ -258,8 +286,6 @@ adaaaa adaaaa 1000-01-05 -4996 adaaaa -4996
aeaaaaa aeaaaaa 1000-01-06 -4995 aeaaaaa -4995
afaaaaaa afaaaaaa 1000-01-07 -4994 afaaaaaa -4994
agaaaaaaa agaaaaaaa 1000-01-08 -4993 agaaaaaaa -4993
a^aaaaaaaa a^aaaaaaaa 1000-01-09 -4992 a^aaaaaaaa -4992
a_aaaaaaaaa a_aaaaaaaaa 1000-01-10 -4991 a_aaaaaaaaa -4991
updated abc 2005-10-03 100 uvw 1000
updated xyz 1949-05-23 100 uvw 1000
updated xyz 1989-11-09 100 uvw 1000
......@@ -281,8 +307,10 @@ COUNT( f1 ) f1
SELECT row_count();
row_count()
3
SELECT * FROM temp ORDER BY f4;
SELECT * FROM temp;
f1 f2 f3 f4 f5 f6
a^aaaaaaaa a^aaaaaaaa 1000-01-09 -4992 a^aaaaaaaa -4992
a_aaaaaaaaa a_aaaaaaaaa 1000-01-10 -4991 a_aaaaaaaaa -4991
a` a` 1000-01-01 -5000 a` -5000
aaa aaa 1000-01-02 -4999 aaa -4999
abaa abaa 1000-01-03 -4998 abaa -4998
......@@ -291,20 +319,67 @@ adaaaa adaaaa 1000-01-05 -4996 adaaaa -4996
aeaaaaa aeaaaaa 1000-01-06 -4995 aeaaaaa -4995
afaaaaaa afaaaaaa 1000-01-07 -4994 afaaaaaa -4994
agaaaaaaa agaaaaaaa 1000-01-08 -4993 agaaaaaaa -4993
a^aaaaaaaa a^aaaaaaaa 1000-01-09 -4992 a^aaaaaaaa -4992
a_aaaaaaaaa a_aaaaaaaaa 1000-01-10 -4991 a_aaaaaaaaa -4991
updated_2 abc 2000-11-09 100 uvw 1000
qwe xyz 1998-03-26 100 uvw 1000
updated_2 abc 1989-11-09 100 uvw 1000
updated xyz 2005-10-24 100 uvw 1000
updated xyz 1989-11-09 100 uvw 1000
updated xyz 1949-05-23 100 uvw 1000
updated abc 2005-10-03 100 uvw 1000
updated xyz 1949-05-23 100 uvw 1000
updated xyz 1989-11-09 100 uvw 1000
updated xyz 2005-10-24 100 uvw 1000
updated_2 abc 1989-11-09 100 uvw 1000
updated_2 abc 2000-11-09 100 uvw 1000
updated_2 abc 2005-11-07 100 uvw 1000
CALL sp_del();
SELECT row_count();
row_count()
4
SELECT * FROM temp;
f1 f2 f3 f4 f5 f6
a^aaaaaaaa a^aaaaaaaa 1000-01-09 -4992 a^aaaaaaaa -4992
a_aaaaaaaaa a_aaaaaaaaa 1000-01-10 -4991 a_aaaaaaaaa -4991
a` a` 1000-01-01 -5000 a` -5000
aaa aaa 1000-01-02 -4999 aaa -4999
abaa abaa 1000-01-03 -4998 abaa -4998
acaaa acaaa 1000-01-04 -4997 acaaa -4997
adaaaa adaaaa 1000-01-05 -4996 adaaaa -4996
aeaaaaa aeaaaaa 1000-01-06 -4995 aeaaaaa -4995
afaaaaaa afaaaaaa 1000-01-07 -4994 afaaaaaa -4994
agaaaaaaa agaaaaaaa 1000-01-08 -4993 agaaaaaaa -4993
updated abc 2005-10-03 100 uvw 1000
updated xyz 1949-05-23 100 uvw 1000
updated xyz 1989-11-09 100 uvw 1000
updated xyz 2005-10-24 100 uvw 1000
DELETE FROM temp;
CALL sp_with_rowcount();
row_count() after insert
4
row_count() after select row_count()
-1
f1 f2 f3
qwe abc 1989-11-09
qwe abc 2000-11-09
qwe xyz 1998-03-26
qwe xyz 2005-11-07
row_count() after update
2
f1 f2 f3
qwe xyz 1998-03-26
qwe xyz 2005-11-07
updated_2 abc 1989-11-09
updated_2 abc 2000-11-09
row_count() after delete
2
SELECT row_count();
row_count()
-1
SELECT * FROM temp;
f1 f2 f3 f4 f5 f6
qwe xyz 1998-03-26 100 uvw 1000
qwe xyz 2005-11-07 100 uvw 1000
DROP PROCEDURE sp_ins_1;
DROP PROCEDURE sp_ins_3;
DROP PROCEDURE sp_upd;
DROP PROCEDURE sp_ins_upd;
DROP PROCEDURE sp_del;
DROP PROCEDURE sp_with_rowcount;
DROP TABLE temp;
Testcase 3.1.10.8:
......
......@@ -185,15 +185,14 @@ insert 3.5.3.2-no
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
------------------------------------------------
create trigger trg4a_1 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-1a';
insert into t1 (f1) values ('insert 3.5.3.7-1a');
ERROR 42000: UPDATE command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
select f1 from t1 order by f1;
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
drop trigger trg4a_1;
......@@ -211,7 +210,6 @@ 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
......@@ -240,29 +238,27 @@ Grants for test_noprivs@localhost
GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER ON `priv_db`.* TO 'test_noprivs'@'localhost'
use priv_db;
Trigger create disabled - should fail - Bug 8884
------------------------------------------------
create trigger trg4b_1 before UPDATE on t1 for each row
set new.f1 = 'trig 3.5.3.7-1b';
insert into t1 (f1) values ('insert 3.5.3.7-1b');
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
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';
ERROR 42000: UPDATE command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
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
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 3.5.3.7-1b
drop trigger trg4b_1;
show grants;
Grants for test_yesprivs@localhost
......@@ -276,23 +272,21 @@ 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
insert 3.5.3.7-1b
insert 3.5.3.7-2b
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
trig 3.5.3.7-2a
update 3.5.3.7-1b
update t1 set f1 = 'update 3.5.3.7-2b' where f1 = 'insert 3.5.3.7-2b';
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
insert 3.5.3.6-no
insert 3.5.3.7-1a
insert 3.5.3.7-1b
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
trig 3.5.3.7-2a
trig 3.5.3.7-2b
update 3.5.3.7-1b
drop trigger trg4b_2;
Testcase 3.5.3.7c
......@@ -318,21 +312,19 @@ Grants for test_noprivs@localhost
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
use priv_db;
Trigger create disabled - should fail - Bug 8884
------------------------------------------------
create trigger trg4c_1 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-1c';
insert into t1 (f1) values ('insert 3.5.3.7-1c');
ERROR 42000: UPDATE command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
insert 3.5.3.6-no
insert 3.5.3.7-1a
insert 3.5.3.7-1c
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
trig 3.5.3.7-2b
update 3.5.3.7-1b
drop trigger trg4c_1;
show grants;
Grants for test_yesprivs@localhost
......@@ -346,14 +338,12 @@ 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
insert 3.5.3.7-1c
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
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:
......@@ -377,23 +367,20 @@ Grants for test_noprivs@localhost
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
------------------------------------------------
create trigger trg4d_1 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-1d';
insert into t1 (f1) values ('insert 3.5.3.7-1d');
ERROR 42000: UPDATE command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
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
insert 3.5.3.7-1c
insert 3.5.3.7-1d
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
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
......@@ -407,16 +394,13 @@ 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
insert 3.5.3.7-1c
insert 3.5.3.7-1d
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
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:
......@@ -441,14 +425,14 @@ use priv_db;
show grants;
Grants for test_noprivs@localhost
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
Trigger create disabled - should fail - Bug 8887
------------------------------------------------
create trigger trg5a_1 before INSERT on t1 for each row
set @test_var = new.f1;
set @test_var = 'before trig 3.5.3.8-1a';
select @test_var;
@test_var
before trig 3.5.3.8-1a
insert into t1 (f1) values ('insert 3.5.3.8-1a');
ERROR 42000: SELECT command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
select @test_var;
@test_var
before trig 3.5.3.8-1a
......@@ -496,15 +480,15 @@ Grants for test_noprivs@localhost
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER ON `priv_db`.* TO 'test_noprivs'@'localhost'
use priv_db;
Trigger create disabled - should fail - Bug 8887
------------------------------------------------
create trigger trg5b_1 before UPDATE on t1 for each row
set @test_var= new.f1;
set @test_var= 'before trig 3.5.3.8-1b';
insert into t1 (f1) values ('insert 3.5.3.8-1b');
select @test_var;
@test_var
before trig 3.5.3.8-1b
update t1 set f1= 'update 3.5.3.8-1b' where f1 = 'insert 3.5.3.8-1b';
ERROR 42000: SELECT command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
select @test_var;
@test_var
before trig 3.5.3.8-1b
......@@ -551,11 +535,11 @@ Grants for test_noprivs@localhost
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
use priv_db;
Trigger create disabled - should fail - Bug 8887
------------------------------------------------
create trigger trg5c_1 before INSERT on t1 for each row
set @test_var= new.f1;
set @test_var= 'before trig 3.5.3.8-1c';
insert into t1 (f1) values ('insert 3.5.3.8-1c');
ERROR 42000: SELECT command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
select @test_var;
@test_var
before trig 3.5.3.8-1c
......@@ -597,11 +581,11 @@ Grants for test_noprivs@localhost
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;
Trigger create disabled - should fail - Bug 8887
------------------------------------------------
create trigger trg5d_1 before INSERT on t1 for each row
set @test_var= new.f1;
set @test_var='before trig 3.5.3.8-1d';
insert into t1 (f1) values ('insert 3.5.3.8-1d');
ERROR 42000: SELECT command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
select @test_var;
@test_var
before trig 3.5.3.8-1d
......
......@@ -140,10 +140,10 @@ values ('1', 'Test 3.5.8.4', 222, 23456, 1.05);
Select f120, f122, f136, f144, f163 from tb3 where f122= 'Test 3.5.8.4';
f120 f122 f136 f144 f163
1 Test 3.5.8.4 00222 0000023456 1.050000000000000000000000000000
select * from db_test.t1_i order by i120;
select * from db_test.t1_i;
i120 i136 i144 i163
1 00222 0000023456 1.050000000000000000000000000000
select * from db_test.t1_u order by u120;
select * from db_test.t1_u;
u120 u136 u144 u163
a 00111 0000099999 999.990000000000000000000000000000
b 00222 0000023456 1.050000000000000000000000000000
......@@ -151,7 +151,7 @@ c 00333 0000099999 999.990000000000000000000000000000
d 00222 0000023456 1.050000000000000000000000000000
e 00222 0000023456 1.050000000000000000000000000000
f 00333 0000099999 999.990000000000000000000000000000
select * from db_test.t1_d order by d120;
select * from db_test.t1_d;
d120 d136 d144 d163
a 00111 0000099999 999.990000000000000000000000000000
c 00333 0000099999 999.990000000000000000000000000000
......@@ -344,20 +344,20 @@ set @test_var='Empty';
Insert into tb3 (f120, f122, f136, f144)
values ('a', 'Test 3.5.8.5-case', 5, 7);
select f120, f122, f136, f144, @test_var
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120,f136;
f120 f122 f136 f144 @test_var
A Test 3.5.8.5-case 00125 0000000007 A*seven
Insert into tb3 (f120, f122, f136, f144)
values ('b', 'Test 3.5.8.5-case', 71,16);
select f120, f122, f136, f144, @test_var
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120,f136;
f120 f122 f136 f144 @test_var
A Test 3.5.8.5-case 00125 0000000007 B*0000000016
B Test 3.5.8.5-case 00191 0000000016 B*0000000016
Insert into tb3 (f120, f122, f136, f144)
values ('c', 'Test 3.5.8.5-case', 80,1);
select f120, f122, f136, f144, @test_var
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120,f136;
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
......@@ -367,7 +367,7 @@ values ('d', 'Test 3.5.8.5-case', 152);
Warnings:
Warning 1265 Data truncated for column 'f120' at row 1
select f120, f122, f136, f144, @test_var
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120,f136;
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
......@@ -378,7 +378,7 @@ values ('e', 'Test 3.5.8.5-case', 200, 8);
Warnings:
Warning 1265 Data truncated for column 'f120' at row 1
select f120, f122, f136, f144, @test_var
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120,f136;
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
......@@ -388,7 +388,7 @@ C Test 3.5.8.5-case 00200 0000000001 1=eight
Insert into tb3 (f120, f122, f136, f144)
values ('f', 'Test 3.5.8.5-case', 100, 8);
select f120, f122, f136, f144, @test_var
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120,f136;
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
......@@ -500,9 +500,38 @@ drop trigger trg7;
Testcase 3.5.8.6: (requirement void)
------------------------------------
CREATE PROCEDURE sp_01 () BEGIN set @v1=1; END//
CREATE TRIGGER trg8_1 BEFORE UPDATE ON tb3 FOR EACH ROW
BEGIN
CALL sp_01 ();
END//
Insert into tb3 (f120, f122, f136) values ('6', 'Test 3.5.8.6-insert', 101);
update tb3 set f120='S', f136=111,
f122='Test 3.5.8.6-tr8_1'
where f122='Test 3.5.8.6-insert';
select f120, f122
from tb3 where f122 like 'Test 3.5.8.6%' order by f120;
f120 f122
S Test 3.5.8.6-tr8_1
DROP TRIGGER trg8_1;
DROP PROCEDURE sp_01;
Testcase 3.5.8.7: (Disabled as a result of bug _____)
-----------------------------------------------------
Testcase 3.5.8.7
----------------
Create trigger trg9_1 before update on tb3 for each row
BEGIN
Start transaction;
Set new.f120='U';
Commit;
END//
ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
Create trigger trg9_2 before delete on tb3 for each row
BEGIN
Start transaction;
Set @var2=old.f120;
Rollback;
END//
ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
drop user test_general@localhost;
drop user test_general;
drop user test_super@localhost;
......@@ -295,8 +295,8 @@ drop table t2;
drop table t3;
drop table t4;
Testcase y.y.y.4: Recursive trigger/SP references (disabled bug 11889)
----------------------------------------------------------------------
Testcase y.y.y.4: Recursive trigger/SP references
-------------------------------------------------
set @sql_mode='traditional';
create table t1_sp (
count integer,
......
This diff is collapsed.
......@@ -21,6 +21,7 @@ let $message= Section 3.1.10 - CALL checks:;
--source include/show_msg80.inc
USE db_storedproc;
# ------------------------------------------------------------------------------
let $message= Testcase 3.1.10.2 + 3.1.10.5:;
......@@ -73,11 +74,12 @@ connect (user2_2, localhost, user_2, , db_storedproc);
--source suite/funcs_1/include/show_connection.inc
# no privileges exist
--error 1370
--error ER_PROCACCESS_DENIED_ERROR
CALL sp31102();
SELECT fn31105( 9 );
# now 'add' EXECUTE to INVOKER
--echo connection default;
connection default;
USE db_storedproc;
--source suite/funcs_1/include/show_connection.inc
......@@ -97,6 +99,7 @@ SELECT fn31105( 9 );
disconnect user2_3;
# now 'remove' SELECT from INVOKER
--echo connection default;
connection default;
USE db_storedproc;
--source suite/funcs_1/include/show_connection.inc
......@@ -144,7 +147,7 @@ BEGIN
END//
delimiter ;//
--error 1305
--error ER_SP_DOES_NOT_EXIST
CALL fn1();
# cleanup
......@@ -170,7 +173,7 @@ BEGIN
END//
delimiter ;//
--error 1305
--error ER_SP_DOES_NOT_EXIST
SELECT sp1();
# cleanup
......@@ -184,26 +187,32 @@ let $message=
Ensure that the ROW_COUNT() SQL function always returns the correct number of
rows affected by the execution of a stored procedure.;
--source include/show_msg80.inc
# Note(mleich): Information taken from a comments in
# Bug#21818 Return value of ROW_COUNT() is incorrect for
# ALTER TABLE, LOAD DATA
# ROW_COUNT() is -1 following any statement which is not DELETE, INSERT
# or UPDATE.
# Also, after a CALL statement, ROW_COUNT() will return the value of the
# last statement in the stored procedure.
--disable_warnings
DROP PROCEDURE IF EXISTS sp_ins_1;
DROP PROCEDURE IF EXISTS sp_ins_3;
DROP PROCEDURE IF EXISTS sp_upd;
DROP PROCEDURE IF EXISTS sp_ins_upd;
DROP PROCEDURE IF EXISTS sp_del;
DROP PROCEDURE IF EXISTS sp_with_rowcount;
--enable_warnings
CREATE TABLE temp(f1 CHAR(20),f2 CHAR(25),f3 DATE,f4 INT,f5 CHAR(25),f6 INT);
INSERT INTO temp SELECT * FROM t10;
delimiter //;
#FIXME: add to proc: SELECT row_count() 'ins';
CREATE PROCEDURE sp_ins_1()
BEGIN
INSERT INTO temp VALUES ('abc', 'abc', '20051003', 100, 'uvw', 1000);
END//
#FIXME: add to proc: SELECT row_count() 'ins_3';
CREATE PROCEDURE sp_ins_3()
BEGIN
INSERT INTO temp VALUES ('abc', 'xyz', '19490523', 100, 'uvw', 1000);
......@@ -211,26 +220,11 @@ BEGIN
INSERT INTO temp VALUES ('abc', 'xyz', '2005-10-24', 100, 'uvw', 1000);
END//
# FIXME: add to proc: SELECT row_count() AS 'updated';
CREATE PROCEDURE sp_upd()
BEGIN
UPDATE temp SET temp.f1 = 'updated' WHERE temp.f1 ='abc';
END//
# FIXME: use commented proc
# CREATE PROCEDURE sp_ins_upd()
# BEGIN
# BEGIN
# INSERT INTO temp VALUES ('qwe', 'abc', '1989-11-09', 100, 'uvw', 1000);
# INSERT INTO temp VALUES ('qwe', 'xyz', '1998-03-26', 100, 'uvw', 1000);
# INSERT INTO temp VALUES ('qwe', 'abc', '2000-11-09', 100, 'uvw', 1000);
# INSERT INTO temp VALUES ('qwe', 'abc', '2005-11-07', 100, 'uvw', 1000);
# END;
# SELECT row_count() AS 'insert "qwe"';
# SELECT COUNT( f1 ), f1 FROM temp GROUP BY f1;
# UPDATE temp SET temp.f1 = 'updated_2' WHERE temp.f1 ='qwe' AND temp.f2 = 'abc';
# SELECT row_count() AS 'update "qwe" AND "abc"';
# END//
CREATE PROCEDURE sp_ins_upd()
BEGIN
BEGIN
......@@ -242,31 +236,70 @@ BEGIN
SELECT COUNT( f1 ), f1 FROM temp GROUP BY f1;
UPDATE temp SET temp.f1 = 'updated_2' WHERE temp.f1 ='qwe' AND temp.f2 = 'abc';
END//
CREATE PROCEDURE sp_del()
BEGIN
DELETE FROM temp WHERE temp.f1 ='qwe' OR temp.f1 = 'updated_2';
END//
CREATE PROCEDURE sp_with_rowcount()
BEGIN
BEGIN
INSERT INTO temp VALUES ('qwe', 'abc', '1989-11-09', 100, 'uvw', 1000),
('qwe', 'xyz', '1998-03-26', 100, 'uvw', 1000),
('qwe', 'abc', '2000-11-09', 100, 'uvw', 1000),
('qwe', 'xyz', '2005-11-07', 100, 'uvw', 1000);
END;
SELECT row_count() AS 'row_count() after insert';
SELECT row_count() AS 'row_count() after select row_count()';
SELECT f1,f2,f3 FROM temp ORDER BY f1,f2,f3;
UPDATE temp SET temp.f1 = 'updated_2' WHERE temp.f2 = 'abc';
SELECT row_count() AS 'row_count() after update';
SELECT f1,f2,f3 FROM temp ORDER BY f1,f2,f3;
DELETE FROM temp WHERE temp.f1 = 'updated_2';
SELECT row_count() AS 'row_count() after delete';
END//
delimiter ;//
CALL sp_ins_1();
SELECT row_count();
SELECT * FROM temp ORDER BY f4;
--sorted_result
SELECT * FROM temp;
CALL sp_ins_3();
#FIXME: check is 1 correct here? I expect 3 for 3 inserted rows inside the procedure
SELECT row_count();
SELECT * FROM temp ORDER BY f4;
--sorted_result
SELECT * FROM temp;
CALL sp_upd();
SELECT row_count();
SELECT * FROM temp ORDER BY f4;
--sorted_result
SELECT * FROM temp;
#FIXME: check is 3 correct here? I expect 7 for 4 inserted and then 3 updated rows inside the procedure
CALL sp_ins_upd();
SELECT row_count();
SELECT * FROM temp ORDER BY f4;
--sorted_result
SELECT * FROM temp;
CALL sp_del();
SELECT row_count();
--sorted_result
SELECT * FROM temp;
DELETE FROM temp;
CALL sp_with_rowcount();
SELECT row_count();
--sorted_result
SELECT * FROM temp;
# cleanup
DROP PROCEDURE sp_ins_1;
DROP PROCEDURE sp_ins_3;
DROP PROCEDURE sp_upd;
DROP PROCEDURE sp_ins_upd;
DROP PROCEDURE sp_del;
DROP PROCEDURE sp_with_rowcount;
DROP TABLE temp;
......
......@@ -10,7 +10,8 @@
#
##############################################################################
innodb_storedproc: (changes of WL#2984, using storeproc_nn instead)
memory_storedproc: (changes of WL#2984, using storeproc_nn instead)
myisam_storedproc: (changes of WL#2984, using storeproc_nn instead)
innodb_storedproc_06 : bug#33464 DROP FUNCTION let server hang
myisam_storedproc_06 : bug#33464 DROP FUNCTION let server hang
memory_storedproc_06 : bug#33464 DROP FUNCTION let server hang
ndb_storedproc_06 : bug#33464 DROP FUNCTION let server hang
ndb__datadict: 2007-10-08 mleich Bug#31421 funcs_1: ndb__datadict fails, discrepancy between scripts and expected results
......@@ -18,11 +18,9 @@ let $engine_type= innodb;
eval SET @NO_REFRESH = IF( '$NO_REFRESH' = '', 0, 1);
# FIXME Replace the following, when "if" for mysqltest is available
let $run= `SELECT @NO_REFRESH`;
while ($run)
if ($run)
{
# Create some objects needed in many testcases
USE test;
--source suite/funcs_1/include/innodb_tb1.inc
......@@ -41,7 +39,5 @@ while ($run)
# These tables are needed for the stored procedure testscases
--source suite/funcs_1/include/sp_tb.inc
let $run= 0;
}
......@@ -18,16 +18,12 @@ let $engine_type= innodb;
eval SET @NO_REFRESH = IF( '$NO_REFRESH' = '', 0, 1);
# FIXME Replace the following, when "if" for mysqltest is available
let $run= `SELECT @NO_REFRESH = 0`;
while ($run)
if ($run)
{
# Create some objects needed in many testcases
USE test;
--source suite/funcs_1/include/innodb_tb4.inc
let $run= 0;
}
--source suite/funcs_1/bitdata/bitdata_master.test
......
......@@ -18,16 +18,12 @@ let $engine_type= innodb;
eval SET @NO_REFRESH = IF( '$NO_REFRESH' = '', 0, 1);
# FIXME Replace the following, when "if" for mysqltest is available
let $run= `SELECT @NO_REFRESH = 0`;
while ($run)
if ($run)
{
# Create some objects needed in many testcases
USE test;
--source suite/funcs_1/include/innodb_tb1.inc
let $run= 0;
}
--source suite/funcs_1/cursors/cursors_master.test
......
#### suite/funcs_1/t/innodb_storedproc.test
#
--source include/have_innodb.inc
let $engine_type= innodb;
--source suite/funcs_1/storedproc/load_sp_tb.inc
--source suite/funcs_1/storedproc/storedproc_master.inc
......@@ -18,16 +18,12 @@ let $engine_type= innodb;
eval SET @NO_REFRESH = IF( '$NO_REFRESH' = '', 0, 1);
# FIXME Replace the following, when "if" for mysqltest is available
let $run= `SELECT @NO_REFRESH = 0`;
while ($run)
if ($run)
{
# Create some objects needed in many testcases
USE test;
--source suite/funcs_1/include/innodb_tb3.inc
let $run= 0;
}
--source suite/funcs_1/triggers/triggers_0102.inc
......
......@@ -18,16 +18,12 @@ let $engine_type= innodb;
eval SET @NO_REFRESH = IF( '$NO_REFRESH' = '', 0, 1);
# FIXME Replace the following, when "if" for mysqltest is available
let $run= `SELECT @NO_REFRESH = 0`;
while ($run)
if ($run)
{
# Create some objects needed in many testcases
USE test;
--source suite/funcs_1/include/innodb_tb3.inc
let $run= 0;
}
--source suite/funcs_1/triggers/triggers_03.inc
......
......@@ -18,14 +18,11 @@ let $engine_type= innodb;
eval SET @NO_REFRESH = IF( '$NO_REFRESH' = '', 0, 1);
# FIXME Replace the following, when "if" for mysqltest is available
let $run= `SELECT @NO_REFRESH = 0`;
while ($run)
if ($run)
{
# Create some objects needed in many testcases
USE test;
let $run= 0;
}
--source suite/funcs_1/triggers/triggers_03e_db_level.inc
......
......@@ -18,16 +18,12 @@ let $engine_type= innodb;
eval SET @NO_REFRESH = IF( '$NO_REFRESH' = '', 0, 1);
# FIXME Replace the following, when "if" for mysqltest is available
let $run= `SELECT @NO_REFRESH = 0`;
while ($run)
if ($run)
{
# Create some objects needed in many testcases
USE test;
--source suite/funcs_1/include/innodb_tb3.inc
let $run= 0;
}
--source suite/funcs_1/triggers/triggers_0407.inc
......
......@@ -18,16 +18,12 @@ let $engine_type= innodb;
eval SET @NO_REFRESH = IF( '$NO_REFRESH' = '', 0, 1);
# FIXME Replace the following, when "if" for mysqltest is available
let $run= `SELECT @NO_REFRESH = 0`;
while ($run)
if ($run)
{
# Create some objects needed in many testcases
USE test;
--source suite/funcs_1/include/innodb_tb3.inc
let $run= 0;
}
--source suite/funcs_1/triggers/triggers_08.inc
......
......@@ -18,16 +18,12 @@ let $engine_type= innodb;
eval SET @NO_REFRESH = IF( '$NO_REFRESH' = '', 0, 1);
# FIXME Replace the following, when "if" for mysqltest is available
let $run= `SELECT @NO_REFRESH = 0`;
while ($run)
if ($run)
{
# Create some objects needed in many testcases
USE test;
--source suite/funcs_1/include/innodb_tb3.inc
let $run= 0;
}
--source suite/funcs_1/triggers/triggers_09.inc
......
......@@ -18,16 +18,12 @@ let $engine_type= innodb;
eval SET @NO_REFRESH = IF( '$NO_REFRESH' = '', 0, 1);
# FIXME Replace the following, when "if" for mysqltest is available
let $run= `SELECT @NO_REFRESH = 0`;
while ($run)
if ($run)
{
# Create some objects needed in many testcases
USE test;
--source suite/funcs_1/include/innodb_tb3.inc
let $run= 0;
}
--source suite/funcs_1/triggers/triggers_1011ext.inc
......
......@@ -18,16 +18,12 @@ let $engine_type= innodb;
eval SET @NO_REFRESH = IF( '$NO_REFRESH' = '', 0, 1);
# FIXME Replace the following, when "if" for mysqltest is available
let $run= `SELECT @NO_REFRESH = 0`;
while ($run)
if ($run)
{
# Create some objects needed in many testcases
USE test;
--source suite/funcs_1/include/innodb_tb3.inc
let $run= 0;
}
--source suite/funcs_1/triggers/trig_frkey.inc
......
......@@ -21,7 +21,6 @@ eval SET @NO_REFRESH = IF( '$NO_REFRESH' = '', 0, 1);
let $run= `SELECT @NO_REFRESH = 0`;
if ($run)
{
# Create some objects needed in many testcases
USE test;
--source suite/funcs_1/include/innodb_tb2.inc
......@@ -32,7 +31,6 @@ if ($run)
USE test1;
--source suite/funcs_1/include/innodb_tb2.inc
USE test;
}
--source suite/funcs_1/views/views_master.inc
......
......@@ -16,11 +16,9 @@ let $engine_type= memory;
eval SET @NO_REFRESH = IF( '$NO_REFRESH' = '', 0, 1);
# FIXME Replace the following, when "if" for mysqltest is available
let $run= `SELECT @NO_REFRESH`;
while ($run)
if ($run)
{
# Create some objects needed in many testcases
USE test;
--source suite/funcs_1/include/memory_tb1.inc
......@@ -39,7 +37,5 @@ while ($run)
# These tables are needed for the stored procedure testscases
--source suite/funcs_1/include/sp_tb.inc
let $run= 0;
}
......@@ -16,16 +16,12 @@ let $engine_type= memory;
eval SET @NO_REFRESH = IF( '$NO_REFRESH' = '', 0, 1);
# FIXME Replace the following, when "if" for mysqltest is available
let $run= `SELECT @NO_REFRESH = 0`;
while ($run)
if ($run)
{
# Create some objects needed in many testcases
USE test;
--source suite/funcs_1/include/memory_tb4.inc
let $run= 0;
}
--source suite/funcs_1/bitdata/bitdata_master.test
......
......@@ -16,16 +16,12 @@ let $engine_type= memory;
eval SET @NO_REFRESH = IF( '$NO_REFRESH' = '', 0, 1);
# FIXME Replace the following, when "if" for mysqltest is available
let $run= `SELECT @NO_REFRESH = 0`;
while ($run)
if($run)
{
# Create some objects needed in many testcases
USE test;
--source suite/funcs_1/include/memory_tb1.inc
let $run= 0;
}
--source suite/funcs_1/cursors/cursors_master.test
......
......@@ -3,4 +3,6 @@
let $engine_type= memory;
--source suite/funcs_1/storedproc/load_sp_tb.inc
--source suite/funcs_1/storedproc/storedproc_master.inc
......@@ -16,16 +16,12 @@ let $engine_type= memory;
eval SET @NO_REFRESH = IF( '$NO_REFRESH' = '', 0, 1);
# FIXME Replace the following, when "if" for mysqltest is available
let $run= `SELECT @NO_REFRESH = 0`;
while ($run)
if($run)
{
# Create some objects needed in many testcases
USE test;
--source suite/funcs_1/include/memory_tb3.inc
let $run= 0;
}
--source suite/funcs_1/triggers/triggers_0102.inc
......
......@@ -16,16 +16,12 @@ let $engine_type= memory;
eval SET @NO_REFRESH = IF( '$NO_REFRESH' = '', 0, 1);
# FIXME Replace the following, when "if" for mysqltest is available
let $run= `SELECT @NO_REFRESH = 0`;
while ($run)
if($run)
{
# Create some objects needed in many testcases
USE test;
--source suite/funcs_1/include/memory_tb3.inc
let $run= 0;
}
--source suite/funcs_1/triggers/triggers_03.inc
......
......@@ -16,14 +16,11 @@ let $engine_type= memory;
eval SET @NO_REFRESH = IF( '$NO_REFRESH' = '', 0, 1);
# FIXME Replace the following, when "if" for mysqltest is available
let $run= `SELECT @NO_REFRESH = 0`;
while ($run)
if ($run)
{
# Create some objects needed in many testcases
USE test;
let $run= 0;
}
--source suite/funcs_1/triggers/triggers_03e_db_level.inc
......
......@@ -16,16 +16,12 @@ let $engine_type= memory;
eval SET @NO_REFRESH = IF( '$NO_REFRESH' = '', 0, 1);
# FIXME Replace the following, when "if" for mysqltest is available
let $run= `SELECT @NO_REFRESH = 0`;
while ($run)
if ($run)
{
# Create some objects needed in many testcases
USE test;
--source suite/funcs_1/include/memory_tb3.inc
let $run= 0;
}
--source suite/funcs_1/triggers/triggers_0407.inc
......
......@@ -16,16 +16,12 @@ let $engine_type= memory;
eval SET @NO_REFRESH = IF( '$NO_REFRESH' = '', 0, 1);
# FIXME Replace the following, when "if" for mysqltest is available
let $run= `SELECT @NO_REFRESH = 0`;
while ($run)
if ($run)
{
# Create some objects needed in many testcases
USE test;
--source suite/funcs_1/include/memory_tb3.inc
let $run= 0;
}
--source suite/funcs_1/triggers/triggers_08.inc
......
......@@ -16,16 +16,12 @@ let $engine_type= memory;
eval SET @NO_REFRESH = IF( '$NO_REFRESH' = '', 0, 1);
# FIXME Replace the following, when "if" for mysqltest is available
let $run= `SELECT @NO_REFRESH = 0`;
while ($run)
if ($run)
{
# Create some objects needed in many testcases
USE test;
--source suite/funcs_1/include/memory_tb3.inc
let $run= 0;
}
--source suite/funcs_1/triggers/triggers_09.inc
......
......@@ -16,16 +16,12 @@ let $engine_type= memory;
eval SET @NO_REFRESH = IF( '$NO_REFRESH' = '', 0, 1);
# FIXME Replace the following, when "if" for mysqltest is available
let $run= `SELECT @NO_REFRESH = 0`;
while ($run)
if ($run)
{
# Create some objects needed in many testcases
USE test;
--source suite/funcs_1/include/memory_tb3.inc
let $run= 0;
}
--source suite/funcs_1/triggers/triggers_1011ext.inc
......
......@@ -19,7 +19,6 @@ eval SET @NO_REFRESH = IF( '$NO_REFRESH' = '', 0, 1);
let $run= `SELECT @NO_REFRESH = 0`;
if ($run)
{
# Create some objects needed in many testcases
USE test;
--source suite/funcs_1/include/memory_tb2.inc
......@@ -30,7 +29,6 @@ if ($run)
USE test1;
--source suite/funcs_1/include/memory_tb2.inc
USE test;
}
--source suite/funcs_1/views/views_master.inc
......
......@@ -16,11 +16,9 @@ let $engine_type= myisam;
eval SET @NO_REFRESH = IF( '$NO_REFRESH' = '', 0, 1);
# FIXME Replace the following, when "if" for mysqltest is available
let $run= `SELECT @NO_REFRESH`;
while ($run)
if ($run)
{
# Create some objects needed in many testcases
USE test;
--source suite/funcs_1/include/myisam_tb1.inc
......@@ -39,7 +37,5 @@ while ($run)
# These tables are needed for the stored procedure testscases
--source suite/funcs_1/include/sp_tb.inc
let $run= 0;
}
......@@ -16,17 +16,14 @@ let $engine_type= myisam;
eval SET @NO_REFRESH = IF( '$NO_REFRESH' = '', 0, 1);
# FIXME Replace the following, when "if" for mysqltest is available
let $run= `SELECT @NO_REFRESH = 0`;
while ($run)
if ($run)
{
# Create some objects needed in many testcases
USE test;
--source suite/funcs_1/include/myisam_tb4.inc
let $run= 0;
}
--source suite/funcs_1/bitdata/bitdata_master.test
......@@ -16,9 +16,8 @@ let $engine_type= myisam;
eval SET @NO_REFRESH = IF( '$NO_REFRESH' = '', 0, 1);
# FIXME Replace the following, when "if" for mysqltest is available
let $run= `SELECT @NO_REFRESH = 0`;
while ($run)
if ($run)
{
# Create some objects needed in many testcases
......
......@@ -3,4 +3,6 @@
let $engine_type= myisam;
--source suite/funcs_1/storedproc/load_sp_tb.inc
--source suite/funcs_1/storedproc/storedproc_master.inc
......@@ -16,16 +16,12 @@ let $engine_type= myisam;
eval SET @NO_REFRESH = IF( '$NO_REFRESH' = '', 0, 1);
# FIXME Replace the following, when "if" for mysqltest is available
let $run= `SELECT @NO_REFRESH = 0`;
while ($run)
if ($run)
{
# Create some objects needed in many testcases
USE test;
--source suite/funcs_1/include/myisam_tb3.inc
let $run= 0;
}
--source suite/funcs_1/triggers/triggers_0102.inc
......
......@@ -16,17 +16,14 @@ let $engine_type= myisam;
eval SET @NO_REFRESH = IF( '$NO_REFRESH' = '', 0, 1);
# FIXME Replace the following, when "if" for mysqltest is available
let $run= `SELECT @NO_REFRESH = 0`;
while ($run)
if ($run)
{
# Create some objects needed in many testcases
USE test;
--source suite/funcs_1/include/myisam_tb3.inc
let $run= 0;
}
--source suite/funcs_1/triggers/triggers_03.inc
......@@ -16,14 +16,11 @@ let $engine_type= myisam;
eval SET @NO_REFRESH = IF( '$NO_REFRESH' = '', 0, 1);
# FIXME Replace the following, when "if" for mysqltest is available
let $run= `SELECT @NO_REFRESH = 0`;
while ($run)
if ($run)
{
# Create some objects needed in many testcases
USE test;
let $run= 0;
}
--source suite/funcs_1/triggers/triggers_03e_db_level.inc
......
......@@ -16,17 +16,14 @@ let $engine_type= myisam;
eval SET @NO_REFRESH = IF( '$NO_REFRESH' = '', 0, 1);
# FIXME Replace the following, when "if" for mysqltest is available
let $run= `SELECT @NO_REFRESH = 0`;
while ($run)
if ($run)
{
# Create some objects needed in many testcases
USE test;
--source suite/funcs_1/include/myisam_tb3.inc
let $run= 0;
}
--source suite/funcs_1/triggers/triggers_0407.inc
......@@ -16,17 +16,14 @@ let $engine_type= myisam;
eval SET @NO_REFRESH = IF( '$NO_REFRESH' = '', 0, 1);
# FIXME Replace the following, when "if" for mysqltest is available
let $run= `SELECT @NO_REFRESH = 0`;
while ($run)
if($run)
{
# Create some objects needed in many testcases
USE test;
--source suite/funcs_1/include/myisam_tb3.inc
let $run= 0;
}
--source suite/funcs_1/triggers/triggers_08.inc
......@@ -16,17 +16,14 @@ let $engine_type= myisam;
eval SET @NO_REFRESH = IF( '$NO_REFRESH' = '', 0, 1);
# FIXME Replace the following, when "if" for mysqltest is available
let $run= `SELECT @NO_REFRESH = 0`;
while ($run)
if ($run)
{
# Create some objects needed in many testcases
USE test;
--source suite/funcs_1/include/myisam_tb3.inc
let $run= 0;
}
--source suite/funcs_1/triggers/triggers_09.inc
......@@ -16,17 +16,14 @@ let $engine_type= myisam;
eval SET @NO_REFRESH = IF( '$NO_REFRESH' = '', 0, 1);
# FIXME Replace the following, when "if" for mysqltest is available
let $run= `SELECT @NO_REFRESH = 0`;
while ($run)
if ($run)
{
# Create some objects needed in many testcases
USE test;
--source suite/funcs_1/include/myisam_tb3.inc
let $run= 0;
}
--source suite/funcs_1/triggers/triggers_1011ext.inc
......@@ -19,7 +19,6 @@ eval SET @NO_REFRESH = IF( '$NO_REFRESH' = '', 0, 1);
let $run= `SELECT @NO_REFRESH = 0`;
if ($run)
{
# Create some objects needed in many testcases
USE test;
--source suite/funcs_1/include/myisam_tb2.inc
......@@ -30,7 +29,6 @@ if ($run)
USE test1;
--source suite/funcs_1/include/myisam_tb2.inc
USE test;
}
let $message= Attention: The nesting level @max_level in Testcase 3.3.1.A6
......@@ -47,3 +45,4 @@ if ($run)
DROP DATABASE IF EXISTS test1;
}
......@@ -18,11 +18,9 @@ let $engine_type= ndb;
eval SET @NO_REFRESH = IF( '$NO_REFRESH' = '', 0, 1);
# FIXME Replace the following, when "if" for mysqltest is available
let $run= `SELECT @NO_REFRESH`;
while ($run)
if ($run)
{
# Create some objects needed in many testcases
USE test;
--source suite/funcs_1/include/ndb_tb1.inc
......@@ -41,7 +39,5 @@ while ($run)
# These tables are needed for the stored procedure testscases
--source suite/funcs_1/include/sp_tb.inc
let $run= 0;
}
#### suite/funcs_1/t/ndb_bitdata.test
# InnoDB tables should be used
# NDB tables should be used
#
# 1. Check if InnoDB is available
--source include/have_ndb.inc
......@@ -18,16 +18,12 @@ let $engine_type= ndb;
eval SET @NO_REFRESH = IF( '$NO_REFRESH' = '', 0, 1);
# FIXME Replace the following, when "if" for mysqltest is available
let $run= `SELECT @NO_REFRESH = 0`;
while ($run)
if ($run)
{
# Create some objects needed in many testcases
USE test;
--source suite/funcs_1/include/ndb_tb4.inc
let $run= 0;
}
--source suite/funcs_1/bitdata/bitdata_master.test
......
#### suite/funcs_1/t/ndb_cursors.test
# Innodb tables should be used
# NDB tables should be used
#
# 1. Check if ndb is available
--source include/have_ndb.inc
......@@ -18,16 +18,12 @@ let $engine_type= ndb;
eval SET @NO_REFRESH = IF( '$NO_REFRESH' = '', 0, 1);
# FIXME Replace the following, when "if" for mysqltest is available
let $run= `SELECT @NO_REFRESH = 0`;
while ($run)
if ($run)
{
# Create some objects needed in many testcases
USE test;
--source suite/funcs_1/include/ndb_tb1.inc
let $run= 0;
}
--source suite/funcs_1/cursors/cursors_master.test
......
#### suite/funcs_1/t/ndb_storedproc.test
#
--source include/have_ndb.inc
let $engine_type= ndb;
--source suite/funcs_1/storedproc/load_sp_tb.inc
--source suite/funcs_1/storedproc/storedproc_master.inc
......@@ -18,16 +18,12 @@ let $engine_type= ndb;
eval SET @NO_REFRESH = IF( '$NO_REFRESH' = '', 0, 1);
# FIXME Replace the following, when "if" for mysqltest is available
let $run= `SELECT @NO_REFRESH = 0`;
while ($run)
if ($run)
{
# Create some objects needed in many testcases
USE test;
--source suite/funcs_1/include/ndb_tb3.inc
let $run= 0;
}
--source suite/funcs_1/triggers/triggers_0102.inc
......
#### suite/funcs_1/t/ndb_triggers.test
# InnoDB tables should be used
# NDB tables should be used
#
# 1. Check if NDB is available
--source include/have_ndb.inc
......@@ -18,16 +18,12 @@ let $engine_type= ndb;
eval SET @NO_REFRESH = IF( '$NO_REFRESH' = '', 0, 1);
# FIXME Replace the following, when "if" for mysqltest is available
let $run= `SELECT @NO_REFRESH = 0`;
while ($run)
if ($run)
{
# Create some objects needed in many testcases
USE test;
--source suite/funcs_1/include/ndb_tb3.inc
let $run= 0;
}
--source suite/funcs_1/triggers/triggers_03.inc
......
#### suite/funcs_1/t/ndb_triggers.test
# InnoDB tables should be used
# NDB tables should be used
#
# 1. Check if NDB is available
--source include/have_ndb.inc
......@@ -18,14 +18,11 @@ let $engine_type= ndb;
eval SET @NO_REFRESH = IF( '$NO_REFRESH' = '', 0, 1);
# FIXME Replace the following, when "if" for mysqltest is available
let $run= `SELECT @NO_REFRESH = 0`;
while ($run)
if ($run)
{
# Create some objects needed in many testcases
USE test;
let $run= 0;
}
--source suite/funcs_1/triggers/triggers_03e_db_level.inc
......
......@@ -18,16 +18,12 @@ let $engine_type= ndb;
eval SET @NO_REFRESH = IF( '$NO_REFRESH' = '', 0, 1);
# FIXME Replace the following, when "if" for mysqltest is available
let $run= `SELECT @NO_REFRESH = 0`;
while ($run)
if ($run)
{
# Create some objects needed in many testcases
USE test;
--source suite/funcs_1/include/ndb_tb3.inc
let $run= 0;
}
--source suite/funcs_1/triggers/triggers_0407.inc
......
......@@ -18,16 +18,12 @@ let $engine_type= ndb;
eval SET @NO_REFRESH = IF( '$NO_REFRESH' = '', 0, 1);
# FIXME Replace the following, when "if" for mysqltest is available
let $run= `SELECT @NO_REFRESH = 0`;
while ($run)
if ($run)
{
# Create some objects needed in many testcases
USE test;
--source suite/funcs_1/include/ndb_tb3.inc
let $run= 0;
}
--source suite/funcs_1/triggers/triggers_08.inc
......
......@@ -18,16 +18,12 @@ let $engine_type= ndb;
eval SET @NO_REFRESH = IF( '$NO_REFRESH' = '', 0, 1);
# FIXME Replace the following, when "if" for mysqltest is available
let $run= `SELECT @NO_REFRESH = 0`;
while ($run)
if ($run)
{
# Create some objects needed in many testcases
USE test;
--source suite/funcs_1/include/ndb_tb3.inc
let $run= 0;
}
--source suite/funcs_1/triggers/triggers_09.inc
......
......@@ -18,16 +18,12 @@ let $engine_type= ndb;
eval SET @NO_REFRESH = IF( '$NO_REFRESH' = '', 0, 1);
# FIXME Replace the following, when "if" for mysqltest is available
let $run= `SELECT @NO_REFRESH = 0`;
while ($run)
if ($run)
{
# Create some objects needed in many testcases
USE test;
--source suite/funcs_1/include/ndb_tb3.inc
let $run= 0;
}
--source suite/funcs_1/triggers/triggers_1011ext.inc
......
......@@ -21,7 +21,6 @@ eval SET @NO_REFRESH = IF( '$NO_REFRESH' = '', 0, 1);
let $run= `SELECT @NO_REFRESH = 0`;
if ($run)
{
# Create some objects needed in many testcases
USE test;
--source suite/funcs_1/include/ndb_tb2.inc
......@@ -32,7 +31,6 @@ if ($run)
USE test1;
--source suite/funcs_1/include/ndb_tb2.inc
USE test;
}
--source suite/funcs_1/views/views_master.inc
......
......@@ -3,6 +3,7 @@
# Trigger Tests
# (test case numbering refer to requirement document TP v1.1)
#======================================================================
# WL#4084: enable disabled parts. 2007-11-15, hhunger
--disable_abort_on_error
......@@ -157,16 +158,13 @@ let $message=Testcase 3.5.3.7a:;
show grants;
select f1 from t1 order by f1;
let $message= Trigger create disabled - should fail - Bug 8884;
--source include/show_msg.inc
# --error 1227
# create trigger trg4a_1 before INSERT on t1 for each row
# set new.f1 = 'trig 3.5.3.7-1a';
create trigger trg4a_1 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-1a';
connection default;
--error ER_COLUMNACCESS_DENIED_ERROR
insert into t1 (f1) values ('insert 3.5.3.7-1a');
select f1 from t1 order by f1;
--error 0, 1360
drop trigger trg4a_1;
connection yes_privs_424a;
......@@ -213,18 +211,14 @@ let $message= Testcase 3.5.3.7b:;
show grants;
use priv_db;
let $message= Trigger create disabled - should fail - Bug 8884;
--source include/show_msg.inc
# --error 1227
# create trigger trg4b_1 before UPDATE on t1 for each row
# set new.f1 = 'trig 3.5.3.7-1b';
create trigger trg4b_1 before UPDATE on t1 for each row
set new.f1 = 'trig 3.5.3.7-1b';
connection default;
insert into t1 (f1) values ('insert 3.5.3.7-1b');
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 order by f1;
--error 0, 1360
drop trigger trg4b_1;
connection yes_privs_424b;
......@@ -271,16 +265,12 @@ let $message= Testcase 3.5.3.7c;
show grants;
use priv_db;
let $message= Trigger create disabled - should fail - Bug 8884;
--source include/show_msg.inc
# --error 1227
# create trigger trg4c_1 before INSERT on t1 for each row
# set new.f1 = 'trig 3.5.3.7-1c';
create trigger trg4c_1 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-1c';
connection default;
insert into t1 (f1) values ('insert 3.5.3.7-1c');
select f1 from t1 order by f1;
--error 0, 1360
drop trigger trg4c_1;
connection yes_privs_424c;
......@@ -327,16 +317,12 @@ let $message= Testcase 3.5.3.7d:;
connection no_privs_424d;
show grants;
use priv_db;
let $message= Trigger create disabled - should fail - Bug 8884;
--source include/show_msg.inc
# --error 1227
# create trigger trg4d_1 before INSERT on t1 for each row
# set new.f1 = 'trig 3.5.3.7-1d';
create trigger trg4d_1 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-1d';
connection default;
insert into t1 (f1) values ('insert 3.5.3.7-1d');
select f1 from t1 order by f1;
--error 0, 1360
drop trigger trg4d_1;
connection yes_privs_424d;
......@@ -386,18 +372,14 @@ let $message= Testcase 3.5.3.8a:;
use priv_db;
show grants;
let $message= Trigger create disabled - should fail - Bug 8887;
--source include/show_msg.inc
# --error 1227
# create trigger trg5a_1 before INSERT on t1 for each row
# set @test_var = new.f1;
create trigger trg5a_1 before INSERT on t1 for each row
set @test_var = new.f1;
connection default;
set @test_var = 'before trig 3.5.3.8-1a';
select @test_var;
insert into t1 (f1) values ('insert 3.5.3.8-1a');
select @test_var;
--error 0, 1360
drop trigger trg5a_1;
connection yes_privs_425a;
......@@ -446,11 +428,8 @@ let $message= Testcase: 3.5.3.8b;
show grants;
use priv_db;
let $message= Trigger create disabled - should fail - Bug 8887;
--source include/show_msg.inc
# --error 1227
# create trigger trg5b_1 before UPDATE on t1 for each row
# set @test_var= new.f1;
create trigger trg5b_1 before UPDATE on t1 for each row
set @test_var= new.f1;
connection default;
set @test_var= 'before trig 3.5.3.8-1b';
......@@ -458,7 +437,6 @@ let $message= Trigger create disabled - should fail - Bug 8887;
select @test_var;
update t1 set f1= 'update 3.5.3.8-1b' where f1 = 'insert 3.5.3.8-1b';
select @test_var;
--error 0, 1360
drop trigger trg5b_1;
connection yes_privs_425b;
......@@ -506,17 +484,13 @@ let $message= Testcase 3.5.3.8c:;
show grants;
use priv_db;
let $message= Trigger create disabled - should fail - Bug 8887;
--source include/show_msg.inc
# --error 1227
# create trigger trg5c_1 before INSERT on t1 for each row
# set @test_var= new.f1;
create trigger trg5c_1 before INSERT on t1 for each row
set @test_var= new.f1;
connection default;
set @test_var= 'before trig 3.5.3.8-1c';
insert into t1 (f1) values ('insert 3.5.3.8-1c');
select @test_var;
--error 0, 1360
drop trigger trg5c_1;
connection yes_privs_425c;
......@@ -561,17 +535,13 @@ let $message=Testcase: 3.5.3.8d:;
connection no_privs_425d;
show grants;
use priv_db;
let $message= Trigger create disabled - should fail - Bug 8887;
--source include/show_msg.inc
# --error 1227
# create trigger trg5d_1 before INSERT on t1 for each row
# set @test_var= new.f1;
create trigger trg5d_1 before INSERT on t1 for each row
set @test_var= new.f1;
connection default;
set @test_var='before trig 3.5.3.8-1d';
insert into t1 (f1) values ('insert 3.5.3.8-1d');
select @test_var;
--error 0, 1360
drop trigger trg5d_1;
connection yes_privs_425d;
......@@ -591,8 +561,7 @@ let $message= Trigger create disabled - should fail - Bug 8887;
drop trigger trg5d_2;
--enable_warnings
# --- 3.5.3.x - additional tests following the fix to bug 5861 / WL 2818
# to test for trigger definer privs in the case of trigger
# --- 3.5.3.x to test for trigger definer privs in the case of trigger
# actions (insert/update/delete/select) performed on other
# tables.
let $message=Testcase: 3.5.3.x:;
......
......@@ -3,6 +3,7 @@
# Trigger Tests
# (test case numbering refer to requirement document TP v1.1)
#======================================================================
# WL#4084: enable disabled parts, 2007-11-15 hhunger
# General setup for Trigger tests
let $message= Testcase: 3.5:;
......@@ -34,8 +35,6 @@ let $message= Testcase: 3.5:;
let $message= Testcase 3.5.8.1: (implied in previous tests);
--source include/show_msg.inc
# OBN - FIXME - Missing 3.5.8.1 need to add
#Section 3.5.8.2
# Testcase: Ensure that the triggered actions of every trigger never results
# in an unexpected change made to the database.
......@@ -111,10 +110,12 @@ let $message= 3.5.8.4 - multiple SQL;
Insert into tb3 (f120, f122, f136, f144, f163)
values ('1', 'Test 3.5.8.4', 222, 23456, 1.05);
Select f120, f122, f136, f144, f163 from tb3 where f122= 'Test 3.5.8.4';
# error in ndb
select * from db_test.t1_i order by i120;
select * from db_test.t1_u order by u120;
select * from db_test.t1_d order by d120;
--sorted_result
select * from db_test.t1_i;
--sorted_result
select * from db_test.t1_u;
--sorted_result
select * from db_test.t1_d;
select @test_var;
......@@ -320,28 +321,28 @@ let $message= Testcase 3.5.8.5-case:;
Insert into tb3 (f120, f122, f136, f144)
values ('a', 'Test 3.5.8.5-case', 5, 7);
select f120, f122, f136, f144, @test_var
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120,f136;
Insert into tb3 (f120, f122, f136, f144)
values ('b', 'Test 3.5.8.5-case', 71,16);
select f120, f122, f136, f144, @test_var
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120,f136;
Insert into tb3 (f120, f122, f136, f144)
values ('c', 'Test 3.5.8.5-case', 80,1);
select f120, f122, f136, f144, @test_var
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120,f136;
Insert into tb3 (f120, f122, f136)
values ('d', 'Test 3.5.8.5-case', 152);
select f120, f122, f136, f144, @test_var
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120,f136;
Insert into tb3 (f120, f122, f136, f144)
values ('e', 'Test 3.5.8.5-case', 200, 8);
select f120, f122, f136, f144, @test_var
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120,f136;
--error 0, 1339
Insert into tb3 (f120, f122, f136, f144)
values ('f', 'Test 3.5.8.5-case', 100, 8);
select f120, f122, f136, f144, @test_var
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120,f136;
delimiter //;
--error 1064
......@@ -495,12 +496,25 @@ let $message= Testcase 3.5.8.5-while:;
#Section 3.5.8.6
# Test case: Ensure that a trigger definition that includes a CALL to a stored
# procedure fails, at CREATE TRIGGER time, with an appropriate error
# message
# OBN - requirement void since allowed
# Fails due to Bug 9909 the bug allows the trigger to be created
# and fails in execution time
# message. Not more valid requirement.
let $message= Testcase 3.5.8.6: (requirement void);
--source include/show_msg.inc
delimiter //;
CREATE PROCEDURE sp_01 () BEGIN set @v1=1; END//
CREATE TRIGGER trg8_1 BEFORE UPDATE ON tb3 FOR EACH ROW
BEGIN
CALL sp_01 ();
END//
delimiter ;//
Insert into tb3 (f120, f122, f136) values ('6', 'Test 3.5.8.6-insert', 101);
update tb3 set f120='S', f136=111,
f122='Test 3.5.8.6-tr8_1'
where f122='Test 3.5.8.6-insert';
select f120, f122
from tb3 where f122 like 'Test 3.5.8.6%' order by f120;
DROP TRIGGER trg8_1;
DROP PROCEDURE sp_01;
#Section 3.5.8.7
......@@ -508,25 +522,26 @@ let $message= Testcase 3.5.8.6: (requirement void);
# transaction-delimiting statement (e.g. COMMIT,
# ROLLBACK, START TRANSACTION) fails, at CREATE TRIGGER
# time, with an appropriate error message.
# OBN - Fails due to Bug ____
let $message= Testcase 3.5.8.7: (Disabled as a result of bug _____);
let $message= Testcase 3.5.8.7;
--source include/show_msg.inc
delimiter //;
--error ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG
Create trigger trg9_1 before update on tb3 for each row
BEGIN
Start transaction;
Set new.f120='U';
Commit;
END//
# --error 1314
# Create trigger trg9_1 before update on tb3 for each row
# BEGIN
# Start transaction;
# Set new.f120='U';
# Commit;
# END;
# --error 1314
# Create trigger trg9_2 before delete on tb3 for each row
# BEGIN
# Start transaction;
# Set @var2=old.f120;
# Rollback;
# END;
--error ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG
Create trigger trg9_2 before delete on tb3 for each row
BEGIN
Start transaction;
Set @var2=old.f120;
Rollback;
END//
delimiter ;//
# Cleanup section 3.5
......
......@@ -3,6 +3,7 @@
# Trigger Tests
# (test case numbering refer to requirement document TP v1.1)
#======================================================================
# WL#4084: enable disabled parts, 2007-11-15, hhunger
--disable_abort_on_error
......@@ -271,8 +272,8 @@ let $message= Testcase y.y.y.3: Circular trigger reference;
create trigger tr4 after insert on t4
for each row insert into t1 (f1) values (new.f4+1);
# OBN See bug 11896
--error 1442
# Bug#11896 Partial locking in case of recursive trigger definittions
--error ER_CANT_UPDATE_USED_TABLE_IN_SF_OR_TRG
insert into t1 values (1);
select * from t1 order by f1;
select * from t2 order by f2;
......@@ -294,7 +295,7 @@ let $message= Testcase y.y.y.3: Circular trigger reference;
#Section y.y.y.4
# Testcase: create recursive trigger/storedprocedures conditions
let $message= Testcase y.y.y.4: Recursive trigger/SP references (disabled bug 11889);
let $message= Testcase y.y.y.4: Recursive trigger/SP references;
--source include/show_msg.inc
set @sql_mode='traditional';
......
......@@ -5,10 +5,7 @@
###################################################
# 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;
--source include/show_msg80.inc
# 2007-11-09 HHunger enabled all disabled parts belonging to fixed bugs.
#
# 0. Some notes about this test:
# #################################################################
......@@ -43,14 +40,7 @@ Bug#10713: mysqldump includes database in create view and referenced tables;
# which was valid during VIEW creation time. This means some variations
# of the SQL mode are needed.
# 0.1.3 There are much more functions to be tested.
# 0.1.4 There are problems with the option "--ps-protocol".
# Double values with 15 digit mantissa are printed with 14 digit
# mantissa (Bug#11589).
# I altered the Minimum/Maximum double values to 14 digit mantissa
# to avoid these problems. But there are some other unsolved problems
# with "--ps-protocol".
--disable_ps_protocol
# 0.1.5 The result sets of some CAST sub testcases with ugly function parameter
# 0.1.4 The result sets of some CAST sub testcases with ugly function parameter
# column data type combinations must be discussed.
#
#
......@@ -256,11 +246,9 @@ INSERT INTO t1_values SET
my_year = '1901',
my_bigint = -9223372036854775808,
my_decimal = -9999999999999999999999999999999999.999999999999999999999999999999 ,
my_double = -1.7976931348623E+308;
# Note(ML): Values like
# - my_timestamp = '19700101030000' do not work
# - my_double = -1.7976931348623157E+308 cause problems with
# --ps-protocol (Bug#11589)
my_double = -1.7976931348623E+308;
# shortened due to bug#32285
# my_double = -1.7976931348623157E+308;
#
# 2.3 record -- everything to "maximum"
# numbers, date/time types -> maximum of range
......@@ -281,10 +269,8 @@ INSERT INTO t1_values SET
my_bigint = 9223372036854775807,
my_decimal = +9999999999999999999999999999999999.999999999999999999999999999999 ,
my_double = 1.7976931348623E+308;
# Note(ML): Values like
# - my_timestamp = '20380101030000' do not work
# - my_double = 1.7976931348623157E+308 cause problems with
# --ps-protocol (Bug#11589)
# shortened due to bug#32285
# my_double = -1.7976931348623157E+308;
#
# 2.4 record -- everything to "magic" value if available or
# other interesting value
......@@ -430,6 +416,7 @@ eval INSERT INTO t1_values SET select_id = @select_id,
#
#
# 1.1.1. CAST --> BINARY
--echo ##### 1.1.1. CAST --> BINARY
let $target_type= BINARY;
#
let $col_type= my_char_30;
......@@ -459,6 +446,7 @@ let $col_type= my_year;
# 1.1.2. CAST --> CHAR
--echo ##### 1.1.2. CAST --> CHAR
let $target_type= CHAR;
#
let $col_type= my_char_30;
......@@ -488,6 +476,7 @@ let $col_type= my_year;
# 1.1.3. CAST --> DATE
--echo ##### 1.1.3. CAST --> DATE
let $target_type= DATE;
#
let $col_type= my_char_30;
......@@ -527,6 +516,7 @@ let $col_type= my_year;
# 1.1.4. CAST --> DATETIME
--echo ##### 1.1.4. CAST --> DATETIME
let $target_type= DATETIME;
#
let $col_type= my_char_30;
......@@ -566,6 +556,7 @@ let $col_type= my_year;
# 1.1.5. CAST --> TIME
--echo ##### 1.1.5. CAST --> TIME
let $target_type= TIME;
#
let $col_type= my_char_30;
......@@ -604,8 +595,8 @@ let $col_type= my_time;
let $col_type= my_year;
--source suite/funcs_1/views/fv_cast.inc
# 1.1.6. CAST --> DECIMAL
--echo ##### 1.1.6. CAST --> DECIMAL
# Set the following to (37,2) since the default was changed to (10,0) - OBN
let $target_type= DECIMAL(37,2);
#
......@@ -647,6 +638,7 @@ let $col_type= my_year;
# 1.1.7. CAST --> SIGNED INTEGER
--echo ##### 1.1.7. CAST --> SIGNED INTEGER
let $target_type= SIGNED INTEGER;
#
let $message=
......@@ -682,6 +674,7 @@ let $col_type= my_year;
# 1.1.8. CAST --> UNSIGNED INTEGER
--echo ##### 1.1.8. CAST --> UNSIGNED INTEGER
let $target_type= UNSIGNED INTEGER;
#
let $message=
......@@ -703,12 +696,9 @@ let $col_type= my_decimal;
let $message= some statements disabled because of
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
# Bug#8663 cant use bgint unsigned as input to cast
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;
......@@ -1008,38 +998,21 @@ let $col_type= my_varbinary_1000;
eval SET @my_select =
'SELECT LEFT($col_type, 2), $col_type, id FROM t1_values';
--source suite/funcs_1/views/fv1.inc
#
let $message=
"Attention: LEFT(''AaBbCcDdEeFfGgHhIiJjÄäÜüÖö'', <numeric column>)
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
# Bug#11728 string function LEFT, strange undocumented behaviour, strict mode
# Bug#10963 LEFT string function returns wrong result with large length
let $col_type= my_bigint;
if (0)
{
# Bug#10963 LEFT string function returns wrong result with large length
eval SET @my_select =
'SELECT LEFT(''AaBbCcDdEeFfGgHhIiJjÄäÜüÖö'', $col_type), $col_type, id FROM t1_values';
--source suite/funcs_1/views/fv1.inc
}
#
let $col_type= my_decimal;
eval SET @my_select =
'SELECT LEFT(''AaBbCcDdEeFfGgHhIiJjÄäÜüÖö'', $col_type), $col_type, id FROM t1_values';
--source suite/funcs_1/views/fv1.inc
#
if (0)
{
# Bug#10963 LEFT string function returns wrong result with large length
let $col_type= my_double;
eval SET @my_select =
'SELECT LEFT(''AaBbCcDdEeFfGgHhIiJjÄäÜüÖö'', $col_type), $col_type, id FROM t1_values';
--source suite/funcs_1/views/fv1.inc
}
# 3.20. LENGTH(str)
let $col_type= my_char_30;
......@@ -1260,6 +1233,7 @@ SET sql_mode = ''; #
let $message= "# The basic preparations end and the main test starts here";
--source include/show_msg80.inc
--disable_ps_protocol
##### The tests start here #####################################################
......@@ -1370,5 +1344,7 @@ while ($select_id)
dec $select_id ;
}
--enable_ps_protocol
DROP TABLE t1_selects, t1_modes, t1_values;
--exec rm $MYSQLTEST_VARDIR/tmp/func_view.dat
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment