Skip to content

Commit 4a2ac39

Browse files
Potential fix for code scanning alert no. 396: Incorrect conversion between integer types
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
1 parent 3b93296 commit 4a2ac39

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sql/system_enumtype.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ func (t systemEnumType) Convert(v interface{}) (interface{}, error) {
104104
case float64:
105105
// Float values aren't truly accepted, but the engine will give them when it should give ints.
106106
// Therefore, if the float doesn't have a fractional portion, we treat it as an int.
107-
if value >= float64(math.MinInt) && value <= float64(math.MaxInt) && value == float64(int(value)) {
107+
if value >= 0 && value <= float64(math.MaxInt) && value == float64(int(value)) {
108108
return t.Convert(int(value))
109109
}
110110
return nil, ErrInvalidSystemVariableValue.New(t.varName, value)

0 commit comments

Comments
 (0)