Keep the whole text when a non-string value is concatenated with a string (`+`, `CONCAT`)
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
- 30/100
Hướng nghiên cứu
No file is named, so start where + and CONCAT are translated into PostgreSQL SQL and where the width of a string result is derived from its operands' classes (NUMERIC[p,s], DOUBLE, COLOR, INTERVAL); that width computation is what truncates the text. Reproduce with the lsf script from the report posted to /eval and compare against the table of failing expressions. Done means all listed cases return the full text, an unrepresentable value such as the GROUP SUM case raises an error instead of being cut, and a regression test covers the cases.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Description
On PostgreSQL, + and CONCAT can silently discard the end of their result when an operand is not a string. For the bounded results shown here, NUMERIC[p,s] contributes p characters to the width of the result, DOUBLE contributes 20, and COLOR and INTERVAL contribute 8 each. With a literal separator, CONCAT also counts its width between the operands. A decimal point or a minus sign can take a numeric value beyond its share of the width, and a DOUBLE can take more than 20 characters. When the combined text exceeds the width of the result, the excess is cut without an error or a warning. The lost characters can belong to the value or to the text that follows it, and a chain of + can lose them at an intermediate step.
This self-contained script is sent to /eval:
price = DATA LOCAL NUMERIC[5,2] ();
run() {
price() <- 123.45;
EXPORT FROM
rate = 'rate: ' + 1.5,
price = 'price: ' + price(),
negative = 'negative: ' + (-price()),
line = (CONCAT ' | ', price(), price(), 'end'),
explicit = 'price: ' + STRING(price());
}
Response (7.0-SNAPSHOT master and 6.3-SNAPSHOT, PostgreSQL 18):
{"rate":"rate: 1.","price":"price: 123.4","negative":"negative: -123.","line":"123.45 | 123.45 | e","explicit":"price: 123.45"}
Expected: rate: 1.5, price: 123.45, negative: -123.45, 123.45 | 123.45 | end.
More results of the same kind:
| Expression | Result | Expected |
|---|---|---|
'r=' + 0.25 |
r=0.2 |
r=0.25 |
'r=' + (-0.25) |
r=-0. |
r=-0.25 |
1.5 + ' end' |
1.5 en |
1.5 end |
'sum=' + (GROUP SUM price(i)), the class of the sum is NUMERIC[5,2], the total is 1234.50 |
sum=1234. |
sum=1234.50 |
'd=' + value() + '!', value is a DOUBLE property holding 1.2345678901234568e-05 |
d=1.2345678901234568e-! |
d=1.2345678901234568e-05! |
'c=' + RGB(0, 0, 0) + '!' |
c=-1677721! |
c=-16777216! |
'i=' + interval(2026_01_05, 2026_01_10) + '!' |
i=17675712! |
i=1767571200000.1768003200000! |
MESSAGE shows the cut text: MESSAGE CONCAT '|', price(), price(), price(), price(), 'end'; shows 123.45|123.45|123.45|123.45, with no sign that |end is missing.
A wider string operand leaves room for the value: STRING[10]('r=') + 0.25 is r=0.25. In the probes 'price: ' + STRING(price()), a CONCAT with a TEXT operand and 'price: ${price()}' kept the whole value. Converting a result that is already cut to STRING or TEXT does not bring its end back.
Reason
The value in the result is wrong, not just shorter: 123.4 and -123. are valid numbers, so nothing tells the reader that a digit is missing, and in a CONCAT of several values the lost end reads as "there was nothing more". In the reported case, the last lines of a diagnostic message disappeared.
Fix
Preserve the complete text of numbers and of the other non-string values, the separators and the surrounding text. If a value that does not fit its class (the GROUP SUM case) cannot be represented, report an error instead of returning a part of it.
- Ngôn ngữ chính
- Java
- Star
- 214
- Fork
- 46
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Không có 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 lsfusion/platform
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
-
bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 62/100
-
bug
Độ khó 4/5 1-2 ngày Mức phù hợp với người mới 58/100
Tất cả issue của lsfusion/platform
Issue tương tự
-
account assessment course feature lecture
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
Maintainer thường phản hồi trong vòng 1 ngày
-
app:learninggoalhub enhancement good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 86/100
Maintainer thường phản hồi trong vòng 1 ngày
-
PropertyResolver fails on JDK classes with a non-public field named like the propertyCó thể đã có người làm @vaibhavgupta443 đã nhận hôm nay. Đang mởgood first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
apache/wicket#1991 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100