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

OLD_VALUE wrong value in the expression and syntax error

    XMLWordPrintable

Details

    • Unexpected results

    Description

      CREATE TABLE t ( id INT PRIMARY KEY, a INT );
      INSERT INTO t VALUES ( 1, 1 );
      UPDATE t SET a = 2 WHERE id = 1 RETURNING OLD_VALUE( a ), 0+(OLD_VALUE(a));
      

      returns

      1 2

      Reported by Ben Bidner (Automattic.com Security Team).

      Also without parentheses around OLD_VALUE:

      UPDATE t SET a = 2 WHERE id = 1 RETURNING OLD_VALUE( a ), 0+OLD_VALUE(a);
      

      it's a syntax error.

      Attachments

        Activity

          People

            rucha174 Rucha Deodhar
            serg Sergei Golubchik
            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.