phpmyadmin / phpmyadmin/sql-parser

Support multiple-table syntax of DELETE statement

Open
#257 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
PHP
Stars
485
Forks
119
PR merge metrics
No merged PRs in 30d

Description

Docs: https://dev.mysql.com/doc/refman/8.0/en/delete.html#idm140219041342912

There are two possible forms of multiple-table delete statement (queries based on this tutorial):

  • DELETE t1, t2 FROM t1 INNER JOIN t2 ON t2.ref = t1.id WHERE t1.id = 1
  • DELETE FROM t1, t2 USING t1 INNER JOIN t2 ON t2.ref = t1.id WHERE t1.id = 1;

Looks like the former one is supported but the latter one is not – it ends up with two ParseExceptions.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing how the parser handles the two multiple-table DELETE forms shown in the issue, using the linked MySQL documentation to confirm the syntax. Reproduce the two ParseExceptions and verify that the DELETE FROM ... USING form parses successfully without regressing the already supported form.

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.