phpmyadmin / phpmyadmin/sql-parser
SQL Editor unexpected token with numeric db suffix and table name prefix
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 485
- Forks
- 119
- PR merge metrics
- No merged PRs in 30d
Description
Describe the bug
A numeric database suffix combined with a numeric table name prefix causes a false positive SQL editor error.
To Reproduce
Steps to reproduce the behavior:
- Go to any SQL Editor page
- Enter
INSERT INTO foo_1.2_bar SELECT * FROM foo;
or
UPDATE foo_1.2_bar SET a = 1; - See error
Unexpected token (near .2)
Expected behavior
Neither of these should flag as syntax errors
The bug does not affect SELECTs e.g.
SELECT * FROM foo_1.2_bar;
Screenshots
Server configuration
- Operating system: el8
- Database version: 10.11.7-MariaDB
- PHP version: 8.3.6
- phpMyAdmin version: 5.2.1-1
Client configuration
- Browser: Chrome
- Operating system: Win 10
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 from the SQL Editor page and reproduce the error with the INSERT and UPDATE examples using foo_1.2_bar. Compare those results with the working SELECT example, then trace the SQL parser's handling of these statements. Done means both non-SELECT examples no longer report an unexpected token near .2.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- mariadb, php, sql
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100