You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ne on an array attribute returns different rows on the index scan and the record filter #3951
On an array attribute, ne returns different rows depending on which plan runs it. With sizes: [Int] @indexed, grp: Int @indexed and these records:
id
sizes
1
[25, 25]
2
[25, 30]
3
[30]
4
[]
5
(missing)
query
result
?sizes=ne=number:25
[2, 3] — the index scan: a record with any element other than 25
?grp=1&sizes=ne=number:25
[1, 2, 3, 4, 5] — the record filter compares the whole array with 25
Reproduced on main with an explicit number: prefix, and on a programmatic { elements: { type: 'Int' } } declaration with an untyped value. After the REST condition conversion fix, the untyped form on a GraphQL [Int] attribute behaves the same way.
Results that depend on the plan are wrong either way. The adjacent array-scoping contract (resources/DESIGN.md, chained conditions) already requires indexed and unindexed paths to agree.
Expected
Pick one meaning of ne on an array attribute and apply it on both paths. One option: "no element equals the value", the negation of ==. Another: "some element differs", the index scan's current meaning. Then test it with and without a leading indexed condition, and through a to-many relationship path.
Activity