Commit 68eb3c94 authored by unknown's avatar unknown

WL#4084: Code changes due to enabled the disabled tests (including other improvements).


BitKeeper/etc/ignore:
  Added mysql-test/funcs_1.log to the ignore list
parent 7b26e777
......@@ -3012,3 +3012,4 @@ win/vs8cache.txt
ylwrap
zlib/*.ds?
zlib/*.vcproj
mysql-test/funcs_1.log
This source diff could not be displayed because it is too large. You can view the blob instead.
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.
This source diff could not be displayed because it is too large. You can view the blob instead.
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.
This source diff could not be displayed because it is too large. You can view the blob instead.
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.
This source diff could not be displayed because it is too large. You can view the blob instead.
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 source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -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;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -10,7 +10,4 @@
#
##############################################################################
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)
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
# --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;
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 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.
#
#
......@@ -257,10 +247,8 @@ INSERT INTO t1_values SET
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)
# 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
......@@ -4,6 +4,7 @@
# 2007-10-05 mleich
# 1. Fix for Bug#31237 Test "ndb_views" fails because of differing order ...
# 2. Cleanup of test
# 2007-11-15 hhunger WL#4084: Review and fix all disabled tests ...
let $message= ! Attention: The file with the expected results is not
| thoroughly checked.
......@@ -13,25 +14,20 @@ let $message= ! Attention: The file with the expected results is not
--source include/show_msg80.inc
# As long as
# Bug#11589: mysqltest, --ps-protocol, strange output, float/double/real with zerofill
# is not fixed, we must switch the ps-protocol for some statements off.
# Bug#32285: mysqltest, --ps-protocol, strange output, float/double/real with zerofill
# is not fixed, we must switch the ps-protocol for some statements off (formerly bug#11589).
# If this bug is fixed, please
# 1. set the following variable to 0
# 2. check, if the test passes
# 3. remove the workarounds
let $have_bug_11589= 1;
if ($have_bug_11589)
let $have_bug_32285= 1;
if ($have_bug_32285)
{
let $message= There are some statements where the ps-protocol is switched off.
Bug#11589: mysqltest, --ps-protocol, strange output, float/double/real with zerofill;
Bug#32285: mysqltest, --ps-protocol, strange output, float/double/real with zerofill;
--source include/show_msg80.inc
}
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
# The sub testcases are nearly independend. That is the reason why
# we do not want to abort after the first error.
--disable_abort_on_error
......@@ -112,7 +108,7 @@ insert into tb2 (f59,f60,f61) values (109,108,104);
INSERT INTO tb2 (f59,f60) VALUES( 299,899 );
INSERT INTO tb2 (f59,f60) VALUES( 242,79 );
INSERT INTO tb2 (f59,f60) VALUES( 424,89 );
if ($have_bug_11589)
if ($have_bug_32285)
{
--disable_ps_protocol
}
......@@ -225,10 +221,11 @@ Insert into t1 values (500,9866);
select * FROM v1 order by f59 limit 0,10;
#(15)
if ($have_bug_11589)
if ($have_bug_32285)
{
--disable_ps_protocol
}
--vertical_results
CREATE or REPLACE VIEW v1 AS select *
FROM test.tb2 WITH LOCAL CHECK OPTION ;
select * FROM v1 order by f59,f60,f61,f62,f63,f64 limit 0,50;
......@@ -237,6 +234,7 @@ if ($have_bug_11589)
CREATE or REPLACE VIEW v1 AS select *
FROM test.tb2 WITH CASCADED CHECK OPTION ;
select * FROM v1 order by f59,f60,f61,f62,f63,f64 limit 0,10;
--horizontal_results
--enable_ps_protocol
#(17)
......@@ -814,11 +812,13 @@ CREATE TABLE t1 (f1 BIGINT);
INSERT INTO t1 VALUES(1);
CREATE VIEW test.v1 AS SELECT * FROM t1 limit 2;
SHOW CREATE VIEW test.v1;
--sorted_result
SELECT * FROM test.v1;
# Switch the algorithm
CREATE OR REPLACE ALGORITHM = TEMPTABLE VIEW test.v1
AS SELECT * FROM t1 limit 2;
SHOW CREATE VIEW test.v1;
--sorted_result
SELECT * FROM test.v1;
# Switch the base table
CREATE OR REPLACE VIEW test.v1 AS SELECT * FROM tb2 order by f59 limit 2;
......@@ -827,7 +827,9 @@ if ($have_bug_11589)
{
--disable_ps_protocol
}
--vertical_results
SELECT * FROM test.v1 order by f59,f60,f61,f62,f63,f64,f65;
--horizontal_results
--enable_ps_protocol
# Switch the SELECT but not the base table
CREATE OR REPLACE VIEW test.v1 AS SELECT F59 FROM tb2;
......@@ -862,11 +864,12 @@ let $message= Testcase 3.3.1.15 ;
Drop table if exists test.v1 ;
--enable_warnings
CREATE OR REPLACE view test.v1 as select * from tb2;
if ($have_bug_11589)
if ($have_bug_32285)
{
--disable_ps_protocol
}
SELECT * FROM test.v1 ORDER BY f59,f60,f61 LIMIT 2;
--sorted_result
SELECT * FROM test.v1;
--enable_ps_protocol
Drop view test.v1 ;
......@@ -1039,12 +1042,15 @@ let $message= Testcase 3.3.1.22 ;
--disable_warnings
DROP VIEW IF EXISTS v1;
--enable_warnings
CREATE VIEW test.v1( product ) AS SELECT f59*f60 From tb2;
SELECT * FROM test.v1 WHERE product IS NOT NULL ORDER BY product LIMIT 2;
CREATE VIEW test.v1( product ) AS SELECT f59*f60 From tb2 WHERE f59 < 3;
--sorted_result
SELECT * FROM test.v1;
CREATE OR REPLACE VIEW test.v1( product ) AS SELECT 1*2;
SELECT * FROM test.v1 LIMIT 2;
--sorted_result
SELECT * FROM test.v1;
CREATE OR REPLACE VIEW test.v1( product ) AS SELECT USER();
SELECT * FROM test.v1 LIMIT 2;
--sorted_result
SELECT * FROM test.v1;
Drop view if exists test.v1 ;
......@@ -1163,7 +1169,8 @@ if ($have_bug_11589)
{
--disable_ps_protocol
}
Select * from test.v1 order by f59, f60, f61 limit 2;
--sorted_result
Select * from test.v1;
--enable_ps_protocol
Drop view test.v1 ;
......@@ -1198,12 +1205,15 @@ create database test2 ;
Create view test2.v2 AS Select * from test.tb2 limit 50,50;
use test2 ;
Create view v1 AS Select * from test.tb2 limit 50 ;
if ($have_bug_11589)
if ($have_bug_32285)
{
--disable_ps_protocol
}
--vertical_results
Select * from v1 order by f59,f60,f61,f62,f63,f64,f65;
--horizontal_results
--enable_ps_protocol
--sorted_result
Select * from test2.v2 ;
Drop view if exists test2.v1 ;
Drop view if exists test2.v2 ;
......@@ -1247,6 +1257,7 @@ INSERT INTO test.t1 VALUES( 445, 765 );
Create or replace view test.v1
AS SELECT test.t1.F59, test.tb2.F60
FROM test.tb2 JOIN test.t1 ON test.tb2.F59 = test.t1.F59 ;
--sorted_result
Select * from test.v1;
Drop view test.v1 ;
......@@ -1271,6 +1282,7 @@ INSERT INTO t1 VALUES( 445, 765 );
CREATE VIEW test2.v1
AS SELECT test.tb2.F59, test.tb2.F60
FROM test.tb2 INNER JOIN test2.t1 ON tb2.f59 = t1.f59;
--sorted_result
Select * from test2.v1;
Use test;
......@@ -1585,7 +1597,7 @@ let $message= Testcase 3.3.1.41 ;
###############################################################################
# Testcase 3.3.1.41: Ensure that a view definition within a stored procedure
# definition cannot include references to any of the stored
# procedures parameters.
# procedures parameters.
###############################################################################
--disable_warnings
Drop view if exists test.v1 ;
......@@ -1648,20 +1660,24 @@ CREATE VIEW test.v1 AS SELECT f59,f60 FROM test.tb2;
INSERT INTO test.v1 values(122,432);
if ($have_bug_11589)
if ($have_bug_32285)
{
--disable_ps_protocol
}
--vertical_results
SELECT * FROM test.tb2 where f59 = 122 and f60 = 432 limit 0,20;
--horizontal_results
--enable_ps_protocol
UPDATE test.v1 SET f59 = 3000 WHERE test.v1.f59 = 122 ;
if ($have_bug_11589)
if ($have_bug_32285)
{
--disable_ps_protocol
}
--vertical_results
SELECT * FROM test.tb2 where f59 = 3000 limit 0,20;
--horizontal_results
--enable_ps_protocol
DELETE FROM test.v1
......@@ -1712,21 +1728,25 @@ CREATE VIEW test.v1 AS SELECT * FROM test.tb2 where f59 = 04;
UPDATE test.v1 SET f59 = 30 where F59 = 04 ;
--disable_info
SELECT * FROM test.v1 where f59 = 30 order by f59;
if ($have_bug_11589)
if ($have_bug_32285)
{
--disable_ps_protocol
}
--vertical_results
SELECT * FROM test.tb2 where f59 = 30 ;
--horizontal_results
--enable_ps_protocol
--enable_info
UPDATE tb2 SET f59 = 100 where f59 = 30 ;
--disable_info
if ($have_bug_11589)
if ($have_bug_32285)
{
--disable_ps_protocol
}
--vertical_results
SELECT * FROM tb2 where f59 = 100 ;
--horizontal_results
--enable_ps_protocol
SELECT * FROM test.v1 order by f59 ;
......@@ -1984,10 +2004,10 @@ let $message= Testcase 3.3.1.49A ;
# The annoying redundant
# eval INSERT INTO t1_results VALUES (@v3_to_v1_options,@statement,
# @v3_to_v1_violation,$mysql_errno);
# could not be put into a file to be sourced because of
# could not be put into a file to be sourced because of the closed
# Bug#10267 mysqltest, wrong number of loops when a script is sourced
# within a loop
#
# To be implemented later.
USE test;
--disable_warnings
......@@ -2298,11 +2318,13 @@ DROP VIEW IF EXISTS test.v1;
# AS SELECT * FROM <table name>.
###############################################################################
CREATE VIEW test.v1 AS SELECT * FROM test.tb2;
if ($have_bug_11589)
if ($have_bug_32285)
{
--disable_ps_protocol
}
SELECT * FROM test.v1 order by f59 limit 5;
--vertical_results
SELECT * FROM test.v1 order by f59,f60,f61 ;
--horizontal_results
--enable_ps_protocol
drop view test.v1 ;
###############################################################################
......@@ -2327,7 +2349,9 @@ if ($have_bug_11589)
{
--disable_ps_protocol
}
SELECT * FROM test.v1 order by f59,f60,f61 limit 20;
--vertical_results
SELECT * FROM test.v1 order by f59,f60,f61 ;
--horizontal_results
--enable_ps_protocol
drop view test.v1 ;
###############################################################################
......@@ -2684,11 +2708,13 @@ SELECT * FROM test.v1 order by f59 limit 0,10;
ALTER VIEW test.v1 AS SELECT *
FROM test.tb2 WHERE test.tb2.f59 = 242 ;
if ($have_bug_11589)
if ($have_bug_32285)
{
--disable_ps_protocol
}
--vertical_results
SELECT * FROM test.v1 order by f59 limit 0,10;
--horizontal_results
--enable_ps_protocol
Drop view test.v1 ;
......@@ -3165,11 +3191,13 @@ Create view test.v1 AS SELECT f59,f60,f61 FROM tb2 ;
INSERT INTO test.v1 ( f59 , f60 ) values (2005,0101) ;
--disable_info
if ($have_bug_11589)
if ($have_bug_32285)
{
--disable_ps_protocol
}
--vertical_results
SELECT * FROM tb2 where f59 = 2005 and f60 = 0101 ;
--horizontal_results
--enable_ps_protocol
SELECT f59,f60 FROM test.v1 where f59 = 2005 and f60 = 0101 ;
DELETE FROM tb2 where f59 = 2005 and f60 = 0101 ;
......@@ -3194,11 +3222,13 @@ CREATE VIEW test.v1 AS SELECT f59,f60,f61 FROM tb2 ;
UPDATE test.v1 SET f59 = 8 WHERE f59 = 780 and f60 = 105;
--disable_info
if ($have_bug_11589)
if ($have_bug_32285)
{
--disable_ps_protocol
}
--vertical_results
SELECT * FROM tb2 where f59 = 8 and f60 = 105;
--horizontal_results
--enable_ps_protocol
SELECT f59,f60 FROM test.v1 where f59 = 8 and f60 = 105 ;
......@@ -3222,11 +3252,13 @@ CREATE VIEW test.v1 AS SELECT f59,f60,f61 FROM tb2 ;
UPDATE test.v1 SET f59 = 891 WHERE f60 = 105 ;
--disable_info
if ($have_bug_11589)
if ($have_bug_32285)
{
--disable_ps_protocol
}
--vertical_results
SELECT * FROM tb2 where f59 = 891 and f60 = 105;
--horizontal_results
--enable_ps_protocol
SELECT f59,f60 FROM test.v1 where f59 = 891 and f60 = 105 ;
......@@ -3779,23 +3811,6 @@ SET @variant6= 'CREATE VIEW v1 AS SELECT (SELECT f60 FROM t2 WHERE f59=19) AS f6
# For a WHERE clause sub query that refers to a table also referenced in a
# FROM clause 3.3.2.18
SET @variant7= 'CREATE VIEW v1 AS SELECT f61 FROM v2';
# Attention: The attempt to UPDATE the next VIEW fails like expected,
# but the error message
# ERROR 1093 (HY000) : You can't specify target table 'v1' for
# update in FORM clause"
# is wrong.
# The server must deliver ERROR 1288 (ER_NON_UPDATABLE_TABLE).
# Bug#10773 Incorrect message is displayed while updating a view
# mleich FIXME: Remove the comment above, replace
# --error ER_NON_UPDATABLE_TABLE,ER_UPDATE_TABLE_USED
# with
# --error ER_NON_UPDATABLE_TABLE
# and update the file with expected results when the
# Bug#10773 is fixed.
# For a reference to a non-updateable view 3.3.2.19
let $message= Some server responses suffer from
Bug#10773 Incorrect message is displayed while updating a view;
--source include/show_msg80.inc
SET @variant8= 'CREATE VIEW v1 AS SELECT f59 AS f61 FROM t1 WHERE f60 IN (SELECT f59 FROM t1)';
# For ALGORITHM = TEMPTABLE 3.3.2.20
SET @variant9= 'CREATE ALGORITHM = TEMPTABLE VIEW v1 (f61) AS select f60 from t1';
......@@ -3819,9 +3834,7 @@ while ($num)
UPDATE v1 SET f61=1007;
--error ER_NON_UPDATABLE_TABLE
DELETE FROM v1;
DROP VIEW v1;
dec $num;
}
......@@ -3997,27 +4010,33 @@ DESCRIBE v2;
SELECT * FROM v2 order by 2;
# - What will be the content of base table created with AS SELECT ?
CREATE TABLE t2 AS SELECT f1, SQRT(f2) my_sqrt FROM t1;
if ($have_bug_11589)
if ($have_bug_32285)
{
--disable_ps_protocol
}
--vertical_results
SELECT * FROM t2 order by 2;
--horizontal_results
--enable_ps_protocol
DROP TABLE t2;
CREATE TABLE t2 AS SELECT * FROM v1;
if ($have_bug_11589)
if ($have_bug_32285)
{
--disable_ps_protocol
}
--vertical_results
SELECT * FROM t2 order by 2;
--horizontal_results
--enable_ps_protocol
DROP TABLE t2;
CREATE TABLE t2 AS SELECT * FROM v2;
if ($have_bug_11589)
if ($have_bug_32285)
{
--disable_ps_protocol
}
--vertical_results
SELECT * FROM t2 order by 2;
--horizontal_results
--enable_ps_protocol
#
DROP TABLE t1;
......
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