Skip to content

TSql160Parser misidentifies interval parameter in DATEDIFF function as ColumnReferenceExpression #98

@sqlrunner

Description

@sqlrunner

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions