Repository navigation
fix(vfs): allow DROP GRAPH when the database path has no extension - #1567
Open
Tyagiquamar wants to merge 1 commit into
Open
Tyagiquamar wants to merge 1 commit into
Tyagiquamar wants to merge 1 commit into
Conversation
Recognize db.<graph> files when the main database path has no extension, matching StorageUtils::getGraphPath. Add vfs regression test. Fixes LadybugDB#1562 Signed-off-by: Tyagiquamar <mohdquamartyagi@gmail.com> Co-authored-by: Cursor <cursoragent@cursor.com>
This branch has not been deployed
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.
Problem
DROP GRAPHfails when the on-disk database path has no file extension (for example/tmp/x/mydb). The graph data file is created asmydb.g1, but deletion is rejected with:Path ... is not within the allowed list of files to be removed.Reported in #1562 for 0.22.x through current
main.Reproduction
/tmp/x/mydb.CREATE GRAPH g1;(creates/tmp/x/mydb.g1).DROP GRAPH g1;raises an IO exception instead of removing the graph files.With
mydb.lbdb(or.db,.kuzu), graph paths look likemydb.g1.lbdbandDROP GRAPHworks.Root cause
isAllowedDeletionPathinlocal_file_system.cpptreats graph database files as deletable only when their extension equals the main database extension (extension == dbExt). For extensionless main DB files,dbExtis empty while graph files usedbBase.<graphName>(e.g.mydb.g1with extension.g1), so the check never matches.Solution
dbExtis non-empty, keep the existingdb.<graph>.<ext>rule unchanged.dbExtis empty, allow paths whose stem equalsdbBaseand whose extension is the graph suffix (matchingStorageUtils::getGraphPath).Tests
VirtualFileSystemDeleteExtensionlessDbGraphFilesintest/common/vfs_test.cppcovering graph file deletion, graph sidecars, rejection of the main DB path, and rejection of unrelated graph paths.Local validation: targeted
types_testrebuild was not completed on this Windows host (full tree reconfigure after pullingmain; priortypes_testbinary absent). Linux CI is expected to run the common test suite.Compatibility
No public API change. Only broadens the allowlist for safe deletion paths already created by
CREATE GRAPHwhen the database file has no extension.Fixes #1562