From 005a8458eee99eb6f346f23ad1db706201f3cc72 Mon Sep 17 00:00:00 2001 From: Xwg Date: Sat, 26 Oct 2024 13:10:40 +0800 Subject: [PATCH] fix: use home directory instead of config directory for index paths avoid permission denied 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. --- src/execution/dml/analyze.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/execution/dml/analyze.rs b/src/execution/dml/analyze.rs index c2b1c7b4..7ecf5ccf 100644 --- a/src/execution/dml/analyze.rs +++ b/src/execution/dml/analyze.rs @@ -97,7 +97,7 @@ impl<'a, T: Transaction + 'a> WriteExecutor<'a, T> for Analyze { } drop(coroutine); let mut values = Vec::with_capacity(builders.len()); - let dir_path = dirs::config_dir() + let dir_path = dirs::home_dir() .expect("Your system does not have a Config directory!") .join(DEFAULT_STATISTICS_META_PATH) .join(table_name.as_str()); @@ -184,7 +184,7 @@ mod test { } let _ = fnck_sql.run("analyze table t1")?; - let dir_path = dirs::config_dir() + let dir_path = dirs::home_dir() .expect("Your system does not have a Config directory!") .join(DEFAULT_STATISTICS_META_PATH) .join("t1"); @@ -227,7 +227,7 @@ mod test { } let _ = fnck_sql.run("analyze table t1")?; - let dir_path = dirs::config_dir() + let dir_path = dirs::home_dir() .expect("Your system does not have a Config directory!") .join(DEFAULT_STATISTICS_META_PATH) .join("t1");