phpmyadmin / phpmyadmin/sql-parser
UPDATE with SELECT not supported
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 485
- Forks
- 119
- PR merge metrics
- No merged PRs in 30d
Description
Was using the php-sqllint package (says to report errors here) and got these errors on valid MySQL syntax:
Line 1, col 45 at "(": An expression was expected.
Line 1, col 45 at "(": Unexpected token.
Line 1, col 46 at "SELECT": A new statement was found, but no delimiter between it and the previous one.
Line 1, col 106 at ")": Unexpected token.
Line 1, col 108 at "src": Unexpected token.
Line 2, col 5 at "SET": A new statement was found, but no delimiter between it and the previous one.
The SQL to generate these errors is similar to this (table, column names and values are different):
UPDATE table1 t1, (SELECT `id` FROM table2 WHERE `unique_val` = 1) src
SET t1.ref_to_t2 = src.id
WHERE t1.unique_val = 'unique';
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
No repository file or test is named. Reproduce the reported query through php-sqllint, then trace UPDATE parsing around the parenthesized SELECT and verify that this valid MySQL syntax is accepted without the reported errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- mysql, php
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100