Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

ExecuteAsClause object has wrong LastTokenIndex value

Open
#120 0 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
csharp, sql
Domain
compilers

Research direction

Reproduce the SQL sample with ScriptDom 161.9142.1 at compatibility level 150 and inspect ExecuteAsClause.FirstTokenIndex and LastTokenIndex. Trace the parser's token-span handling for EXECUTE AS OWNER and add regression coverage showing LastTokenIndex reaches OWNER; done when the existing literal-user behavior remains correct.

Written by the indexing model from the issue text.

Description

ScriptDom version: 161.9142.1
Compatibility level: 150

Sample code:

CREATE PROCEDURE foo
WITH EXECUTE AS OWNER
AS;

Here for the ExecuteAsClause instance values of FirstTokenIndex and LastTokenIndex are equal and pointing to the token representing word EXECUTE which is wrong: FirstTokenIndex is fine but LastTokenIndex should be pointing to the token representing OWNER keyword.

Image

If EXECUTE AS is specified with user name literal then everything is fine, LastTokenIndex is correct.


ExecuteAsClause.LastTokenIndex should be pointing to the very last word of the clause.

Dominant language
GAP
Stars
277
Forks
43
Avg merge
6d 17h
Merged PRs (30d)
3

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/SqlScriptDOM

All issues in microsoft/SqlScriptDOM

Similar issues

More Compilers issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.