Atlas › Test

negative_int_value

Exact test identity: go.temporal.io/server/common/sqlquery/TestConvertSqlValue/negative_int_value

Package
go.temporal.io/server/common/sqlquery
Suite / test hierarchy
TestConvertSqlValue/negative_int_value
Test
negative_int_value
Introduced at
query.go ×1 Frontier kind: Joint frontier
Covered ranges
4
Covered lines
6
Covered files
1

Co-introduced tests

1 other test enter at the same concept.

Covered source

Expand a file to inspect source; the > gutter marks covered lines.

go.temporal.io/server/common/sqlquery/query.go 6 covered LOC · 4 ranges

Open complete file

49
50 // ParseValue returns a string, int64 or float64 if the parsing succeeds.
51 > func ParseValue(sqlValue string) (any, error) { query.go
52 > if sqlValue == "" {
53 return "", nil
54 }
55
56 > if sqlValue[0] == '\'' && sqlValue[len(sqlValue)-1] == '\'' { query.go
57 strValue := strings.Trim(sqlValue, "'")
58 return strValue, nil
60
61 // Unquoted value must be a number. Try int64 first.
62 > if intValue, err := strconv.ParseInt(sqlValue, 10, 64); err == nil { query.go
63 > return intValue, nil query.go
64 > }
65
66 // Then float64.