Title: ScriptDom.TSql160Parser fails to parse simple T-SQL expression · Issue #28 · microsoft/SqlScriptDOM · GitHub
Open Graph Title: ScriptDom.TSql160Parser fails to parse simple T-SQL expression · Issue #28 · microsoft/SqlScriptDOM
X Title: ScriptDom.TSql160Parser fails to parse simple T-SQL expression · Issue #28 · microsoft/SqlScriptDOM
Description: Microsoft.SqlServer.DacFx Version 161.6374.0 Reproduced on both .NET 6.0 and .NET 7.0 Windows 11 The Microsoft.SqlServer.TransactSql.ScriptDom.TSql160Parser fails to parse the following expression. We noticed the issue on a much more com...
Open Graph Description: Microsoft.SqlServer.DacFx Version 161.6374.0 Reproduced on both .NET 6.0 and .NET 7.0 Windows 11 The Microsoft.SqlServer.TransactSql.ScriptDom.TSql160Parser fails to parse the following expression....
X Description: Microsoft.SqlServer.DacFx Version 161.6374.0 Reproduced on both .NET 6.0 and .NET 7.0 Windows 11 The Microsoft.SqlServer.TransactSql.ScriptDom.TSql160Parser fails to parse the following expression....
Opengraph URL: https://github.com/microsoft/SqlScriptDOM/issues/28
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"ScriptDom.TSql160Parser fails to parse simple T-SQL expression","articleBody":"- Microsoft.SqlServer.DacFx Version 161.6374.0\r\n- Reproduced on both .NET 6.0 and .NET 7.0\r\n- Windows 11\r\n\r\nThe `Microsoft.SqlServer.TransactSql.ScriptDom.TSql160Parser` fails to parse the following expression.\r\n\r\nWe noticed the issue on a much more complicated and realistic expression but we simplified the repro to the following minimal expression.\r\n\r\nRepro:\r\n\r\n```csharp\r\nusing Microsoft.SqlServer.TransactSql.ScriptDom;\r\n\r\nvar parser = new TSql160Parser(true); //sql server 2022 parser\r\nIList\u003cParseError\u003e errors;\r\n\r\nvar expr = @\"\r\n(\r\n SELECT 1\r\n WHERE (IIF(1 \u003e 0 AND 2 \u003e 1, 1, 0)) = 1\r\n)\";\r\n\r\nvar res = parser.ParseExpression(new StringReader(expr), out errors);\r\n\r\nif (errors?.Count \u003e 0)\r\n Console.WriteLine(errors.First().Message); //ERROR!!!! Incorrect syntax near ).\r\n\r\n```\r\n\r\nTo prove that the given expression is definitely a valid one, you can simply execute the following statement in SSMS and see that SQL SERVER executes the query succesfully.\r\n\r\n```sql\r\nSELECT\r\n(\r\n SELECT 1\r\n WHERE (IIF(1 \u003e 0 AND 2 \u003e 1, 1, 0)) = 1\r\n)\r\n```","author":{"url":"https://github.com/clement911","@type":"Person","name":"clement911"},"datePublished":"2022-11-17T21:50:37.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":34},"url":"https://github.com/28/SqlScriptDOM/issues/28"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:c9e1b9ce-c782-24ad-b5d7-1cca4c4a438b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E0D4:11A76C:11103C5:15C2933:69902994 |
| html-safe-nonce | 6e48841457b70bd91c44958963a9a1a6955d298adf85278e2e415942ad471c2d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMEQ0OjExQTc2QzoxMTEwM0M1OjE1QzI5MzM6Njk5MDI5OTQiLCJ2aXNpdG9yX2lkIjoiMzIyNDA0MjYyNDQyNDg4MDUzMiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | bb91b8af65ee3ac2d78acfb410b8eb705d4778b267fa08c2b366b064b5f29071 |
| hovercard-subject-tag | issue:1683886223 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/SqlScriptDOM/28/issue_layout |
| twitter:image | https://opengraph.githubassets.com/7db033da2676dcc785d95bffb752f1a462868673888585ba17f4a61ebd64f35a/microsoft/SqlScriptDOM/issues/28 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7db033da2676dcc785d95bffb752f1a462868673888585ba17f4a61ebd64f35a/microsoft/SqlScriptDOM/issues/28 |
| og:image:alt | Microsoft.SqlServer.DacFx Version 161.6374.0 Reproduced on both .NET 6.0 and .NET 7.0 Windows 11 The Microsoft.SqlServer.TransactSql.ScriptDom.TSql160Parser fails to parse the following expression.... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | clement911 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 42c603b9d642c4a9065a51770f75e5e27132fef0e858607f5c9cb7e422831a7b |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoft/SqlScriptDOM git https://github.com/microsoft/SqlScriptDOM.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 543316377 |
| octolytics-dimension-repository_nwo | microsoft/SqlScriptDOM |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 543316377 |
| octolytics-dimension-repository_network_root_nwo | microsoft/SqlScriptDOM |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 3b33c5aedc9808f45bc5fcf0b1e4404cf749dac7 |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width