Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrap delete statements in tmp table select #9

Merged
merged 1 commit into from
Nov 27, 2023
Merged

Wrap delete statements in tmp table select #9

merged 1 commit into from
Nov 27, 2023

Conversation

mischabraam
Copy link
Contributor

MySQL won't allow a deletion of records when selecting the same table. This will give the "You can't specify target table for update in FROM clause" error. By wrapping the select statement within an alias wou can make mysql create a temp table. See also https://stackoverflow.com/a/18389545

@thomas-kl1 thomas-kl1 merged commit 1808719 into opengento:master Nov 27, 2023
@thomas-kl1
Copy link
Member

Hello @mischabraam

Thank you for the fix! much appreciated :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants