summaryrefslogtreecommitdiff
path: root/mysql-test/r/sp.result
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/r/sp.result')
-rw-r--r--mysql-test/r/sp.result178
1 files changed, 159 insertions, 19 deletions
diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result
index e3e379ac65d..1f3f7dba7da 100644
--- a/mysql-test/r/sp.result
+++ b/mysql-test/r/sp.result
@@ -1032,7 +1032,7 @@ a f8()
3 1
drop function f1|
select * from v1|
-ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s)
+ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
create function f1() returns int
return (select sum(data) from t1) + (select sum(data) from v1)|
drop function f1|
@@ -3206,18 +3206,6 @@ set f1= concat( 'hello', f1 );
return f1;
end|
drop function bug9048|
-drop function if exists bug12812|
-create function bug12812() returns char(2)
-begin
-return 'ok';
-end;
-create user user_bug12812@localhost IDENTIFIED BY 'ABC'|
-SELECT test.bug12812()|
-ERROR 42000: execute command denied to user 'user_bug12812'@'localhost' for routine 'test.bug12812'
-CREATE VIEW v1 AS SELECT test.bug12812()|
-ERROR 42000: execute command denied to user 'user_bug12812'@'localhost' for routine 'test.bug12812'
-DROP USER user_bug12812@localhost|
-drop function bug12812|
drop procedure if exists bug12849_1|
create procedure bug12849_1(inout x char) select x into x|
set @var='a'|
@@ -3312,17 +3300,11 @@ call bug12379_1()|
bug12379()
42
42
-Warnings:
-Error 1062 Duplicate entry 'X' for key 1
-Warning 1417 A routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changes
select 2|
2
2
call bug12379_2()|
bug12379()
-Warnings:
-Error 1062 Duplicate entry 'X' for key 1
-Warning 1417 A routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changes
select 3|
3
3
@@ -3435,4 +3417,162 @@ Table Create Table
tm1 CREATE TEMPORARY TABLE `tm1` (
`spv1` decimal(6,3) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table if exists t3|
+drop procedure if exists bug7049_1|
+drop procedure if exists bug7049_2|
+drop procedure if exists bug7049_3|
+drop procedure if exists bug7049_4|
+drop procedure if exists bug7049_5|
+drop procedure if exists bug7049_6|
+drop function if exists bug7049_1|
+drop function if exists bug7049_2|
+create table t3 ( x int unique )|
+create procedure bug7049_1()
+begin
+insert into t3 values (42);
+insert into t3 values (42);
+end|
+create procedure bug7049_2()
+begin
+declare exit handler for sqlexception
+select 'Caught it' as 'Result';
+call bug7049_1();
+select 'Missed it' as 'Result';
+end|
+create procedure bug7049_3()
+call bug7049_1()|
+create procedure bug7049_4()
+begin
+declare exit handler for sqlexception
+select 'Caught it' as 'Result';
+call bug7049_3();
+select 'Missed it' as 'Result';
+end|
+create procedure bug7049_5()
+begin
+declare x decimal(2,1);
+set x = 'zap';
+end|
+create procedure bug7049_6()
+begin
+declare exit handler for sqlwarning
+select 'Caught it' as 'Result';
+call bug7049_5();
+select 'Missed it' as 'Result';
+end|
+create function bug7049_1()
+returns int
+begin
+insert into t3 values (42);
+insert into t3 values (42);
+return 42;
+end|
+create function bug7049_2()
+returns int
+begin
+declare x int default 0;
+declare continue handler for sqlexception
+set x = 1;
+set x = bug7049_1();
+return x;
+end|
+call bug7049_2()|
+Result
+Caught it
+select * from t3|
+x
+42
+delete from t3|
+call bug7049_4()|
+Result
+Caught it
+select * from t3|
+x
+42
+call bug7049_6()|
+Result
+Caught it
+select bug7049_2()|
+bug7049_2()
+1
+drop table t3|
+drop procedure bug7049_1|
+drop procedure bug7049_2|
+drop procedure bug7049_3|
+drop procedure bug7049_4|
+drop procedure bug7049_5|
+drop procedure bug7049_6|
+drop function bug7049_1|
+drop function bug7049_2|
+drop function if exists bug13941|
+drop procedure if exists bug13941|
+create function bug13941(p_input_str text)
+returns text
+begin
+declare p_output_str text;
+set p_output_str = p_input_str;
+set p_output_str = replace(p_output_str, 'xyzzy', 'plugh');
+set p_output_str = replace(p_output_str, 'test', 'prova');
+set p_output_str = replace(p_output_str, 'this', 'questo');
+set p_output_str = replace(p_output_str, ' a ', 'una ');
+set p_output_str = replace(p_output_str, 'is', '');
+return p_output_str;
+end|
+create procedure bug13941(out sout varchar(128))
+begin
+set sout = 'Local';
+set sout = ifnull(sout, 'DEF');
+end|
+select bug13941('this is a test')|
+bug13941('this is a test')
+questo una prova
+call bug13941(@a)|
+select @a|
+@a
+Local
+drop function bug13941|
+drop procedure bug13941|
+DROP PROCEDURE IF EXISTS bug13095;
+DROP TABLE IF EXISTS bug13095_t1;
+DROP VIEW IF EXISTS bug13095_v1;
+CREATE PROCEDURE bug13095(tbl_name varchar(32))
+BEGIN
+SET @str =
+CONCAT("CREATE TABLE ", tbl_name, "(stuff char(15))");
+SELECT @str;
+PREPARE stmt FROM @str;
+EXECUTE stmt;
+SET @str =
+CONCAT("INSERT INTO ", tbl_name, " VALUES('row1'),('row2'),('row3')" );
+SELECT @str;
+PREPARE stmt FROM @str;
+EXECUTE stmt;
+SET @str =
+CONCAT("CREATE VIEW bug13095_v1(c1) AS SELECT stuff FROM ", tbl_name);
+SELECT @str;
+PREPARE stmt FROM @str;
+EXECUTE stmt;
+SELECT * FROM bug13095_v1;
+SET @str =
+"DROP VIEW bug13095_v1";
+SELECT @str;
+PREPARE stmt FROM @str;
+EXECUTE stmt;
+END|
+CALL bug13095('bug13095_t1');
+@str
+CREATE TABLE bug13095_t1(stuff char(15))
+@str
+INSERT INTO bug13095_t1 VALUES('row1'),('row2'),('row3')
+@str
+CREATE VIEW bug13095_v1(c1) AS SELECT stuff FROM bug13095_t1
+c1
+row1
+row2
+row3
+@str
+DROP VIEW bug13095_v1
+DROP PROCEDURE IF EXISTS bug13095;
+DROP VIEW IF EXISTS bug13095_v1;
+DROP TABLE IF EXISTS bug13095_t1;
drop table t1,t2;