1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-31 22:22:30 +03:00

Fixed BUG#336: Subselects with tables does not work as values for local SP variables

and BUG#1654: Stored Procedure Crash if contains subquery and set function

Disallowed subselects in RETURN (for FUNCTIONs) and SET of local variables.
The latter should work, but turned out to be difficult to fix, so we just
disallow it for the time being.
This commit is contained in:
pem@mysql.comhem.se
2003-12-04 15:17:55 +01:00
parent 2c16ccdbe6
commit a5780a4815
31 changed files with 81 additions and 10 deletions

View File

@@ -270,4 +270,14 @@ ERROR 42S22: Unknown column 'valname' in 'order clause'
drop procedure bug1965;
select 1 into a;
ERROR 42000: Undeclared variable: a
create procedure bug336(id char(16))
begin
declare x int;
set x = (select sum(t.data) from test.t2 t);
end;
ERROR 0A000: Subselect value not supported
create function bug1654()
returns int
return (select sum(t.data) from test.t2 t);
ERROR 0A000: Statements like SELECT, INSERT, UPDATE (and others) are not allowed in a FUNCTION
drop table t1;