uninitialized token indexes in some fragments
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 45/100
Hướng nghiên cứu
Bắt đầu trong SqlScriptDom/Parser/TSql/TSql80.g, khoảng các dòng 6276-6294, và tái hiện hai ví dụ SQL từ issue. Kiểm tra cách các chỉ mục token được gán cho OptimizerHint và StatementList; công việc hoàn tất khi các fragment đó báo cáo đúng chỉ mục token đầu tiên và cuối cùng thay vì -1.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- GAP
- Star
- 277
- Fork
- 43
- Merge trung bình
- 6 ngày 17 giờ
- Pull request đã merge (30 ngày)
- 3
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của microsoft/SqlScriptDOM
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
microsoft/SqlScriptDOM#228 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
microsoft/SqlScriptDOM#183 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 56/100
microsoft/SqlScriptDOM#226 · 1 reaction ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
microsoft/SqlScriptDOM#225 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 58/100
microsoft/SqlScriptDOM#224 ·
Tất cả issue của microsoft/SqlScriptDOM
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
oxc-project/oxc#26944 ·
-
todo:perf
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
-
bug
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 82/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
tenstorrent/tt-metal#57393 · 1 bình luận ·
-
StUnhex.number() misformats Long.MIN_VALUE as scientific notation instead of a plain integer Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
objectionary/eo#8894 ·