mirror of
https://github.com/go-vikunja/vikunja.git
synced 2026-03-11 17:48:44 -05:00
Restrict the AND-joined sub-table filter merging to range comparators (>, >=, <, <=) only. Equality and negative comparators (=, !=, in, not in) must remain as separate EXISTS/NOT EXISTS subqueries because each matching value lives in its own row. Merging equality filters like `labels = 4 && labels = 5` into a single EXISTS would produce an unsatisfiable condition (no single row has label_id=4 AND label_id=5). Merging negative filters like `labels != 4 && labels != 5` into NOT EXISTS(label_id IN 4 AND label_id IN 5) would be trivially true. Also fix the join tracking to use the first filter's join type (how the group connects to the previous element) instead of the last.