Commit b62a8466 authored by Alexander Barkov's avatar Alexander Barkov

MDEV-20913 sql_mode=ORACLE: INET6 does not work as a routine parameter type and return type

Adding the missing grammar.
parent f1e9a0ac
...@@ -2148,11 +2148,7 @@ BEGIN ...@@ -2148,11 +2148,7 @@ BEGIN
RETURN 0; RETURN 0;
END; END;
$$ $$
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 't1.a%TYPE ERROR HY000: Unknown data type: 't1'
AS
BEGIN
RETURN 0;
END' at line 1
# #
# End of MDEV-10577 sql_mode=ORACLE: %TYPE in variable declarations # End of MDEV-10577 sql_mode=ORACLE: %TYPE in variable declarations
# #
......
...@@ -1963,7 +1963,7 @@ DROP TABLE t1; ...@@ -1963,7 +1963,7 @@ DROP TABLE t1;
--echo # %TYPE in function RETURN clause is not supported yet --echo # %TYPE in function RETURN clause is not supported yet
--echo # --echo #
DELIMITER $$; DELIMITER $$;
--error ER_PARSE_ERROR --error ER_UNKNOWN_DATA_TYPE
CREATE FUNCTION f1 RETURN t1.a%TYPE CREATE FUNCTION f1 RETURN t1.a%TYPE
AS AS
BEGIN BEGIN
......
#
# Start of 10.5 tests
#
#
# MDEV-20913 sql_mode=ORACLE: INET6 does not work as a routine parameter type and return type
#
SET sql_mode=ORACLE;
CREATE OR REPLACE FUNCTION f1() RETURN INET6 AS
BEGIN
RETURN 'ffff::ffff';
END;
$$
SELECT f1();
f1()
ffff::ffff
DROP FUNCTION f1;
SET sql_mode=ORACLE;
CREATE OR REPLACE FUNCTION f1(a INET6) RETURN INT AS
BEGIN
RETURN LENGTH(a);
END;
$$
SELECT f1('0::0');
f1('0::0')
2
DROP FUNCTION f1;
#
# End of 10.5 tests
#
--echo #
--echo # Start of 10.5 tests
--echo #
--echo #
--echo # MDEV-20913 sql_mode=ORACLE: INET6 does not work as a routine parameter type and return type
--echo #
SET sql_mode=ORACLE;
DELIMITER $$;
CREATE OR REPLACE FUNCTION f1() RETURN INET6 AS
BEGIN
RETURN 'ffff::ffff';
END;
$$
DELIMITER ;$$
SELECT f1();
DROP FUNCTION f1;
SET sql_mode=ORACLE;
DELIMITER $$;
CREATE OR REPLACE FUNCTION f1(a INET6) RETURN INT AS
BEGIN
RETURN LENGTH(a);
END;
$$
DELIMITER ;$$
SELECT f1('0::0');
DROP FUNCTION f1;
--echo #
--echo # End of 10.5 tests
--echo #
...@@ -6881,6 +6881,21 @@ sp_param_field_type: ...@@ -6881,6 +6881,21 @@ sp_param_field_type:
| sp_param_field_type_string | sp_param_field_type_string
| field_type_lob | field_type_lob
| field_type_misc | field_type_misc
| IDENT_sys float_options srid_option
{
if (Lex->set_field_type_udt(&$$, $1, $2))
MYSQL_YYABORT;
}
| reserved_keyword_udt float_options srid_option
{
if (Lex->set_field_type_udt(&$$, $1, $2))
MYSQL_YYABORT;
}
| non_reserved_keyword_udt float_options srid_option
{
if (Lex->set_field_type_udt(&$$, $1, $2))
MYSQL_YYABORT;
}
; ;
...@@ -16711,13 +16726,11 @@ reserved_keyword_udt: ...@@ -16711,13 +16726,11 @@ reserved_keyword_udt:
| INDEX_SYM | INDEX_SYM
| INFILE | INFILE
| INNER_SYM | INNER_SYM
| INOUT_SYM
| INSENSITIVE_SYM | INSENSITIVE_SYM
| INSERT | INSERT
| INTERSECT_SYM | INTERSECT_SYM
| INTERVAL_SYM | INTERVAL_SYM
| INTO | INTO
| IN_SYM
| IS | IS
| ITERATE_SYM | ITERATE_SYM
| JOIN_SYM | JOIN_SYM
...@@ -16762,7 +16775,6 @@ reserved_keyword_udt: ...@@ -16762,7 +16775,6 @@ reserved_keyword_udt:
| OTHERS_ORACLE_SYM | OTHERS_ORACLE_SYM
| OUTER | OUTER
| OUTFILE | OUTFILE
| OUT_SYM
| OVER_SYM | OVER_SYM
| PACKAGE_ORACLE_SYM | PACKAGE_ORACLE_SYM
| PAGE_CHECKSUM_SYM | PAGE_CHECKSUM_SYM
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment