This is an automated email from the ASF dual-hosted git repository.
andy pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/jena.git
The following commit(s) were added to refs/heads/main by this push:
new 29e8a5601d GH-3489: Check for duplicate variables in VALUES
29e8a5601d is described below
commit 29e8a5601da695741a342059ab9810794f65f7ca
Author: Andy Seaborne <[email protected]>
AuthorDate: Thu Oct 2 12:40:35 2025 +0100
GH-3489: Check for duplicate variables in VALUES
---
.../src/main/java/org/apache/jena/sparql/lang/SPARQLParserBase.java | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git
a/jena-arq/src/main/java/org/apache/jena/sparql/lang/SPARQLParserBase.java
b/jena-arq/src/main/java/org/apache/jena/sparql/lang/SPARQLParserBase.java
index 839e9dc196..4bd16c53d1 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/lang/SPARQLParserBase.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/lang/SPARQLParserBase.java
@@ -272,8 +272,11 @@ public class SPARQLParserBase extends QueryParserBase {
String msg = QueryParseException.formatMessage("Term is not
concrete: "+n, line, col);
throw new QueryParseException(msg, line, col);
}
- if ( n != null )
+ if ( n != null ) {
+ if ( rowBuilder.contains(v) )
+ throw new QueryParseException("Duplicate variable:
?"+v.getName()+" in VALUES block", line, col);
rowBuilder.add(v, n);
+ }
}
protected void finishDataBlockValueRow(int line, int col) {