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

Improve error handling when using OLD_VALUE as alias name

    XMLWordPrintable

Details

    • Unexpected results

    Description

      13.0.0-dbg>CREATE OR REPLACE TABLE t3(a INT);
      Query OK, 0 rows affected (0.018 sec)
       
      13.0.0-dbg>INSERT INTO t3 VALUES (1);
      Query OK, 1 row affected (0.002 sec)
       
      13.0.0-dbg>UPDATE t3 SET a = 10 RETURNING OLD_VALUE(a) AS old_value;
      ERROR 1064 (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 'old_value' at line 1
      13.0.0-dbg>
      13.0.0-dbg>UPDATE t3 SET a = 10 RETURNING OLD_VALUE(a) AS old_val;
      +---------+
      | old_val |
      +---------+
      |       1 |
      +---------+
      1 row in set (0.003 sec)
       
      13.0.0-dbg>
      

      Attachments

        Issue Links

          Activity

            People

              rucha174 Rucha Deodhar
              ramesh Ramesh Sivaraman
              Votes:
              0 Vote for this issue
              Watchers:
              1 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.