1
0
mirror of https://github.com/MariaDB/server.git synced 2026-01-06 05:22:24 +03:00

Bug#7648 - Stored procedure crash when invoking a function that returns a bit

bugfix 9102 corrected the crashing, this corrects the result.


mysql-test/r/sp.result:
  Bug#7648
    New test for bug
mysql-test/t/sp.test:
  Bug#7648
    New test for bug
sql/item_func.h:
  Bug#7648
    Cannot cheat in Item_func_sp::val_int()
This commit is contained in:
unknown
2005-04-19 10:51:11 +01:00
parent 9bf92ed6fe
commit f054047f02
3 changed files with 32 additions and 3 deletions

View File

@@ -2964,4 +2964,10 @@ select bug9102();
drop function bug9102|
bug9102()
a
drop procedure if exists bug7648|
create function bug7648() returns bit(8) return 'a'|
select bug7648()|
bug7648()
a
drop function bug7648|
drop table t1,t2;

View File

@@ -3627,16 +3627,29 @@ set global query_cache_size = @qcs1|
delete from t1|
drop function bug9902|
#
# BUG#9102: New bug synopsis
# BUG#9102: Stored proccedures: function which returns blob causes crash
#
--disable_warnings
drop function if exists bug9102|
--enable_warnings
create function bug9102() returns blob return 'a'|
select bug9102();
select bug9102()|
drop function bug9102|
#
# BUG#7648: Stored procedure crash when invoking a function that returns a bit
#
--disable_warnings
drop procedure if exists bug7648|
--enable_warnings
create function bug7648() returns bit(8) return 'a'|
select bug7648()|
drop function bug7648|
#
# BUG#NNNN: New bug synopsis
#

View File

@@ -1308,7 +1308,17 @@ public:
longlong val_int()
{
return (longlong)Item_func_sp::val_real();
Item *it;
longlong l;
if (execute(&it))
{
null_value= 1;
return 0LL;
}
l= it->val_int();
null_value= it->null_value;
return l;
}
double val_real()