#3341 String length validation with Postgres PGobject (JSON/JSONB)

This commit is contained in:
Rob Bygrave
2024-03-02 10:06:22 +13:00
parent 5fa09a6f90
commit 9e461e4708
@@ -35,7 +35,9 @@ public interface BindMaxLength {
@Override
public long length(int dbLength, Object obj) {
if (obj instanceof String) {
if (obj == null) {
return -1;
} else if (obj instanceof String) {
String s = (String) obj;
return utf8String(dbLength, s);
} else if (obj instanceof byte[]) {
@@ -69,7 +71,9 @@ public interface BindMaxLength {
@Override
public long length(int dbLength, Object obj) {
if (obj instanceof String) {
if (obj == null) {
return -1;
} else if (obj instanceof String) {
return ((String) obj).length();
} else if (obj instanceof byte[]) {
return ((byte[]) obj).length;