Skip to content

Commit 06824ec

Browse files
authored
fix: use home directory instead of config directory for index paths avoid permission denied (#233)
Changed path directory retrieval from `dirs::config_dir` to `dirs::home_dir` in `analyze.rs`. This ensures the application uses the user's home directory for storing and accessing necessary metadata paths.
1 parent 66feb7c commit 06824ec

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/execution/dml/analyze.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ impl<'a, T: Transaction + 'a> WriteExecutor<'a, T> for Analyze {
9797
}
9898
drop(coroutine);
9999
let mut values = Vec::with_capacity(builders.len());
100-
let dir_path = dirs::config_dir()
100+
let dir_path = dirs::home_dir()
101101
.expect("Your system does not have a Config directory!")
102102
.join(DEFAULT_STATISTICS_META_PATH)
103103
.join(table_name.as_str());
@@ -184,7 +184,7 @@ mod test {
184184
}
185185
let _ = fnck_sql.run("analyze table t1")?;
186186

187-
let dir_path = dirs::config_dir()
187+
let dir_path = dirs::home_dir()
188188
.expect("Your system does not have a Config directory!")
189189
.join(DEFAULT_STATISTICS_META_PATH)
190190
.join("t1");
@@ -227,7 +227,7 @@ mod test {
227227
}
228228
let _ = fnck_sql.run("analyze table t1")?;
229229

230-
let dir_path = dirs::config_dir()
230+
let dir_path = dirs::home_dir()
231231
.expect("Your system does not have a Config directory!")
232232
.join(DEFAULT_STATISTICS_META_PATH)
233233
.join("t1");

0 commit comments

Comments
 (0)