Skip to content

dolthub/dolt#9519 - Fix SQL syntax error for mixed named columns and * in SELECT #3104

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 17, 2025

Conversation

elianddb
Copy link
Contributor

Fixes dolthub/dolt#9519

  • Validates SELECT expressions in the existing processing loop
  • Rejects named expressions before unqualified *
  • Allows qualified table.* in any position
  • Allows expressions after * (e.g., SELECT *, column)

elianddb and others added 2 commits July 16, 2025 21:56
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 <[email protected]>
Copy link
Contributor

@angelamayxie angelamayxie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@elianddb elianddb merged commit 60a9448 into main Jul 17, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

throw syntax error when * is combined with named columns in select clause
2 participants