uninitialized token indexes in some fragments
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 45/100
Direzione di ricerca
Inizia in SqlScriptDom/Parser/TSql/TSql80.g intorno alle righe 6276-6294 e riproduci i due esempi SQL dell'issue. Esamina come vengono assegnati gli indici dei token a OptimizerHint e StatementList; il lavoro è completo quando questi frammenti riportano gli indici del primo e dell'ultimo token corretti invece di -1.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Using Microsoft.SqlServer.TransactSql.ScriptDom version 161.9135.0.
For example:
select 1
option(recompile)
gets parsed as:
TOKENS:
0: Select "select"
1: WhiteSpace " "
2: Integer "1"
3: WhiteSpace "\n"
4: Option "option"
5: LeftParenthesis "("
6: Identifier "recompile"
7: RightParenthesis ")"
8: EndOfFile
FRAGMENTS:
TSqlScript {
FirstTokenIndex = 0,
LastTokenIndex = 8,
Batches = [
TSqlBatch {
FirstTokenIndex = 0,
LastTokenIndex = 7,
Statements = [
SelectStatement {
FirstTokenIndex = 0,
LastTokenIndex = 7,
QueryExpression = QuerySpecification {
FirstTokenIndex = 0,
LastTokenIndex = 2,
UniqueRowFilter = NotSpecified,
SelectElements = [
SelectScalarExpression {
FirstTokenIndex = 2,
LastTokenIndex = 2,
Expression = IntegerLiteral {
FirstTokenIndex = 2,
LastTokenIndex = 2,
LiteralType = Integer,
Value = 1,
},
},
],
},
OptimizerHints = [
OptimizerHint {
FirstTokenIndex = -1,
LastTokenIndex = -1,
HintKind = Recompile,
},
],
},
],
},
],
}
where OptimizerHint ends up with -1 in FirstTokenIndex and LastTokenIndex.
I think the issue here is that here
tokens get assigned to vParent and should be assigned to vHint.
Another example:
if 1=1
begin
select 1
end
gets parsed as:
TOKENS:
0: If "if"
1: WhiteSpace " "
2: Integer "1"
3: EqualsSign "="
4: Integer "1"
5: WhiteSpace "\n"
6: Begin "begin"
7: WhiteSpace "\n"
8: WhiteSpace " "
9: Select "select"
10: WhiteSpace " "
11: Integer "1"
12: WhiteSpace "\n"
13: End "end"
14: EndOfFile
FRAGMENTS:
TSqlScript {
FirstTokenIndex = 0,
LastTokenIndex = 14,
Batches = [
TSqlBatch {
FirstTokenIndex = 0,
LastTokenIndex = 13,
Statements = [
IfStatement {
FirstTokenIndex = 0,
LastTokenIndex = 13,
Predicate = BooleanComparisonExpression {
FirstTokenIndex = 2,
LastTokenIndex = 4,
ComparisonType = Equals,
FirstExpression = IntegerLiteral {
FirstTokenIndex = 2,
LastTokenIndex = 2,
LiteralType = Integer,
Value = 1,
},
SecondExpression = IntegerLiteral {
FirstTokenIndex = 4,
LastTokenIndex = 4,
LiteralType = Integer,
Value = 1,
},
},
ThenStatement = BeginEndBlockStatement {
FirstTokenIndex = 6,
LastTokenIndex = 13,
StatementList = StatementList {
FirstTokenIndex = -1,
LastTokenIndex = -1,
Statements = [
SelectStatement {
FirstTokenIndex = 9,
LastTokenIndex = 11,
QueryExpression = QuerySpecification {
FirstTokenIndex = 9,
LastTokenIndex = 11,
UniqueRowFilter = NotSpecified,
SelectElements = [
SelectScalarExpression {
FirstTokenIndex = 11,
LastTokenIndex = 11,
Expression = IntegerLiteral {
FirstTokenIndex = 11,
LastTokenIndex = 11,
LiteralType = Integer,
Value = 1,
},
},
],
},
},
],
},
},
},
],
},
],
}
here StatementList is missing token indexes.
- Lingua principale
- GAP
- Stelle
- 277
- Fork
- 43
- Merge medio
- 6g 17h
- PR unite (30g)
- 3
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di microsoft/SqlScriptDOM
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
microsoft/SqlScriptDOM#228 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
microsoft/SqlScriptDOM#183 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 56/100
microsoft/SqlScriptDOM#226 · 1 reazione ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
microsoft/SqlScriptDOM#225 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 58/100
microsoft/SqlScriptDOM#224 ·
Tutte le issue di microsoft/SqlScriptDOM
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
objectionary/jeo-maven-plugin#1774 ·
-
compiler/runtime
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
leanprover/lean4#15255 ·
-
bot-triaged module: correctness (silent) module: fx release triage triage review
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
-
Grammar Gap: activated › effect clause › {self} deals damage equal to its power to target creature Apertaarea:mechanics ready-for-agent
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
fil-donadoni/tolaria#4317 ·