Error reporting on element deletion
Open
Nobody has claimed this yet.
bug
- Dominant language
- PHP
- Stars
- 16
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Description
Description
After running a DELETE query an error of the following kind is reported:
SQLSTATE[HY000]: General error
…but it seems the delete runs fine.
Steps to reproduce
I am Executing the following pattern:
DELETE FROM craft_elements
WHERE `type` = 'craft\\elements\\User'
AND `id` NOT IN (n,m … z)
…where n through z is a comma separated list of user IDs to retain.
Additional info
- Craft version: 3.6.4.1
- PHP version: 7.3.1
- Database driver & version: MySQL 5.7.25
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 files, tests, or entry points are identified. Start by reproducing the DELETE query against MySQL 5.7.25 with the reported Craft and PHP versions, then trace where the query's error is reported. Done means a successful deletion no longer produces the misleading SQLSTATE[HY000] error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- mysql, php, sql
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100