Open brettshearer opened 2 years ago
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
1 indexedColumns, IEnumerable
1 options, SqlStorageSpecification storageSpecification, SqlStorageSpecification fileStreamStorageSpecification) at Microsoft.SqlServer.Management.SqlParser.SqlCodeDom.SqlCreateIndexStatement..ctor(CreateIndexStart createIndexStart, SqlIdentifier name, SqlObjectIdentifier targetObject, CreateIndexKeyList createIndexKeyList, SqlFilterClause filterClause, IEnumerable
Previous versions would have correctly reported this syntax failure to the Errors property.
Which previous versions have you used successfully? I think people have added some options to the grammar without updating this constructor for multiple releases.
The latest version of Microsoft.SqlServer.Management.SqlParser fails to parse the following statement
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, IEnumerable$(String[] args) in C:\git\wtg\CargoWise\ConsoleApp4\ConsoleApp4\Program.cs:line 23
1 indexedColumns, IEnumerable
1 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, IEnumerable
1 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.Previous versions would have correctly reported this syntax failure to the Errors property.