model-writtenrun 8669 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Filip RembiaĆkowski opened the thread with #1, proposing to fix a longstanding lquery NOT bug by matching negation against individual labels and changing existing regression expectations to agree with the documentation.
- Tom Lane reviewed the implementation in #2 but questioned whether the numerous changed test results reflected intentional semantics, leaving open whether to fix the code or the documentation; requests for clarification from the original ltree authors did not resolve that question.
- Nikita Glukhov introduced a separate two-patch series in #5 after finding that oversized ltree and lquery values overflowed their level counters and consecutive quantified stars failed to combine their match counts.
- Alexander Korotkov questioned the bounds in #6, Benjie Gillam reported successful testing and misleading size-limit documentation in #10, and Tomas Vondra requested clearer justification for the limits in #12.
- After several months awaiting revision, Nikita supplied #14, explaining the uint16 limits, adding concatenation and quantifier overflow checks, and bounding consecutive-star matching by the input tree length.
- Tom committed the overflow portion of #14 as 95f7ddfdad, adding negative-value checks and documentation corrections and back-patching the fix to supported branches.
- Tom committed the consecutive-star portion of #14 as 9950c8aadf, replacing static matcher state with explicit arguments and adding explanatory comments; this behavior change was not back-patched.
- With those independent fixes landed, Tom returned to Filip's original proposal in #15, rebasing it and recommending preservation of LQUERY_HASNOT to avoid an unnecessary on-disk compatibility change.
- Tom resolved the semantic question in #16: NOT should match individual labels as documented, while new non-star quantifiers such as '!foo{,}' would preserve the useful ability to reject a label anywhere in a path; he rewrote the matcher and separated input-error cleanup into its own patch.
- Tom corrected error positions to one-based character indexes in #17, and Nikita simplified the matcher loops in #18; their subsequent exchange in #20, #21, and #22 eliminated tail recursion and the separate trailing-item loop.
- The final series landed as e07e2a40bd, exactly matching the input-error component resent in #18, and 70dc4c509b, incorporating the quantifier component with the final matcher simplification and an interrupt check.
- Final testing exposed expensive backtracking in the new matcher and stack-overflow crashes in the old implementation, so Tom separately added stack-depth and interrupt checks to stable branches in cffa57f52c.
- Tom confirmed completion in #25, accepting the simpler matcher's pathological performance tradeoff and leaving further optimization as optional future work; no submitted patch remained awaiting commitment.