]> granicus.if.org Git - postgresql/commitdiff
Fix incorrect return value in JSON equality function for scalars
authorMichael Paquier <michael@paquier.xyz>
Mon, 13 May 2019 00:11:50 +0000 (09:11 +0900)
committerMichael Paquier <michael@paquier.xyz>
Mon, 13 May 2019 00:11:50 +0000 (09:11 +0900)
equalsJsonbScalarValue() uses a boolean as return type, however for one
code path -1 gets returned, which is confusing.  The origin of the
confusion is visibly that this code got copy-pasted from
compareJsonbScalarValue() since it has been introduced in d1d50bf.

No backpatch, as this is only cosmetic.

Author: Rikard Falkeborn
Discussion: https://postgr.es/m/CADRDgG7mJnek6HNW13f+LF6V=6gag9PM+P7H5dnyWZAv49aBGg@mail.gmail.com

src/backend/utils/adt/jsonb_util.c

index 3b249fe8cb03efc44bad81ea6d9ffa6396d4353d..1a28d75c59b783eacc3620d116c9cf30cbd9056a 100644 (file)
@@ -1318,7 +1318,7 @@ equalsJsonbScalarValue(JsonbValue *aScalar, JsonbValue *bScalar)
                }
        }
        elog(ERROR, "jsonb scalar type mismatch");
-       return -1;
+       return false;
 }
 
 /*