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

Regression in parsing statement in Microsoft.SqlServer.Management.SqlParser. #1447

Open
brettshearer opened this issue Mar 29, 2022 · 1 comment

Comments

@brettshearer
Copy link

The latest version of Microsoft.SqlServer.Management.SqlParser fails to parse the following statement

create index f on t (y) with (resumable=on)

It fails with and incorrectly handled null.

nhandled exception. Microsoft.SqlServer.Management.SqlParser.SqlParserInternalParserError: Internal Parser Error
---> System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.SqlServer.Management.SqlParser.SqlCodeDom.SqlCreateIndexStatement..ctor(Boolean isUnique, SqlClusterOption clusterOption, SqlIdentifier name, SqlObjectIdentifier targetObject, IEnumerable1 indexedColumns, IEnumerable1 includedColumns, SqlFilterClause filterClause, IEnumerable1 options, SqlStorageSpecification storageSpecification, SqlStorageSpecification fileStreamStorageSpecification) at Microsoft.SqlServer.Management.SqlParser.SqlCodeDom.SqlCreateIndexStatement..ctor(CreateIndexStart createIndexStart, SqlIdentifier name, SqlObjectIdentifier targetObject, CreateIndexKeyList createIndexKeyList, SqlFilterClause filterClause, IEnumerable1 options, SqlStorageSpecification storageSpecification, SqlStorageSpecification fileStreamStorageSpecification)
at Microsoft.SqlServer.Management.SqlParser.Parser.Internals160.Parser.DoAction_900_949(Int32 action)
at Microsoft.SqlServer.Management.SqlParser.Parser.Internals160.Parser.DoAction(Int32 action)
at Babel.ParserGenerator.ShiftReduceParser.Reduce(Int32 rule_nr)
at Babel.ParserGenerator.ShiftReduceParser.DoParse()
at Babel.ParserGenerator.ShiftReduceParser.Parse(Boolean isIncremental, ParserScanner inputScanner, ParseContext parseContext, ReusableStatementsCollection reusableStmts)
at Microsoft.SqlServer.Management.SqlParser.Parser.Internals.VersionedParserBase.Parse(Boolean isIncremental, String sql, SqlScript prevScript, ParseOptions options, ParseOptions& resultOptions)
--- End of inner exception stack trace ---
at Microsoft.SqlServer.Management.SqlParser.Parser.Internals.VersionedParserBase.Parse(Boolean isIncremental, String sql, SqlScript prevScript, ParseOptions options, ParseOptions& resultOptions)
at Microsoft.SqlServer.Management.SqlParser.Parser.Parser.Parse(Boolean isIncremental, String sql, ParseResult prevResult, ParseOptions options, ParseOptions& resultOptions)
at Microsoft.SqlServer.Management.SqlParser.Parser.Parser.Parse(String sql, ParseOptions options, ParseOptions& resultOptions)
at Microsoft.SqlServer.Management.SqlParser.Parser.Parser.Parse(String sql, ParseOptions options)
at Program.

$(String[] args) in C:\git\wtg\CargoWise\ConsoleApp4\ConsoleApp4\Program.cs:line 23

Previous versions would have correctly reported this syntax failure to the Errors property.

@shueybubbles
Copy link
Contributor

Which previous versions have you used successfully? I think people have added some options to the grammar without updating this constructor for multiple releases.

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

2 participants