Loading mysql-test/r/func_gconcat.result +15 −0 Original line number Diff line number Diff line Loading @@ -596,3 +596,18 @@ GROUP_CONCAT(a ORDER BY a) ,x ,z DROP TABLE t1; set names latin1; create table t1 (a char, b char); insert into t1 values ('a', 'a'), ('a', 'b'), ('b', 'a'), ('b', 'b'); create table t2 select group_concat(b) as a from t1 where a = 'a'; create table t3 (select group_concat(a) as a from t1 where a = 'a') union (select group_concat(b) as a from t1 where a = 'b'); select charset(a) from t2; charset(a) latin1 select charset(a) from t3; charset(a) latin1 latin1 drop table t1, t2, t3; set names default; mysql-test/r/sp-error.result +2 −0 Original line number Diff line number Diff line Loading @@ -845,6 +845,8 @@ set password = 'foo1'; select password; end| ERROR 42000: Variable 'password' must be quoted with `...`, or renamed set names='foo2'| ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 create procedure bug13510_2() begin declare names varchar(10); Loading mysql-test/r/sp.result +19 −0 Original line number Diff line number Diff line Loading @@ -3648,4 +3648,23 @@ call bug14723();; 42 drop function bug14723| drop procedure bug14723| create procedure bug14845() begin declare a char(255); declare done int default 0; declare c cursor for select count(*) from t1 where 1 = 0; declare continue handler for sqlstate '02000' set done = 1; open c; repeat fetch c into a; if not done then select a; end if; until done end repeat; close c; end| call bug14845()| a 0 drop procedure bug14845| drop table t1,t2; mysql-test/r/sp_trans.result +195 −0 Original line number Diff line number Diff line Loading @@ -174,3 +174,198 @@ ERROR HY000: Explicit or implicit commit is not allowed in stored function or tr drop procedure bug10015_8| drop function bug10015_7| drop table t1, t2| drop function if exists bug13825_0| drop function if exists bug13825_1| drop function if exists bug13825_2| drop function if exists bug13825_3| drop function if exists bug13825_4| drop function if exists bug13825_5| drop procedure if exists bug13825_0| drop procedure if exists bug13825_1| drop procedure if exists bug13825_2| drop table if exists t1| create table t1 (i int) engine=innodb| create table t2 (i int) engine=innodb| create function bug13825_0() returns int begin rollback to savepoint x; return 1; end| create function bug13825_1() returns int begin release savepoint x; return 1; end| create function bug13825_2() returns int begin insert into t1 values (2); savepoint x; insert into t1 values (3); rollback to savepoint x; insert into t1 values (4); return 1; end| create procedure bug13825_0() begin rollback to savepoint x; end| create procedure bug13825_1() begin release savepoint x; end| create procedure bug13825_2() begin savepoint x; end| insert into t2 values (1)| create trigger t2_bi before insert on t2 for each row rollback to savepoint x| create trigger t2_bu before update on t2 for each row release savepoint x| create trigger t2_bd before delete on t2 for each row begin insert into t1 values (2); savepoint x; insert into t1 values (3); rollback to savepoint x; insert into t1 values (4); end| create function bug13825_3(rb int) returns int begin insert into t1 values(1); savepoint x; insert into t1 values(2); if rb then rollback to savepoint x; end if; insert into t1 values(3); return rb; end| create function bug13825_4() returns int begin savepoint x; insert into t1 values(2); rollback to savepoint x; return 0; end| create function bug13825_5(p int) returns int begin savepoint x; insert into t2 values(p); rollback to savepoint x; insert into t2 values(p+1); return p; end| set autocommit= 0| begin | insert into t1 values (1)| savepoint x| set @a:= bug13825_0()| ERROR 42000: SAVEPOINT x does not exist insert into t2 values (2)| ERROR 42000: SAVEPOINT x does not exist set @a:= bug13825_1()| ERROR 42000: SAVEPOINT x does not exist update t2 set i = 2| ERROR 42000: SAVEPOINT x does not exist set @a:= bug13825_2()| select * from t1| i 1 2 4 rollback to savepoint x| select * from t1| i 1 delete from t2| select * from t1| i 1 2 4 rollback to savepoint x| select * from t1| i 1 release savepoint x| set @a:= bug13825_2()| select * from t1| i 1 2 4 rollback to savepoint x| ERROR 42000: SAVEPOINT x does not exist delete from t1| commit| begin| insert into t1 values (5)| savepoint x| insert into t1 values (6)| call bug13825_0()| select * from t1| i 5 call bug13825_1()| rollback to savepoint x| ERROR 42000: SAVEPOINT x does not exist savepoint x| insert into t1 values (7)| call bug13825_2()| rollback to savepoint x| select * from t1| i 5 7 delete from t1| commit| set autocommit= 1| select bug13825_3(0)| bug13825_3(0) 0 select * from t1| i 1 2 3 delete from t1| select bug13825_3(1)| bug13825_3(1) 1 select * from t1| i 1 3 delete from t1| set autocommit= 0| begin| insert into t1 values (1)| set @a:= bug13825_4()| select * from t1| i 1 delete from t1| commit| set autocommit= 1| drop table t2| create table t2 (i int) engine=innodb| insert into t1 values (1), (bug13825_5(2)), (3)| select * from t1| i 1 2 3 select * from t2| i 3 drop function bug13825_0| drop function bug13825_1| drop function bug13825_2| drop function bug13825_3| drop function bug13825_4| drop function bug13825_5| drop procedure bug13825_0| drop procedure bug13825_1| drop procedure bug13825_2| drop table t1, t2| mysql-test/r/view.result +8 −0 Original line number Diff line number Diff line Loading @@ -2338,6 +2338,14 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 Using where DROP VIEW v1,v2; DROP TABLE t1,t2,t3; create table t1 (f1 int); create view v1 as select t1.f1 as '123 456' from t1; select * from v1; 123 456 drop view v1; drop table t1; create table t1 (f1 int, f2 int); insert into t1 values(1,1),(1,2),(1,3); create view v1 as select f1 ,group_concat(f2 order by f2 asc) from t1 group by f1; Loading Loading
mysql-test/r/func_gconcat.result +15 −0 Original line number Diff line number Diff line Loading @@ -596,3 +596,18 @@ GROUP_CONCAT(a ORDER BY a) ,x ,z DROP TABLE t1; set names latin1; create table t1 (a char, b char); insert into t1 values ('a', 'a'), ('a', 'b'), ('b', 'a'), ('b', 'b'); create table t2 select group_concat(b) as a from t1 where a = 'a'; create table t3 (select group_concat(a) as a from t1 where a = 'a') union (select group_concat(b) as a from t1 where a = 'b'); select charset(a) from t2; charset(a) latin1 select charset(a) from t3; charset(a) latin1 latin1 drop table t1, t2, t3; set names default;
mysql-test/r/sp-error.result +2 −0 Original line number Diff line number Diff line Loading @@ -845,6 +845,8 @@ set password = 'foo1'; select password; end| ERROR 42000: Variable 'password' must be quoted with `...`, or renamed set names='foo2'| ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 create procedure bug13510_2() begin declare names varchar(10); Loading
mysql-test/r/sp.result +19 −0 Original line number Diff line number Diff line Loading @@ -3648,4 +3648,23 @@ call bug14723();; 42 drop function bug14723| drop procedure bug14723| create procedure bug14845() begin declare a char(255); declare done int default 0; declare c cursor for select count(*) from t1 where 1 = 0; declare continue handler for sqlstate '02000' set done = 1; open c; repeat fetch c into a; if not done then select a; end if; until done end repeat; close c; end| call bug14845()| a 0 drop procedure bug14845| drop table t1,t2;
mysql-test/r/sp_trans.result +195 −0 Original line number Diff line number Diff line Loading @@ -174,3 +174,198 @@ ERROR HY000: Explicit or implicit commit is not allowed in stored function or tr drop procedure bug10015_8| drop function bug10015_7| drop table t1, t2| drop function if exists bug13825_0| drop function if exists bug13825_1| drop function if exists bug13825_2| drop function if exists bug13825_3| drop function if exists bug13825_4| drop function if exists bug13825_5| drop procedure if exists bug13825_0| drop procedure if exists bug13825_1| drop procedure if exists bug13825_2| drop table if exists t1| create table t1 (i int) engine=innodb| create table t2 (i int) engine=innodb| create function bug13825_0() returns int begin rollback to savepoint x; return 1; end| create function bug13825_1() returns int begin release savepoint x; return 1; end| create function bug13825_2() returns int begin insert into t1 values (2); savepoint x; insert into t1 values (3); rollback to savepoint x; insert into t1 values (4); return 1; end| create procedure bug13825_0() begin rollback to savepoint x; end| create procedure bug13825_1() begin release savepoint x; end| create procedure bug13825_2() begin savepoint x; end| insert into t2 values (1)| create trigger t2_bi before insert on t2 for each row rollback to savepoint x| create trigger t2_bu before update on t2 for each row release savepoint x| create trigger t2_bd before delete on t2 for each row begin insert into t1 values (2); savepoint x; insert into t1 values (3); rollback to savepoint x; insert into t1 values (4); end| create function bug13825_3(rb int) returns int begin insert into t1 values(1); savepoint x; insert into t1 values(2); if rb then rollback to savepoint x; end if; insert into t1 values(3); return rb; end| create function bug13825_4() returns int begin savepoint x; insert into t1 values(2); rollback to savepoint x; return 0; end| create function bug13825_5(p int) returns int begin savepoint x; insert into t2 values(p); rollback to savepoint x; insert into t2 values(p+1); return p; end| set autocommit= 0| begin | insert into t1 values (1)| savepoint x| set @a:= bug13825_0()| ERROR 42000: SAVEPOINT x does not exist insert into t2 values (2)| ERROR 42000: SAVEPOINT x does not exist set @a:= bug13825_1()| ERROR 42000: SAVEPOINT x does not exist update t2 set i = 2| ERROR 42000: SAVEPOINT x does not exist set @a:= bug13825_2()| select * from t1| i 1 2 4 rollback to savepoint x| select * from t1| i 1 delete from t2| select * from t1| i 1 2 4 rollback to savepoint x| select * from t1| i 1 release savepoint x| set @a:= bug13825_2()| select * from t1| i 1 2 4 rollback to savepoint x| ERROR 42000: SAVEPOINT x does not exist delete from t1| commit| begin| insert into t1 values (5)| savepoint x| insert into t1 values (6)| call bug13825_0()| select * from t1| i 5 call bug13825_1()| rollback to savepoint x| ERROR 42000: SAVEPOINT x does not exist savepoint x| insert into t1 values (7)| call bug13825_2()| rollback to savepoint x| select * from t1| i 5 7 delete from t1| commit| set autocommit= 1| select bug13825_3(0)| bug13825_3(0) 0 select * from t1| i 1 2 3 delete from t1| select bug13825_3(1)| bug13825_3(1) 1 select * from t1| i 1 3 delete from t1| set autocommit= 0| begin| insert into t1 values (1)| set @a:= bug13825_4()| select * from t1| i 1 delete from t1| commit| set autocommit= 1| drop table t2| create table t2 (i int) engine=innodb| insert into t1 values (1), (bug13825_5(2)), (3)| select * from t1| i 1 2 3 select * from t2| i 3 drop function bug13825_0| drop function bug13825_1| drop function bug13825_2| drop function bug13825_3| drop function bug13825_4| drop function bug13825_5| drop procedure bug13825_0| drop procedure bug13825_1| drop procedure bug13825_2| drop table t1, t2|
mysql-test/r/view.result +8 −0 Original line number Diff line number Diff line Loading @@ -2338,6 +2338,14 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 Using where DROP VIEW v1,v2; DROP TABLE t1,t2,t3; create table t1 (f1 int); create view v1 as select t1.f1 as '123 456' from t1; select * from v1; 123 456 drop view v1; drop table t1; create table t1 (f1 int, f2 int); insert into t1 values(1,1),(1,2),(1,3); create view v1 as select f1 ,group_concat(f2 order by f2 asc) from t1 group by f1; Loading