mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Fixed BUG#4487: Stored procedure connection aborted if uninitialized char.
This commit is contained in:
@ -1820,6 +1820,19 @@ Ok
|
|||||||
Ok
|
Ok
|
||||||
drop procedure bug5258|
|
drop procedure bug5258|
|
||||||
drop procedure bug5258_aux|
|
drop procedure bug5258_aux|
|
||||||
|
create function bug4487() returns char
|
||||||
|
begin
|
||||||
|
declare v char;
|
||||||
|
return v;
|
||||||
|
end|
|
||||||
|
Warnings:
|
||||||
|
Warning 1311 Referring to uninitialized variable v
|
||||||
|
select bug4487()|
|
||||||
|
bug4487()
|
||||||
|
NULL
|
||||||
|
Warnings:
|
||||||
|
Warning 1311 Referring to uninitialized variable v
|
||||||
|
drop function bug4487|
|
||||||
drop table if exists fac|
|
drop table if exists fac|
|
||||||
create table fac (n int unsigned not null primary key, f bigint unsigned)|
|
create table fac (n int unsigned not null primary key, f bigint unsigned)|
|
||||||
create procedure ifac(n int unsigned)
|
create procedure ifac(n int unsigned)
|
||||||
|
@ -1987,6 +1987,18 @@ call bug5258_aux()|
|
|||||||
drop procedure bug5258|
|
drop procedure bug5258|
|
||||||
drop procedure bug5258_aux|
|
drop procedure bug5258_aux|
|
||||||
|
|
||||||
|
#
|
||||||
|
# BUG#4487: Stored procedure connection aborted if uninitialized char
|
||||||
|
#
|
||||||
|
create function bug4487() returns char
|
||||||
|
begin
|
||||||
|
declare v char;
|
||||||
|
return v;
|
||||||
|
end|
|
||||||
|
|
||||||
|
select bug4487()|
|
||||||
|
drop function bug4487|
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Some "real" examples
|
# Some "real" examples
|
||||||
|
@ -1130,25 +1130,31 @@ public:
|
|||||||
double val()
|
double val()
|
||||||
{
|
{
|
||||||
Item *it;
|
Item *it;
|
||||||
|
double d;
|
||||||
|
|
||||||
if (execute(&it))
|
if (execute(&it))
|
||||||
{
|
{
|
||||||
null_value= 1;
|
null_value= 1;
|
||||||
return 0.0;
|
return 0.0;
|
||||||
}
|
}
|
||||||
return it->val();
|
d= it->val();
|
||||||
|
null_value= it->null_value;
|
||||||
|
return d;
|
||||||
}
|
}
|
||||||
|
|
||||||
String *val_str(String *str)
|
String *val_str(String *str)
|
||||||
{
|
{
|
||||||
Item *it;
|
Item *it;
|
||||||
|
String *s;
|
||||||
|
|
||||||
if (execute(&it))
|
if (execute(&it))
|
||||||
{
|
{
|
||||||
null_value= 1;
|
null_value= 1;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
return it->val_str(str);
|
s= it->val_str(str);
|
||||||
|
null_value= it->null_value;
|
||||||
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
void fix_length_and_dec();
|
void fix_length_and_dec();
|
||||||
|
Reference in New Issue
Block a user