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

parser greedily parses AS OF TIMESTAMP

    XMLWordPrintable

Details

    Description

      In AS OF TIMESTAMP xxx, the TIMESTAMP is always parsed as a part of AS OF, even if it's actually a part of the expression (the complete expression being TIMESTAMP xxx).

      Examples:

      DATETIME literal

      SELECT TIMESTAMP'2016-02-30 08:07:06';
      → ERROR 1525 (HY000): Incorrect DATETIME value: '2016-02-30 08:07:06'
      SELECT * FROM t1 FOR SYSTEM_TIME AS OF TIMESTAMP'2016-02-30 08:07:06';
      → ok
      SELECT * FROM t1 FOR SYSTEM_TIME AS OF (TIMESTAMP'2016-02-30 08:07:06');
      → ERROR 1525 (HY000): Incorrect DATETIME value: '2016-02-30 08:07:06'
      

      two-argument TIMESTAMP() function

      SELECT TIMESTAMP('2003-12-31 12:00:00','12:00:00');
      → ok
      SELECT * FROM t1 FOR SYSTEM_TIME AS OF TIMESTAMP('2003-12-31 12:00:00','12:00:00')
      → ERROR 1241 (21000): Operand should contain 1 column(s)
      SELECT * FROM t1 FOR SYSTEM_TIME AS OF (TIMESTAMP('2003-12-31 12:00:00','12:00:00'));
      → ok
      

      Attachments

        Issue Links

          Activity

            People

              midenok Aleksey Midenkov
              serg Sergei Golubchik
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.