Commit 441253b
fix(parser): handle DISTINCT clause in SELECT statements
The grammar rule for SELECT with distinct_clause parsed the DISTINCT
keyword but never assigned the result to SelectStmt.DistinctClause,
causing all DISTINCT information to be silently lost.
Translate the PostgreSQL grammar faithfully:
- distinct_clause DISTINCT returns list_make1(NIL) equivalent
- distinct_clause DISTINCT ON returns the expression list
- Assign $2 to DistinctClause in the SELECT action
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 1ceee52 commit 441253b
File tree
4 files changed
+7612
-7480
lines changed- parser
- parsertest
4 files changed
+7612
-7480
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
150 | | - | |
| 150 | + | |
| 151 | + | |
151 | 152 | | |
152 | 153 | | |
153 | 154 | | |
| |||
7725 | 7726 | | |
7726 | 7727 | | |
7727 | 7728 | | |
7728 | | - | |
| 7729 | + | |
| 7730 | + | |
7729 | 7731 | | |
7730 | 7732 | | |
7731 | 7733 | | |
| |||
7745 | 7747 | | |
7746 | 7748 | | |
7747 | 7749 | | |
7748 | | - | |
7749 | 7750 | | |
7750 | 7751 | | |
7751 | 7752 | | |
| |||
7803 | 7804 | | |
7804 | 7805 | | |
7805 | 7806 | | |
7806 | | - | |
7807 | | - | |
| 7807 | + | |
| 7808 | + | |
7808 | 7809 | | |
7809 | 7810 | | |
7810 | 7811 | | |
7811 | 7812 | | |
| 7813 | + | |
| 7814 | + | |
| 7815 | + | |
| 7816 | + | |
| 7817 | + | |
| 7818 | + | |
7812 | 7819 | | |
| 7820 | + | |
| 7821 | + | |
| 7822 | + | |
7813 | 7823 | | |
7814 | 7824 | | |
7815 | 7825 | | |
| |||
0 commit comments