Change GetParserDBPath logic
authorIlho Kim <ilho159.kim@samsung.com>
Thu, 11 Mar 2021 06:22:42 +0000 (15:22 +0900)
committer김일호/Tizen Platform Lab(SR)/Engineer/삼성전자 <ilho159.kim@samsung.com>
Thu, 11 Mar 2021 06:39:27 +0000 (15:39 +0900)
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
src/common/database/db_handle_provider.cc

index a1a27f61b51f84820a9f93bd328c678dfce01029..28c7c0d26795d6915605186527d8f611a7f473fd 100644 (file)
@@ -105,17 +105,21 @@ std::vector<std::string> DBHandleProvider::GetParserDBPath(pid_t pid) {
     SetMemoryMode(pid, is_memory_global_);
 
   if (is_memory_ && pid_list_.find(pid) == pid_list_.end()) {
-    db_path_list.emplace_back(parser_memory_db_path_);
-    if (parser_memory_db_path_ != global_parser_memory_db_path_)
-      db_path_list.emplace_back(global_parser_memory_db_path_);
+    if (uid_ > REGULAR_USER)
+      db_path_list.emplace_back(parser_memory_db_path_);
+    db_path_list.emplace_back(global_parser_memory_db_path_);
   } else {
-    db_path_list.emplace_back(parser_file_db_path_);
-    if (parser_file_db_path_ != global_parser_file_db_path_)
-      db_path_list.emplace_back(global_parser_file_db_path_);
+    if (uid_ > REGULAR_USER)
+      db_path_list.emplace_back(parser_file_db_path_);
+    db_path_list.emplace_back(global_parser_file_db_path_);
   }
-  LOGD("local db path : %s", db_path_list[0].c_str());
-  if (db_path_list.size() == 2)
+
+  if (db_path_list.size() == 1) {
+    LOGD("global db path : %s", db_path_list[0].c_str());
+  } else {
+    LOGD("local db path : %s", db_path_list[0].c_str());
     LOGD("global db path : %s", db_path_list[1].c_str());
+  }
 
   return db_path_list;
 }