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

ROW SP variable is allowed in unexpected context

    XMLWordPrintable

Details

    Description

      This script produces no errors:

      CREATE OR REPLACE TABLE t1 (a INT);
      DELIMITER $$
      BEGIN NOT ATOMIC
        DECLARE row ROW(a INT);
        SELECT * FROM t1 ORDER BY row;
      END;
      $$
      DELIMITER ;
      

      It should return an error.

      The same problem is repeatable with HAVING:

      CREATE OR REPLACE TABLE t1 (a INT);
      DELIMITER $$
      BEGIN NOT ATOMIC
        DECLARE row ROW(a INT);
        SELECT * FROM t1 HAVING row;
      END;
      $$
      DELIMITER ;
      

      The same problem is repeatable in LIKE..ESCAPE:

      DELIMITER $$
      BEGIN NOT ATOMIC
        DECLARE a ROW(a INT);
        SELECT 1 LIKE 2 ESCAPE a;
      END;
      $$
      DELIMITER ;
      

      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.