Skip to content

Commit 2f7b1dd

Browse files
committed
MB-65809 MB-71122 Proper handling of defined integer type
We have a couple of types defined in the code for plan stability mode and plan stability error policy. We also have an utility function that deals with potentially different number types in JSON and return an integer representation of the number. The issue with this bug is that the utility function did not properly handle the defined integer types such that it did not properly return the integer value if the input is of one of these defined types. The fix is to add handling of the defined types in the utility function. Change-Id: I0ffeddbdd4af79488b3b12f97baf123e9d416499 Reviewed-on: https://review.couchbase.org/c/query/+/242345 Tested-by: Bingjie Miao <bingjie.miao@couchbase.com> Reviewed-by: Sitaram Vemulapalli <sitaram.vemulapalli@couchbase.com>
1 parent fa51f8e commit 2f7b1dd

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

settings/settings.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,10 @@ func getIntValue(val interface{}, defVal int) (intVal int) {
294294
if value.IsInt(val) {
295295
intVal = int(val)
296296
}
297+
case PlanStabilityMode:
298+
intVal = int(val)
299+
case PlanStabilityErrorPolicy:
300+
intVal = int(val)
297301
}
298302
return intVal
299303
}

0 commit comments

Comments
 (0)