Skip to content

fix: use filepath.Base for the pulled database file name on Windows, fixes #8998 - #9039

Merged
stasadev merged 1 commit into
ddev:mainfrom
rfay:claude/github-issue-8998-8f4xc6
Nov 2, 2026
Merged

stasadev merged 1 commit into
ddev:mainfrom
rfay:claude/github-issue-8998-8f4xc6

Conversation

@rfay

@rfay rfay commented Nov 1, 2026

Copy link
Copy Markdown
Member

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

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 #8998 with this build:

ddev utility download-ddev --pr 9039

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/session_01UrTUMxizMD9LGuEbdV8r9v


Generated by Claude Code

…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
@rfay
rfay requested a review from a team as a code owner November 1, 2026 21:40
@github-actions github-actions Bot added the bugfix label Nov 1, 2026
@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown

Download this PR's build for your OS and architecture with:

ddev utility download-ddev --pr 9039

Or download the artifact for your OS and architecture directly:

See Testing a PR.

Open in GitHub Codespaces

@stasadev stasadev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@stasadev
stasadev merged commit ce46dbf into ddev:main Nov 2, 2026
46 checks passed
@stasadev
stasadev deleted the claude/github-issue-8998-8f4xc6 branch November 2, 2026 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ddev pull fails on Windows at database import with "Unknown command '\U'", because path.Base is used on a Windows path

3 participants