fix(dynamodb): report too few PartiQL parameters in statement order (#7760)

This commit is contained in:
TATSUNO “Taz” Yasuhiro authored and GitHub committed 2026-11-08 05:21:37 -04:00
1 parent fd8be9afee
commit 767f50e13f
3 files changed
+104 -8

No files matched your search

@@ -1749,8 +1749,7 @@ public class DynamoDbPartiQLParser {
case NULL -> new PVal.Null();
case QUESTION -> {
if (path != null) {
defer("Unsupported data type: Parameter under key " + path + " at "
+ position(t.start(), 1));
defer(refusedMember("Parameter", parent, path) + " at " + position(t));
}
yield resolveParam();
}
@@ -1798,15 +1797,18 @@ public class DynamoDbPartiQLParser {
return new PVal.Null();
}
if (parent != null) {
boolean firstInBag = parent.close == TType.RBAG && parent.items.isEmpty();
defer((firstInBag ? BAG_MEMBER_TYPES : "Unsupported data type: Call under key " + path) + " at "
+ position(name));
defer(refusedMember("Call", parent, path) + " at " + position(name));
}
parseCall(name, false);
deferExpression(expectedValue);
return new PVal.Null();
}
private static String refusedMember(String type, OpenCollection parent, String path) {
boolean firstInBag = parent.close == TType.RBAG && parent.items.isEmpty();
return firstInBag ? BAG_MEMBER_TYPES : "Unsupported data type: " + type + " under key " + path;
}
private static final class OpenCollection {
private final TType close;
private final String path;
@@ -1968,7 +1970,8 @@ public class DynamoDbPartiQLParser {
private PVal resolveParam() {
if (paramIdx >= parameters.size()) {
throw validationEx("Not enough parameters supplied for ? placeholders");
defer("Number of parameters in request and statement don't match.");
return new PVal.Null();
}
JsonNode p = parameters.get(paramIdx++);
String type = DynamoDbAttributeValueValidator.typeOf(p);