SqlScriptDOM
SqlScriptDOM copied to clipboard
TSql160Parser misidentifies interval parameter in DATEDIFF function as ColumnReferenceExpression
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:
- Use the following SQL query:
SELECT DATEDIFF(mm, ColA, ColB) FROM my_table; - Parse the query using TSql160Parser.
- Observe that the interval parameter
mmis 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