Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect result for refs with composite operands #436

Closed
tsandall opened this issue Aug 30, 2017 · 0 comments
Closed

Incorrect result for refs with composite operands #436

tsandall opened this issue Aug 30, 2017 · 0 comments
Labels

Comments

@tsandall
Copy link
Member

Topdown is producing incorrect results for refs with composite operands (#239):

torin:~$ cat x.rego
package x

p[[1,2]]
p[[1,3]]
p[[2,2]]


q = {
    [1,2],
    [1,3],
    [2,2]
}
torin:~$ ll
torin:~$ opa run x.rego
OPA 0.5.7-dev (commit c25f2b4a, built at 2017-08-29T23:52:26Z)

Run 'help' to see a list of commands.

> data.x.p[[x,2]]
+---+
| x |
+---+
| 1 |
+---+
@tsandall tsandall added the bug label Aug 30, 2017
tsandall added a commit to tsandall/opa that referenced this issue Aug 30, 2017
The evalEqUnify implementation was not returning undo objects in cases
where it should: if unification failed after binding a var, the binding
was not undone and backtracking would proceed with an incorrect binding.
For this to manifest, a query would likely be iterating and performing
pattern matching on a composite value.

Fixes open-policy-agent#436
tsandall added a commit that referenced this issue Aug 30, 2017
The evalEqUnify implementation was not returning undo objects in cases
where it should: if unification failed after binding a var, the binding
was not undone and backtracking would proceed with an incorrect binding.
For this to manifest, a query would likely be iterating and performing
pattern matching on a composite value.

Fixes #436
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant