SQL system data type synonym name lost and replaced during parsing
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 42/100
Hướng nghiên cứu
Bắt đầu bằng cách tái hiện các ví dụ NATIONAL CHARACTER VARYING và DOUBLE PRECISION, rồi kiểm tra DatatypeReference.Name.BaseName cùng với SqlDataTypeOption. Xác định nơi quá trình phân tích thay thế hoặc loại bỏ từ đồng nghĩa được cung cấp; công việc hoàn tất khi AST giữ nguyên từng tên kiểu dữ liệu ban đầu đồng thời vẫn giữ lại thông tin kiểu đã được parser chuẩn hóa.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
ScriptDom version: 161.9142.1
Compatibility level: 150
While trying to implement custom TSQL linter rule which should prevent developers from using non-conventional data type names (synonyms) I've faced an issue: ScriptDom modifies type name during parsing. Which makes detection of synonym usage impossible or hard to implement.
For example:
DECLARE
@a NATIONAL CHARACTER VARYING (100)
, @b DOUBLE PRECISION
, @c INTEGER
Here only "INTEGER" synonym (for INT data type) can be easily detected. Data type name for @a is delivered to DatatypeReference.Name.BaseName partially: it contains CHARACTER word only. Yes, "character" is a synonym as well, but not the one that was actually provided.
Moreover, DOUBLE PRECISION gets lost totally: DatatypeReference.Name.BaseName.Value here comes as Float. It's good to know that the parser knows what is what but actual script contents disappeared after parsing - IMHO this is no good.
I'd expect ScriptDom parser to keep what was provided - a full original data type name no matter if it was a UDT or registered sql-server supplied type synonym. As far as I can understand ScriptDom has SqlDataTypeOption for internal needs and this DatatypeReference's property does contain NVarChar and Float as expected for both of mentioned examples above. Seems like BaseName could keep the original type name.
- 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ự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
objectionary/jeo-maven-plugin#1774 ·
-
compiler/runtime
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
-
bot-triaged module: correctness (silent) module: fx release triage triage review
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
-
Grammar Gap: activated › effect clause › {self} deals damage equal to its power to target creature Đang mởarea:mechanics ready-for-agent
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
fil-donadoni/tolaria#4317 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
objectionary/eo#8869 · 1 bình luận ·