Skip to content
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

TSql160Parser misidentifies interval parameter in DATEDIFF function as ColumnReferenceExpression #98

Open
sqlrunner opened this issue Oct 10, 2024 · 0 comments

Comments

@sqlrunner
Copy link

sqlrunner commented Oct 10, 2024

The TSql160Parser incorrectly identifies the interval parameter in the DATEDIFF function as a ColumnReferenceExpression. This issue occurs when parsing expressions like DATEDIFF(mm, ColA, ColB).

Reproduction Steps:

  1. Use the following SQL query: SELECT DATEDIFF(mm, ColA, ColB) FROM my_table;
  2. Parse the query using TSql160Parser.
  3. Observe that the interval parameter mm is identified as a ColumnReferenceExpression.

Expected Behavior:
The interval parameter mm should be identified as a Literal or Identifier, not a ColumnReferenceExpression.

Environment Details:

  • SqlScriptDOM version: 161.9142.1
  • .NET version: 8.0
  • Operating System: Windows 10
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

No branches or pull requests

1 participant