BACKUP_PRIORITY does not parse while using clause ADD REPLICA ON
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 68/100
Research direction
Start with the TSql180Parser and TSql170Parser handling for ALTER AVAILABILITY GROUP, using the provided SQL script as the reproduction case. Trace the ADD REPLICA ON and GRANT CREATE ANY DATABASE clauses, then verify that the script parses without the reported errors for both parser versions.
Written by the indexing model from the issue text.
Description
Version - 180.78.1
Parser - TSql180Parser and TSql170Parser
- BACKUP_PRIORITY does not parse while using clause ADD REPLICA ON it expects APPLY_DELAY instead.
- GRANT, CREATE and ANY does not parse in ALTER AVAILABILITY GROUP Clause.
Steps to reproduce -
Try parsing the below SQL script with the parser:
ALTER AVAILABILITY GROUP [SalesAG]
ADD REPLICA ON 'SQL-NODE03\PROD_INSTANCE' WITH (ENDPOINT_URL = 'TCP://SQL-NODE03.corp.local:5022', FAILOVER_MODE = MANUAL, AVAILABILITY_MODE = ASYNCHRONOUS_COMMIT, BACKUP_PRIORITY = 50, SEEDING_MODE = AUTOMATIC, PRIMARY_ROLE(READ_ONLY_ROUTING_LIST = ('SQL-NODE03\PROD_INSTANCE', 'SQL-NODE02\PROD_INSTANCE')), SECONDARY_ROLE(READ_ONLY_ROUTING_URL = 'TCP://SQL-NODE02.corp.local:1433', ALLOW_CONNECTIONS = ALL));
ALTER AVAILABILITY GROUP [SalesAG] GRANT CREATE ANY DATABASE;
Example -
using Microsoft.SqlServer.TransactSql.ScriptDom;
internal class Program
{
static void Main(string[] args)
{
var script = "Example Script";
var parser = new TSql180Parser(true);
var fragment = parser.Parse(new StringReader(script), out var parseErrors);
if (parseErrors.Count > 0)
{
foreach(var parseError in parseErrors)
Console.WriteLine(parseError.Message);
}
else
{
Console.WriteLine("Parsed successfully");
}
}
}
Error message :-
Expected APPLY_DELAY but encountered BACKUP_PRIORITY instead.
Incorrect syntax near 'GRANT'.
Incorrect syntax near 'CREATE'.
Incorrect syntax near 'ANY'.```
- 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
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
objectionary/jeo-maven-plugin#1774 ·
-
compiler/runtime
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
bot-triaged module: correctness (silent) module: fx release triage triage review
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
objectionary/eo#8869 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
EricSpencer00/Resilient#4824 · 1 comment ·