Commit d269c5b
Fix SQL syntax error for mixed named columns and * in SELECT
Dolt was incorrectly allowing queries like `SELECT 'parent' as db, * FROM table`
which MySQL rejects with a syntax error. This implements MySQL's rule that
named expressions cannot appear before unqualified * in SELECT clauses.
The fix:
- Validates SELECT expressions in the existing processing loop
- Rejects named expressions before unqualified * (matches MySQL behavior)
- Allows qualified table.* in any position
- Allows expressions after * (e.g., SELECT *, column)
Fixes dolthub/dolt#9519
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent 60e98ba commit d269c5b
2 files changed
+27
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2969 | 2969 | | |
2970 | 2970 | | |
2971 | 2971 | | |
| 2972 | + | |
| 2973 | + | |
| 2974 | + | |
| 2975 | + | |
| 2976 | + | |
| 2977 | + | |
| 2978 | + | |
| 2979 | + | |
| 2980 | + | |
| 2981 | + | |
| 2982 | + | |
| 2983 | + | |
| 2984 | + | |
| 2985 | + | |
| 2986 | + | |
| 2987 | + | |
| 2988 | + | |
| 2989 | + | |
2972 | 2990 | | |
2973 | 2991 | | |
2974 | 2992 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
44 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
45 | 54 | | |
46 | 55 | | |
47 | 56 | | |
| |||
0 commit comments