Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dbcheck: fixes for eliminate_orphaned_path_records and repair_bad_paths
eliminate_orphaned_path_records: * will no longer remove paths that a subpaths of other paths. * will run even if bvfs is used, as the fix described above will prevent harm to the bvfs structures. repair_bad_paths: * prevents modifying the empty path entry (""). This entry is used as parent directory, even parent of "/".
- Loading branch information
1 parent
f49af88
commit 957687e
Showing
10 changed files
with
91 additions
and
20 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# | ||
# dbcheck: eliminate_orphaned_path_records | ||
# | ||
# get all Paths not used by Files | ||
# and are not substrings to others Paths. | ||
# | ||
# LIKE: _% wildcard, but at least one character | ||
# | ||
SELECT DISTINCT ParentPath.PathId,File.PathId,ParentPath.Path | ||
FROM Path AS ParentPath LEFT OUTER JOIN File USING(PathId) | ||
WHERE File.PathId IS NULL | ||
AND NOT EXISTS (SELECT 1 FROM Path WHERE Path LIKE ParentPath.Path || '_%%') | ||
LIMIT 300000 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# | ||
# dbcheck: eliminate_orphaned_path_records | ||
# | ||
# get all Paths not used by Files | ||
# and are not substrings to others Paths. | ||
# | ||
# LIKE: _% wildcard, but at least one character | ||
# | ||
SELECT DISTINCT ParentPath.PathId,File.PathId,ParentPath.Path | ||
FROM Path AS ParentPath LEFT OUTER JOIN File USING(PathId) | ||
WHERE File.PathId IS NULL | ||
AND NOT EXISTS (SELECT 1 FROM Path WHERE Path LIKE CONCAT(ParentPath.Path,'_%%')) | ||
LIMIT 300000 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# | ||
# dbcheck: repair_bad_paths | ||
# | ||
SELECT PathId, Path FROM Path | ||
WHERE Path != '' | ||
AND Path NOT LIKE '%%/' | ||
|
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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