#
# MDEV-20034 Add support for the pre-defined weak SYS_REFCURSOR
#
CREATE FUNCTION f1() RETURNS SYS_REFCURSOR
BEGIN
DECLARE c0 SYS_REFCURSOR;
DECLARE c1 SYS_REFCURSOR;
OPEN c0 FOR SELECT 1;
OPEN c1 FOR SELECT 1;
RETURN c1;
END;
/
SET @a=(SELECT COLUMN_CREATE(1, f1()));
SELECT COLUMN_GET(@a, 1 AS INT);
COLUMN_GET(@a, 1 AS INT)
1
SELECT COLUMN_GET(@a, 1 AS SYS_REFCURSOR);
ERROR HY000: Operator does not exist: 'CAST(expr AS sys_refcursor)'
DROP FUNCTION f1;
