mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
Fix BUG#2259: Crash after fetch from not-open cursor in stored procedure
Initialize and test properly when cleaning up, to avoid crash in some error cases.
This commit is contained in:
@@ -388,6 +388,23 @@ call bug1653()|
|
||||
drop procedure bug1653|
|
||||
drop table t3|
|
||||
|
||||
#
|
||||
# BUG#2259
|
||||
#
|
||||
# Note: When this bug existed, it did not necessarily cause a crash
|
||||
# in all builds, but valgrind did give warnings.
|
||||
create procedure bug2259()
|
||||
begin
|
||||
declare v1 int;
|
||||
declare c1 cursor for select s1 from t10;
|
||||
|
||||
fetch c1 into v1;
|
||||
end|
|
||||
|
||||
--error 1310
|
||||
call bug2259()|
|
||||
drop procedure bug2259|
|
||||
|
||||
#
|
||||
# BUG#2272
|
||||
#
|
||||
@@ -402,6 +419,7 @@ insert into t1 values (666, 51.3)|
|
||||
--error 1054
|
||||
call bug2272()|
|
||||
delete from t1|
|
||||
drop procedure bug2272|
|
||||
|
||||
drop table t1|
|
||||
|
||||
|
||||
Reference in New Issue
Block a user