Skip to content

Fix #1979: Add GETDATE, NOW as aliases and allow CURRENT_TIMESTAMP() #2121

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

loubnaB023
Copy link

This PR fixes #1979 by extending the parser to recognize additional datetime functions and aliases.

Changes:

  1. Updated alasqlparser.jison:

    • Added lexer tokens for NOW, GETDATE, and CURRENT_TIMESTAMP
    • Enhanced PrimitiveValue and FuncValue to support:
      • CURRENT_TIMESTAMP with/without parentheses
      • NOW() and GETDATE() as valid functions
  2. Rebuilt the parser

  3. Added test/test-now.js to verify parsing of:

    • SELECT NOW()
    • SELECT GETDATE()
    • SELECT CURRENT_TIMESTAMP()
    • SELECT CURRENT_TIMESTAMP
    • SELECT CURRENT_DATE
    • SELECT CURDATE()
openSourcePassingTest

@mathiasrw
Copy link
Member

Nice. Very nice.

Please rename the test file to test1979.

Please make sure the test file will verify the output of each query that is now supported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add GETDATE, NOW as alias to parser + allow CURRENT_TIMESTAMP with parenthesis
2 participants