1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Fixed BUG#3132: Stored function returns empty when used in union.

This commit is contained in:
pem@mysql.comhem.se
2004-06-10 17:07:53 +02:00
parent a3082cd3c9
commit 078f717804
3 changed files with 17 additions and 1 deletions

View File

@ -1353,6 +1353,13 @@ drop procedure bug2564_1|
drop procedure bug2564_2| drop procedure bug2564_2|
drop function bug2564_3| drop function bug2564_3|
drop function bug2564_4| drop function bug2564_4|
create function bug3132(s char(20)) returns char(50)
return concat('Hello, ', s, '!')|
select bug3132('Bob') union all select bug3132('Judy')|
bug3132('Bob')
Hello, Bob!
Hello, Judy!
drop function bug3132|
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)

View File

@ -1551,6 +1551,15 @@ drop procedure bug2564_2|
drop function bug2564_3| drop function bug2564_3|
drop function bug2564_4| drop function bug2564_4|
#
# BUG#3132
#
create function bug3132(s char(20)) returns char(50)
return concat('Hello, ', s, '!')|
select bug3132('Bob') union all select bug3132('Judy')|
drop function bug3132|
# #
# Some "real" examples # Some "real" examples

View File

@ -3320,7 +3320,7 @@ Item_func_sp::fix_length_and_dec()
switch (m_sp->result()) { switch (m_sp->result()) {
case STRING_RESULT: case STRING_RESULT:
maybe_null= 1; maybe_null= 1;
max_length= 0; max_length= MAX_BLOB_WIDTH;
break; break;
case REAL_RESULT: case REAL_RESULT:
decimals= NOT_FIXED_DEC; decimals= NOT_FIXED_DEC;