Repository navigation
Commit 2fabaa2
committed
fix(cypher): grow the OPTIONAL fallback buffer in the rel cross-join
An OPTIONAL MATCH with a relationship, whose start and terminal
variables are not bound by an earlier MATCH and whose start node
pattern matches no node, is joined in cross_join_with_rels() with an
empty candidate list. That path sized its output for a single binding,
but the OPTIONAL fallback then kept one row per existing binding with a
plain indexed store, so every row after the first was written past the
end of the allocation.
Route the fallback through binding_out_append(), the growing writer
that the expansion branch of the same function and the other OPTIONAL
fallbacks already use. The node-only join (cross_join_nodes) was fixed
earlier by sizing its buffer for the fallback rows; the relationship
variant kept the unchecked store.
Add a cypher regression test that runs such a query over four bound
functions and asserts one row per function with the optional variables
unbound. Before this change the test runner reported a
heap-buffer-overflow in cross_join_with_rels under ASan.
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>1 parent 80eb92a commit 2fabaa2
2 files changed
Lines changed: 44 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4811 | 4811 | | |
4812 | 4812 | | |
4813 | 4813 | | |
| 4814 | + | |
| 4815 | + | |
| 4816 | + | |
4814 | 4817 | | |
4815 | 4818 | | |
4816 | | - | |
| 4819 | + | |
4817 | 4820 | | |
4818 | 4821 | | |
4819 | 4822 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
715 | 715 | | |
716 | 716 | | |
717 | 717 | | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
718 | 757 | | |
719 | 758 | | |
720 | 759 | | |
| |||
4673 | 4712 | | |
4674 | 4713 | | |
4675 | 4714 | | |
| 4715 | + | |
4676 | 4716 | | |
4677 | 4717 | | |
4678 | 4718 | | |
| |||
0 commit comments