phpmyadmin / phpmyadmin/sql-parser
Derived tables should require aliases
Open
Nobody has claimed this yet.
enhancement
- Dominant language
- PHP
- Stars
- 485
- Forks
- 119
- PR merge metrics
- No merged PRs in 30d
Description
./bin/lint-query --query "SELECT * FROM table1 JOIN (select * from table2) ON some_column = some_other_column"
This passes the linter, but should fail because the subquery does not have an alias. Running this query in MySQL will return the error Every derived table must have its own alias.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the bin/lint-query entry point and trace how the shown derived-table query is parsed and linted. Reproduce the command, then identify where the missing alias is accepted; done means the query is rejected consistently with MySQL's requirement that every derived table has an alias.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- mysql, php
- Domain
- databases, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100