1
0
mirror of https://github.com/MariaDB/server.git synced 2025-11-02 02:53:04 +03:00

Fix for BUG#24923: Functions with ENUM issues.

The problem was that the RETURNS column in the mysql.proc was of
CHAR(64). That was not enough for storing long-named datatypes.

The fix is to change CHAR(64) to LONGBLOB, and to throw warnings
at the time a stored routine is created if some data is truncated
during writing into mysql.proc.
This commit is contained in:
anozdrin/alik@station.
2007-10-17 12:13:56 +04:00
parent ee3e6d8171
commit 49a0f09bbf
8 changed files with 222 additions and 40 deletions

View File

@@ -7986,4 +7986,74 @@ DROP VIEW v2;
###########################################################################
#
# Bug#24923: Functions with ENUM issues.
#
###########################################################################
--echo #
--echo # - Bug#24923: prepare.
--echo #
--echo
--disable_warnings
DROP FUNCTION IF EXISTS f1;
--enable_warnings
--echo
--echo #
--echo # - Bug#24923: create required objects.
--echo #
--echo
delimiter |;
CREATE FUNCTION f1(p INT)
RETURNS ENUM ('Very_long_enum_element_identifier',
'Another_very_long_enum_element_identifier')
BEGIN
CASE p
WHEN 1 THEN
RETURN 'Very_long_enum_element_identifier';
ELSE
RETURN 'Another_very_long_enum_element_identifier';
END CASE;
END|
delimiter ;|
--echo
--echo #
--echo # - Bug#24923: check.
--echo #
--echo
SELECT f1(1);
--echo
SELECT f1(2);
--echo
SHOW CREATE FUNCTION f1;
--echo #
--echo # - Bug#24923: cleanup.
--echo #
--echo
DROP FUNCTION f1;
--echo
###########################################################################
--echo End of 5.1 tests