Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-20913

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 10.5
    • Fix Version/s: 10.5.0
    • Component/s: Parser
    • Labels:
      None

      Description

      The below CREATE FUNCTION statements understand INET6 in both parameter list and in the RETURNS clause

      SET sql_mode='';
      CREATE OR REPLACE FUNCTION f1() RETURNS INET6 RETURN NULL;
      CREATE OR REPLACE FUNCTION f1(a INET6) RETURNS INT RETURN NULL;
      

      Equivalent CREATE FUNCTION statements in sql_mode=ORACLE return a syntax error:

      SET sql_mode=ORACLE;
      DELIMITER $$
      CREATE OR REPLACE FUNCTION f1() RETURN INET6 AS
      BEGIN
        RETURN NULL;
      END;
      $$
      DELIMITER ;
      

      ERROR 1064 (42000): You have an error in your SQL syntax ... near 'INET6 AS
      BEGIN
        RETURN NULL;
      END' at line 1
      

      SET sql_mode=ORACLE;
      DELIMITER $$
      CREATE OR REPLACE FUNCTION f1(a INET6) RETURN INT AS
      BEGIN
        RETURN NULL;
      END;
      $$
      DELIMITER ;
      

      ERROR 1064 (42000): You have an error in your SQL syntax ... near ') RETURN INT AS
      BEGIN
        RETURN NULL;
      END' at line 1
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              bar Alexander Barkov
              Reporter:
              bar Alexander Barkov
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: