diff options
author | unknown <pem@mysql.comhem.se> | 2004-04-06 15:48:58 +0200 |
---|---|---|
committer | unknown <pem@mysql.comhem.se> | 2004-04-06 15:48:58 +0200 |
commit | c22ccc136bfe8eaeaa9797775bde423cf0931bc1 (patch) | |
tree | bc2c17cd1e1f52242adcfb62808c8e18f12dc83a /mysql-test/r/sp.result | |
parent | 91dcd01159b2bcca753dd699fdf6a52d496ff7c1 (diff) | |
download | mariadb-git-c22ccc136bfe8eaeaa9797775bde423cf0931bc1.tar.gz |
Fixed BUG#2776: Stored procedure crash if variable assigned to default.
Keep track on the default value and use it. (Or NULL, if not declared.)
mysql-test/r/sp.result:
New testcases for BUG#2776.
mysql-test/t/sp.test:
New testcases for BUG#2776.
sql/sp_pcontext.cc:
Initialize local variable default value.
sql/sp_pcontext.h:
New method for saving default value.
sql/sql_yacc.yy:
If DEFAULT is use as a value in SET variable = ... in an SP, actually use the default.
Diffstat (limited to 'mysql-test/r/sp.result')
-rw-r--r-- | mysql-test/r/sp.result | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index 8c72186e618..fb563e60ac2 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -1021,6 +1021,29 @@ select bug2772()| bug2772() a drop function bug2772| +create procedure bug2776_1(out x int) +begin +declare v int; +set v = default; +set x = v; +end| +create procedure bug2776_2(out x int) +begin +declare v int default 42; +set v = default; +set x = v; +end| +set @x = 1| +call bug2776_1(@x)| +select @x| +@x +NULL +call bug2776_2(@x)| +select @x| +@x +42 +drop procedure bug2776_1| +drop procedure bug2776_2| drop table if exists fac| create table fac (n int unsigned not null primary key, f bigint unsigned)| create procedure ifac(n int unsigned) |