Repository navigation
fix: use filepath.Base for the pulled database file name on Windows, fixes #8998 - #9039
Merged
Merged
Conversation
…ixes ddev#8998 ## Short Summary (TL;DR) On native Windows, `ddev pull` failed at the database import with `Unknown command '\U'`. DDEV now takes the database name from the file name instead of the whole Windows path. ## The Issue - Fixes ddev#8998 - Probably also the cause of ddev#8572 `importDatabaseBackup` used `path.Base`, which splits only on `/`. On Windows it returned the whole path, so the database name became `C:\Users\...\`. The mysql client then read `\U` in `CREATE DATABASE` as a command. Only providers without `db_import_command` are affected. ## How This PR Solves The Issue It uses `filepath.Base`, which splits on the host's path separator. ## Manual Testing Instructions On native Windows, follow the PowerShell reproduction steps in ddev#8998 with this build: ```bash ddev utility download-ddev --pr 9038 ``` Expect `ddev pull localpull -y --skip-files --skip-confirmation` to end with "Pull succeeded". ## Automated Testing Overview No new test. The existing pull tests run on Linux and macOS, where `path.Base` and `filepath.Base` behave the same. 🤖 Developed with assistance from [Claude Code](https://claude.ai/code) Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01UrTUMxizMD9LGuEbdV8r9v
|
Download this PR's build for your OS and architecture with: ddev utility download-ddev --pr 9039Or download the artifact for your OS and architecture directly:
See Testing a PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Short Summary (TL;DR)
On native Windows,
ddev pullfailed at the database import withUnknown command '\U'. DDEV now takes the database name from the file name instead of the whole Windows path.The Issue
importDatabaseBackupusedpath.Base, which splits only on/. On Windows it returned the whole path, so the database name becameC:\Users\...\. The mysql client then read\UinCREATE DATABASEas a command. Only providers withoutdb_import_commandare affected.How This PR Solves The Issue
It uses
filepath.Base, which splits on the host's path separator.Manual Testing Instructions
On native Windows, follow the PowerShell reproduction steps in #8998 with this build:
Expect
ddev pull localpull -y --skip-files --skip-confirmationto end with "Pull succeeded".Automated Testing Overview
No new test. The existing pull tests run on Linux and macOS, where
path.Baseandfilepath.Basebehave the same.🤖 Developed with assistance from Claude Code
https://claude.ai/code/session_01UrTUMxizMD9LGuEbdV8r9v
Generated by Claude Code