Skip to content

Quote the database name when dropping it in docker_run.sh - #498

Open
jfarin-gda wants to merge 1 commit into
PrestaShop:masterfrom
jfarin-gda:fix/quote-db-name-on-drop
Open

jfarin-gda wants to merge 1 commit into
PrestaShop:masterfrom
jfarin-gda:fix/quote-db-name-on-drop

Conversation

@jfarin-gda

Copy link
Copy Markdown
Questions Answers
Description? With PS_ERASE_DB=1, docker_run.sh runs drop database if exists $DB_NAME; without quoting the name. A name with a hyphen (my-shop) causes SQL error 1064, and set -e stops the script before the install. The name is now quoted with backticks. The same line is updated in the generated copies under base/images/.
Type? bug fix
BC breaks? no
Deprecations? no
Fixed ticket?
How to test? Run the image with PS_INSTALL_AUTO=1, PS_ERASE_DB=1, PS_INSTALL_DB=1 and DB_NAME=my-shop. Before: SQL error 1064. After: the install succeeds. Names without a hyphen work as before.

Tested on images 9, 8.2.7 and 1.7.8, against MariaDB 11.4 and MySQL 5.7 and 8.0 (the fix applied to the script inside the published images, images not rebuilt).

Note: #451 also touches this line by removing the DROP. If it is merged first, this PR can be closed.

@ps-jarvis

Copy link
Copy Markdown

Hello @jfarin-gda!

This is your first pull request on docker repository of the PrestaShop project.

Thank you, and welcome to this Open Source community!

@github-project-automation github-project-automation Bot moved this to Ready for review in PR Dashboard Nov 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Ready for review

Development

Successfully merging this pull request may close these issues.

2 participants