Skip to content

Commit f8d4eb1

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

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

sql/system_booltype.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,9 @@ func (t systemBoolType) Convert(v interface{}) (interface{}, error) {
103103
// Therefore, if the float doesn't have a fractional portion, we treat it as an int.
104104
if value == float64(int64(value)) {
105105
if value >= float64(math.MinInt64) && value <= float64(math.MaxInt64) {
106-
if intVal := int64(value); intVal >= math.MinInt8 && intVal <= math.MaxInt8 {
107-
return t.Convert(intVal)
106+
intVal := int64(value)
107+
if intVal >= math.MinInt8 && intVal <= math.MaxInt8 {
108+
return int8(intVal), nil
108109
}
109110
return nil, ErrInvalidSystemVariableValue.New(t.varName, v)
110111
}

0 commit comments

Comments
 (0)