Repository navigation
fix(windows): make a new DuckDB file instead of failing with access denied - #4306
Merged
Merged
Conversation
…ng, and open a file New file names that exists as it is
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.
Summary
File::open, a read-only handle, and Windows'FlushFileBuffersneeds write access (ERROR_ACCESS_DENIED, measured onwindows-11-armin run 43823425428). The flush now goes through a handle open for writing, asstorage/upgrade_copies.rsalready does.create_filetests run on every platform now, with the Unix permission checks kept to Unix, and one more for a new file where none was. A DuckDB test that makes a symbolic link is kept to Unix, so the crate's tests build on Windows.Test plan
ANewFileNamedInTheSavePickerIsMadeAndConnects(DuckDB and SQLite, light and dark): names the file in the save picker, connects, the workspace opens. On main it fails for DuckDB on x64 and Arm64 with the form stuck on "Windows refused access to the file" (run 43823425428); SQLite passes.AnExistingFileNamedForANewOneOpensAsItIsWithoutAReplaceQuestion: no Replace question, the status says the file opens as it is, and its tables are there after Connect.NewFileTests(DuckDB and SQLite): make the file, open it again, write to it. Runs on the Windows x64, Arm64 and macOS jobs.cargo test -p tablepro-driver-duckdb --lib create_fileand-p tablepro-driver-sqlite --lib create_file: pass on macOS, and onwindows-11-armwith this fix (run 43825619545).Screenshots
Before, on main (x64 runner, #4304's run): Connect leaves the form on the error.
After: a new file waits for Connect, which now opens the workspace (the UI test checks it on x64 and Arm64).
After: a file that is there opens as it is, with no Replace question.