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

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 10.5
    • 10.5.0
    • Parser
    • 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

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

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.