ScriptDom parser for Sql Server 2022 fails to parse exec variable with version
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
Research direction
Start with the TSql160Parser entry point and run the three CREATE PROCEDURE examples from the issue in a .NET 6 console project using Microsoft.SqlServer.DacFx 161.6367.0-preview. Compare parsing of EXEC @ProcName with and without ;2, then trace the parser path for the variable form. Done means the final example parses without an error near the semicolon.
Written by the indexing model from the issue text.
Description
- SqlPackage or DacFx Version: 161.6367.0-preview
- .NET Framework (Windows-only) or .NET Core: .Net 6.0
- Environment (local platform and source/target platforms): N/A
Steps to Reproduce:
- Create a new C# Console Project
- Add latest Nuget package for Microsoft.SqlServer.DacFx (161.6367.0-preview)
- Run code below
using Microsoft.SqlServer.TransactSql.ScriptDom;
var parser = new TSql160Parser(true); // Sql server 2022 parser
IList<ParseError> errors;
parser.Parse(new StringReader("CREATE PROCEDURE Proc1 AS EXEC ProcName;2"), out errors);
// No parsing errors
parser.Parse(new StringReader("CREATE PROCEDURE Proc1 AS DECLARE @ProcName SYSNAME = 'Proc2' EXEC @ProcName"), out errors);
// No parsing errors
parser.Parse(new StringReader("CREATE PROCEDURE Proc1 AS DECLARE @ProcName SYSNAME = 'Proc2' EXEC @ProcName;2"), out errors);
// Parsing error! "Incorrect syntax near ;." This should parse succesfully
Did this occur in prior versions? If not - which version(s) did it work in?
Not work in all prior versions.
(DacFx/SqlPackage/SSMS/Azure Data Studio)
- Dominant language
- GAP
- Stars
- 277
- Forks
- 43
- Avg merge
- 6d 17h
- Merged PRs (30d)
- 3
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/SqlScriptDOM
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
microsoft/SqlScriptDOM#228 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
microsoft/SqlScriptDOM#183 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 56/100
microsoft/SqlScriptDOM#226 · 1 reaction ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
microsoft/SqlScriptDOM#225 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 58/100
microsoft/SqlScriptDOM#224 ·
All issues in microsoft/SqlScriptDOM
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
internal.h中,漏掉了1个定义。 Open
Difficulty 1/5 Under an hour Newbie friendliness 95/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
oxc-project/oxc#26944 ·