CAST function parameter fragment is incorrectly calculated during parsing
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 58/100
Research direction
Start by reproducing the issue with TSql180Parser and TSql170Parser using SELECT CAST('TEST' AS VARCHAR(20)), then inspect how the CAST parameter fragment is calculated. Done means the parameter fragment includes both 'TEST' and AS VARCHAR(20), while parsing still succeeds without errors.
Written by the indexing model from the issue text.
Description
Version - 180.78.1
Parser - TSql180Parser and TSql170Parser
Issue Description : When the fragment for the parameter in CAST function is calculated it consist only the "'Test'" part and does not contain the "AS VARCHAR(20)" section.
Steps to reproduce -
Try parsing the below SQL script with the parser:
SELECT CAST('TEST' AS VARCHAR(20))
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");
}
}
}
Actual Output - Parameter fragment given by the parser - 'TEST'
Expected Output - Parameter fragment - 'TEST' AS VARCHAR(20)
- 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 68/100
microsoft/SqlScriptDOM#222 ·
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
-
Grammar Gap: activated › effect clause › {self} deals damage equal to its power to target creature Openarea:mechanics ready-for-agent
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
fil-donadoni/tolaria#4317 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
objectionary/eo#8869 · 1 comment ·