Commit bcc3e74
Address review feedback: fix variable registration for deferred label check
When the deferred label validity check (DML predecessor + non-existent
label) found an invalid label, the code skipped transform_match_pattern()
entirely, which meant MATCH-introduced variables were never registered
in the namespace. This would cause errors if a later clause referenced
those variables (e.g., RETURN p).
Fix: mirror the early-check strategy by injecting a paradoxical WHERE
(true = false) and always calling transform_match_pattern(). Variables
get registered normally; zero rows are returned via the impossible qual.
Also add ORDER BY to multi-row regression tests for deterministic output,
and add a test case for DML predecessor + non-existent label + returning
a MATCH-introduced variable.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent d2d7245 commit bcc3e74
File tree
3 files changed
+37
-18
lines changed- regress
- expected
- sql
- src/backend/parser
3 files changed
+37
-18
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3652 | 3652 | | |
3653 | 3653 | | |
3654 | 3654 | | |
3655 | | - | |
| 3655 | + | |
3656 | 3656 | | |
3657 | 3657 | | |
3658 | 3658 | | |
| |||
3677 | 3677 | | |
3678 | 3678 | | |
3679 | 3679 | | |
3680 | | - | |
| 3680 | + | |
3681 | 3681 | | |
3682 | 3682 | | |
3683 | 3683 | | |
| |||
3694 | 3694 | | |
3695 | 3695 | | |
3696 | 3696 | | |
| 3697 | + | |
| 3698 | + | |
| 3699 | + | |
| 3700 | + | |
| 3701 | + | |
| 3702 | + | |
| 3703 | + | |
| 3704 | + | |
| 3705 | + | |
| 3706 | + | |
| 3707 | + | |
| 3708 | + | |
3697 | 3709 | | |
3698 | 3710 | | |
3699 | 3711 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1506 | 1506 | | |
1507 | 1507 | | |
1508 | 1508 | | |
1509 | | - | |
| 1509 | + | |
1510 | 1510 | | |
1511 | 1511 | | |
1512 | 1512 | | |
| |||
1522 | 1522 | | |
1523 | 1523 | | |
1524 | 1524 | | |
1525 | | - | |
| 1525 | + | |
1526 | 1526 | | |
1527 | 1527 | | |
1528 | 1528 | | |
| |||
1531 | 1531 | | |
1532 | 1532 | | |
1533 | 1533 | | |
| 1534 | + | |
| 1535 | + | |
| 1536 | + | |
| 1537 | + | |
| 1538 | + | |
| 1539 | + | |
| 1540 | + | |
| 1541 | + | |
| 1542 | + | |
1534 | 1543 | | |
1535 | 1544 | | |
1536 | 1545 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2918 | 2918 | | |
2919 | 2919 | | |
2920 | 2920 | | |
2921 | | - | |
2922 | | - | |
2923 | 2921 | | |
2924 | 2922 | | |
2925 | 2923 | | |
| |||
2971 | 2969 | | |
2972 | 2970 | | |
2973 | 2971 | | |
2974 | | - | |
| 2972 | + | |
| 2973 | + | |
| 2974 | + | |
| 2975 | + | |
| 2976 | + | |
| 2977 | + | |
| 2978 | + | |
| 2979 | + | |
| 2980 | + | |
| 2981 | + | |
| 2982 | + | |
2975 | 2983 | | |
2976 | 2984 | | |
2977 | 2985 | | |
2978 | | - | |
2979 | | - | |
2980 | | - | |
2981 | | - | |
2982 | | - | |
2983 | | - | |
2984 | | - | |
2985 | | - | |
2986 | | - | |
2987 | | - | |
2988 | | - | |
| 2986 | + | |
2989 | 2987 | | |
2990 | 2988 | | |
2991 | 2989 | | |
| |||
0 commit comments