fix: format float to avoid overflow (#16083)

Signed-off-by: giulianopz <panzironi.giuliano@gmail.com>
This commit is contained in:
Giuliano Panzironi 2025-03-03 10:03:45 +01:00 committed by GitHub
parent 3f0de72da7
commit 2ef8706c27
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 1 deletions

View file

@ -232,7 +232,7 @@ func (node *SubqueryExpr) getSubqueryTimeSuffix() string {
}
func (node *NumberLiteral) String() string {
return fmt.Sprint(node.Val)
return strconv.FormatFloat(node.Val, 'f', -1, 64)
}
func (node *ParenExpr) String() string {

View file

@ -164,6 +164,10 @@ func TestExprString(t *testing.T) {
in: "{``=\"0\"}",
out: `{""="0"}`,
},
{
in: "1048576",
out: "1048576",
},
}
model.NameValidationScheme = model.UTF8Validation