You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "yoabot-droid (via GitHub)" <gi...@apache.org> on 2026/02/23 12:15:07 UTC
[PR] MSSQL: prevent statement-starting keywords from being consumed as implicit aliases [datafusion-sqlparser-rs]
yoabot-droid opened a new pull request, #2233:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2233
## Problem
In T-SQL multi-statement scripts delimited by newlines, the parser was consuming statement-starting keywords (`DECLARE`, `EXEC`/`EXECUTE`, `INSERT`, `UPDATE`, `DELETE`, `DROP`, `CREATE`, `ALTER`, `TRUNCATE`, `PRINT`, `WHILE`, `RETURN`, `THROW`, `RAISERROR`, `MERGE`) as implicit aliases for the preceding `SELECT` item or table reference, then failing on the next token.
## Fix
Extended `is_select_item_alias()` and `is_table_factor_alias()` in `MsSqlDialect` to return `false` for all of these keywords, matching the existing treatment of `IF` and `ELSE`.
## Test
Adds `test_tsql_statement_keywords_not_implicit_aliases` covering column and table alias cases across the full affected keyword set.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org