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

Unexpected sytax error in "FOR system_time IN 1..3 DO"

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.3, 10.4
    • 10.4
    • Parser
    • None

    Description

      This script works fine:

      DELIMITER $$
      FOR i IN 1..3 DO
        SELECT i;
      END FOR;
      $$
      DELIMITER ;
      

      This script returns an error:

      DELIMITER $$
      FOR system_time IN 1..3 DO
        SELECT system_time;
      END FOR;
      $$
      DELIMITER ;
      

      ERROR 1064 (42000): You have an error in your SQL syntax...near 'system_time IN 1..3 DO
      

      Looks wrong. It should work like the first script.
      FOR SYSTEM_TIME should have a special meaning only in certain contexts.
      In a FOR loop, SYSTEM_TIME should be treated like a normal index variable.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:

              Git Integration

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