Skip to content

Commit

Permalink
Verify that table row variable count matches declared variables.
Browse files Browse the repository at this point in the history
  • Loading branch information
gkellogg committed Nov 6, 2023
1 parent 396dd36 commit 59ffbde
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/sparql/grammar/parser11.rb
Original file line number Diff line number Diff line change
Expand Up @@ -974,6 +974,11 @@ class Parser
add_prod_data :row, [:row]
else
Array(data[:rowdata]).each do |ds|
if ds.length < data[:Var].length
raise Error, "Too few values in a VALUE clause compared to the number of variables"
elsif ds.length > data[:Var].length
raise Error, "Too many values in a VALUE clause compared to the number of variables"
end
r = [:row]
ds.each_with_index do |d, i|
r << [vars[i], d] if d
Expand Down

0 comments on commit 59ffbde

Please sign in to comment.