Merge remote-tracking branch 'origin/master' into deliver_pid
authorJunghyun Yeon <jungh.yeon@samsung.com>
Tue, 9 Mar 2021 04:52:48 +0000 (13:52 +0900)
committerJunghyun Yeon <jungh.yeon@samsung.com>
Tue, 9 Mar 2021 04:52:48 +0000 (13:52 +0900)
34 files changed:
src/common/database/abstract_db_handler.cc
src/common/database/abstract_db_handler.hh
src/common/database/appinfo_db_handler.cc
src/common/database/appinfo_db_handler.hh
src/common/database/cert_get_db_handler.cc
src/common/database/cert_get_db_handler.hh
src/common/database/cert_set_db_handler.cc
src/common/database/cert_set_db_handler.hh
src/common/database/db_handle_provider.cc
src/common/database/db_handle_provider.hh
src/common/database/depinfo_db_handler.cc
src/common/database/depinfo_db_handler.hh
src/common/database/pkg_get_db_handler.cc
src/common/database/pkg_get_db_handler.hh
src/common/database/pkg_set_db_handler.cc
src/common/database/pkg_set_db_handler.hh
src/common/database/query_handler.cc
src/common/database/query_handler.hh
src/common/request_handler/abstract_request_handler.cc [new file with mode: 0644]
src/common/request_handler/abstract_request_handler.hh
src/common/request_handler/command_request_handler.cc
src/common/request_handler/get_appinfo_request_handler.cc
src/common/request_handler/get_cert_request_handler.cc
src/common/request_handler/get_depinfo_request_handler.cc
src/common/request_handler/get_pkginfo_request_handler.cc
src/common/request_handler/query_request_handler.cc
src/common/request_handler/set_cert_request_handler.cc
src/common/request_handler/set_pkginfo_request_handler.cc
src/common/socket/abstract_socket.cc
src/common/socket/abstract_socket.hh
src/server/pkg_request.cc
src/server/pkg_request.hh
src/server/worker_thread.cc
test/unit_tests/test_database.cc

index d0e002b..3296c46 100644 (file)
@@ -216,7 +216,10 @@ static int __open_write_db(uid_t uid, const char *path, sqlite3 **db, int flags)
 namespace pkgmgr_common {
 namespace database {
 
-AbstractDBHandler::AbstractDBHandler(uid_t uid) { uid_ = uid; }
+AbstractDBHandler::AbstractDBHandler(uid_t uid, int pid) {
+  uid_ = uid;
+  pid_ = pid;
+}
 
 AbstractDBHandler::~AbstractDBHandler() {
   // Is this necessary?
@@ -227,9 +230,9 @@ AbstractDBHandler::~AbstractDBHandler() {
 std::vector<std::string> AbstractDBHandler::GetDBPath() {
   std::vector<std::string> db_path;
   if (db_type_ == DB_TYPE_FILE_PKGDB) {
-    db_path = DBHandleProvider::GetInst(uid_).GetParserDBPath();
+    db_path = DBHandleProvider::GetInst(uid_).GetParserDBPath(pid_);
   } else if (db_type_ == DB_TYPE_FILE_CERTDB) {
-    db_path.emplace_back(DBHandleProvider::GetInst(uid_).GetCertDBPath());
+    db_path.emplace_back(DBHandleProvider::GetInst(uid_).GetCertDBPath(pid_));
   }
 
   return db_path;
@@ -284,6 +287,8 @@ void AbstractDBHandler::SetOpType(OperationType type) {
 
 std::string AbstractDBHandler::GetLocale() { return locale_; }
 
+int AbstractDBHandler::GetPID() { return pid_; }
+
 void AbstractDBHandler::SetLocale(const std::string& locale) {
   locale_ = locale;
 }
index daa33f6..8b0d292 100644 (file)
@@ -44,7 +44,7 @@ class EXPORT_API AbstractDBHandler {
     OPERATION_TYPE_WRITE
   };
 
-  AbstractDBHandler(uid_t uid);
+  AbstractDBHandler(uid_t uid, pid_t pid);
   virtual ~AbstractDBHandler();
   virtual int Execute() = 0;
   void SetLocale(const std::string& locale);
@@ -54,6 +54,7 @@ class EXPORT_API AbstractDBHandler {
 
  protected:
   bool Connect();
+  int GetPID();
   std::vector<sqlite3*> GetConnection();
   std::string GetLocale();
 
@@ -62,6 +63,7 @@ class EXPORT_API AbstractDBHandler {
   DBType db_type_ = DB_TYPE_NONE;
   OperationType op_type_ = OPERATION_TYPE_NONE;
   uid_t uid_;
+  pid_t pid_;
   std::string locale_;
   std::vector<sqlite3*> db_handle_list_;
 };
index 6fdccd6..d5ce985 100644 (file)
@@ -35,8 +35,8 @@ void _move(gpointer key, gpointer value, gpointer user_data) {
 namespace pkgmgr_common {
 namespace database {
 
-AppInfoDBHandler::AppInfoDBHandler(uid_t uid)
-    : AbstractDBHandler(uid), uid_(uid) {}
+AppInfoDBHandler::AppInfoDBHandler(uid_t uid, int pid)
+    : AbstractDBHandler(uid, pid), uid_(uid) {}
 
 AppInfoDBHandler::~AppInfoDBHandler() {}
 
index 41e6668..398ee41 100644 (file)
@@ -34,7 +34,7 @@ namespace database {
 
 class EXPORT_API AppInfoDBHandler : public AbstractDBHandler{
  public:
-  AppInfoDBHandler(uid_t uid);
+  AppInfoDBHandler(uid_t uid, int pid);
   ~AppInfoDBHandler();
   std::vector<application_x*> GetAppHandle();
   void SetFilter(pkgmgrinfo_filter_x* filter);
index a7ba33e..18c0651 100644 (file)
@@ -24,8 +24,8 @@
 namespace pkgmgr_common {
 namespace database {
 
-CertGetDBHandler::CertGetDBHandler(uid_t uid)
-    : AbstractDBHandler(uid), uid_(uid) {}
+CertGetDBHandler::CertGetDBHandler(uid_t uid, int pid)
+    : AbstractDBHandler(uid, pid), uid_(uid) {}
 
 CertGetDBHandler::~CertGetDBHandler() {}
 
index 2021798..0f8172a 100644 (file)
@@ -34,7 +34,7 @@ namespace database {
 
 class EXPORT_API CertGetDBHandler : public AbstractDBHandler{
  public:
-  CertGetDBHandler(uid_t uid);
+  CertGetDBHandler(uid_t uid, int pid);
   ~CertGetDBHandler();
   pkgmgr_certinfo_x* GetCertHandle();
   void SetPkgID (std::string pkgid);
index 04020ad..54a5e17 100644 (file)
@@ -24,8 +24,8 @@
 namespace pkgmgr_common {
 namespace database {
 
-CertSetDBHandler::CertSetDBHandler(uid_t uid)
-    : AbstractDBHandler(uid), uid_(uid) {}
+CertSetDBHandler::CertSetDBHandler(uid_t uid, int pid)
+    : AbstractDBHandler(uid, pid), uid_(uid) {}
 
 CertSetDBHandler::~CertSetDBHandler() {}
 
@@ -39,7 +39,7 @@ int CertSetDBHandler::Execute() {
   if (!Connect())
     return PMINFO_R_ERROR;
 
-  DBHandleProvider::GetInst(uid_).SetMemoryMode(true);
+  DBHandleProvider::GetInst(uid_).SetMemoryMode(GetPID(), true);
   sqlite3 *conn = GetConnection().front();
   int ret = certinfo_internal_set(conn, handle_->pkgid, handle_, uid_);
 
index c44477c..74310fb 100644 (file)
@@ -34,7 +34,7 @@ namespace database {
 
 class EXPORT_API CertSetDBHandler : public AbstractDBHandler{
  public:
-  CertSetDBHandler(uid_t uid);
+  CertSetDBHandler(uid_t uid, int pid);
   ~CertSetDBHandler();
   void SetCertHandle (pkgmgr_certinfo_x* cert_info);
   int Execute() override;
index 8e7c7ab..50cc4ca 100644 (file)
  * limitations under the License.
  */
 
+#include <sys/types.h>
+
 #include <tzplatform_config.h>
 
 #include "db_handle_provider.hh"
 #include "pkgmgr-info.h"
 #include "pkgmgrinfo_debug.h"
 
+#include <algorithm>
 #include <vector>
 
 #ifdef LOG_TAG
@@ -53,6 +56,7 @@ namespace pkgmgr_common {
 std::unordered_map<uid_t, std::unique_ptr<DBHandleProvider>>
     DBHandleProvider::provider_;
 bool DBHandleProvider::is_memory_ = false;
+std::vector<pid_t> DBHandleProvider::pid_list_;
 
 DBHandleProvider::DBHandleProvider(uid_t uid) : uid_(uid),
     global_parser_memory_db_handle_(nullptr, sqlite3_close_v2),
@@ -89,10 +93,16 @@ DBHandleProvider& DBHandleProvider::GetInst(uid_t uid) {
   return *prov;
 }
 
-std::vector<std::string> DBHandleProvider::GetParserDBPath() {
+std::vector<std::string> DBHandleProvider::GetParserDBPath(pid_t pid) {
   std::unique_lock<std::mutex> u(lock_);
   std::vector<std::string> db_path_list;
-  if (is_memory_) {
+  bool is_file_access = is_memory_;
+  std::vector<pid_t>::iterator it = std::find(pid_list_.begin(),
+      pid_list_.end(), pid);
+  if (it == pid_list_.end())
+    is_file_access = true;
+
+  if (!is_file_access) {
     db_path_list.emplace_back(parser_memory_db_path_);
     if (IsUserRequest(uid_))
       db_path_list.emplace_back(global_parser_memory_db_path_);
@@ -104,9 +114,15 @@ std::vector<std::string> DBHandleProvider::GetParserDBPath() {
   return db_path_list;
 }
 
-std::string DBHandleProvider::GetCertDBPath() {
+std::string DBHandleProvider::GetCertDBPath(pid_t pid) {
   std::unique_lock<std::mutex> u(lock_);
-  if (is_memory_)
+  bool is_file_access = is_memory_;
+  std::vector<pid_t>::iterator it = std::find(pid_list_.begin(),
+      pid_list_.end(), pid);
+  if (it == pid_list_.end())
+    is_file_access = true;
+
+  if (!is_file_access)
     return cert_memory_db_path_;
   else
     return cert_file_db_path_;
@@ -146,7 +162,7 @@ sqlite3* DBHandleProvider::GetMemoryDBHandle(const std::string& filedb_path,
   return memorydb;
 }
 
-void DBHandleProvider::SetMemoryMode(bool flag) {
+void DBHandleProvider::SetMemoryMode(pid_t pid, bool flag) {
   std::unique_lock<std::mutex> u(lock_);
   if (is_memory_ == flag)
     return;
@@ -165,10 +181,21 @@ void DBHandleProvider::SetMemoryMode(bool flag) {
         cert_memory_db_path_);
     if (cert_db != nullptr)
       cert_memory_db_handle_.reset(cert_db);
+    std::vector<pid_t>::iterator it =
+        std::find(pid_list_.begin(), pid_list_.end(), pid);
+
+    if (it == pid_list_.end())
+      pid_list_.emplace_back(pid);
   } else {
     parser_memory_db_handle_.reset(nullptr);
     cert_memory_db_handle_.reset(nullptr);
     global_parser_memory_db_handle_.reset(nullptr);
+    std::vector<pid_t>::iterator it =
+        std::find(pid_list_.begin(), pid_list_.end(), pid);
+    if (it != pid_list_.end())
+      pid_list_.erase(it);
+    else
+      LOGE("Given pid is not exists in pid list : %d", pid);
   }
 
   LOGD("Set Memory mode : %s", flag ? "Memory" : "File");
index a9daba7..6968bef 100644 (file)
@@ -19,6 +19,7 @@
 
 #include <sqlite3.h>
 #include <stdlib.h>
+#include <sys/types.h>
 
 #include <string>
 #include <memory>
@@ -38,9 +39,9 @@ class EXPORT_API DBHandleProvider {
  public:
   ~DBHandleProvider() = default;
   static DBHandleProvider& GetInst(uid_t uid);
-  std::vector<std::string> GetParserDBPath();
-  std::string GetCertDBPath();
-  void SetMemoryMode(bool flag);
+  std::vector<std::string> GetParserDBPath(int pid);
+  std::string GetCertDBPath(int pid);
+  void SetMemoryMode(int pid, bool flag);
 
  private:
   DBHandleProvider(uid_t uid);
@@ -60,6 +61,7 @@ class EXPORT_API DBHandleProvider {
   std::string cert_memory_db_path_;
   std::string cert_file_db_path_;
   static bool is_memory_;
+  static std::vector<pid_t> pid_list_;
   std::mutex lock_;
 };
 
index a667dbf..1005174 100644 (file)
@@ -24,8 +24,8 @@
 namespace pkgmgr_common {
 namespace database {
 
-DepInfoGetDBHandler::DepInfoGetDBHandler(uid_t uid)
-    : AbstractDBHandler(uid), uid_(uid) {}
+DepInfoGetDBHandler::DepInfoGetDBHandler(uid_t uid, int pid)
+    : AbstractDBHandler(uid, pid), uid_(uid) {}
 
 DepInfoGetDBHandler::~DepInfoGetDBHandler() {}
 
index 6ccf89e..180b469 100644 (file)
@@ -34,7 +34,7 @@ namespace database {
 
 class EXPORT_API DepInfoGetDBHandler : public AbstractDBHandler{
  public:
-  DepInfoGetDBHandler(uid_t uid);
+  DepInfoGetDBHandler(uid_t uid, int pid);
   ~DepInfoGetDBHandler();
   std::vector<dependency_x*> GetDependencyList();
   void SetPkgID(const std::string& pkgid);
index 967cbbc..2b822de 100644 (file)
@@ -35,8 +35,8 @@ void _move(gpointer key, gpointer value, gpointer user_data) {
 namespace pkgmgr_common {
 namespace database {
 
-PkgGetDBHandler::PkgGetDBHandler(uid_t uid)
-    : AbstractDBHandler(uid), uid_(uid) {}
+PkgGetDBHandler::PkgGetDBHandler(uid_t uid, int pid)
+    : AbstractDBHandler(uid, pid), uid_(uid) {}
 
 PkgGetDBHandler::~PkgGetDBHandler() {}
 
index 4126260..9b849ab 100644 (file)
@@ -34,7 +34,7 @@ namespace database {
 
 class EXPORT_API PkgGetDBHandler : public AbstractDBHandler{
  public:
-  PkgGetDBHandler(uid_t uid);
+  PkgGetDBHandler(uid_t uid, int pid);
   ~PkgGetDBHandler();
   std::vector<package_x*> GetPkgHandle();
   void SetFilter(pkgmgrinfo_filter_x* filter);
index b07231e..6dc6e90 100644 (file)
@@ -25,8 +25,8 @@
 namespace pkgmgr_common {
 namespace database {
 
-PkgSetDBHandler::PkgSetDBHandler(uid_t uid)
-    : AbstractDBHandler(uid), uid_(uid) {}
+PkgSetDBHandler::PkgSetDBHandler(uid_t uid, int pid)
+    : AbstractDBHandler(uid, pid), uid_(uid) {}
 
 PkgSetDBHandler::~PkgSetDBHandler() {}
 
@@ -51,7 +51,7 @@ int PkgSetDBHandler::Execute() {
 
   int ret = 0;
 
-  DBHandleProvider::GetInst(uid_).SetMemoryMode(true);
+  DBHandleProvider::GetInst(uid_).SetMemoryMode(GetPID(), true);
   std::vector<sqlite3*> conn_list = GetConnection();
   sqlite3* conn = conn_list.front();
   if (write_type_ == Insert) {
index bc0b1bc..b83642f 100644 (file)
@@ -43,7 +43,7 @@ namespace database {
 
 class EXPORT_API PkgSetDBHandler : public AbstractDBHandler{
  public:
-  PkgSetDBHandler(uid_t uid);
+  PkgSetDBHandler(uid_t uid, int pid);
   ~PkgSetDBHandler();
   void SetPkgInfo(package_x* package);
   void SetPkgID(std::string pkgid);
index 2c3ce4c..d5aba60 100644 (file)
@@ -24,7 +24,8 @@
 namespace pkgmgr_common {
 namespace database {
 
-QueryHandler::QueryHandler(uid_t uid) : AbstractDBHandler(uid), uid_(uid) {}
+QueryHandler::QueryHandler(uid_t uid, int pid)
+    : AbstractDBHandler(uid, pid), uid_(uid) {}
 
 QueryHandler::~QueryHandler() {}
 
@@ -63,7 +64,7 @@ int QueryHandler::Execute() {
         _LOGE("Failed to execute query");
         return ret;
       }
-      
+
       result_.clear();
       result_.resize(row);
       GList* tmp = list;
index 9077a4d..c655a22 100644 (file)
@@ -35,7 +35,7 @@ namespace database {
 
 class EXPORT_API QueryHandler : public AbstractDBHandler{
  public:
-  QueryHandler(uid_t uid);
+  QueryHandler(uid_t uid, int pid);
   ~QueryHandler();
   void SetQuery(std::vector<std::string> query);
   bool BindString(std::string value);
diff --git a/src/common/request_handler/abstract_request_handler.cc b/src/common/request_handler/abstract_request_handler.cc
new file mode 100644 (file)
index 0000000..63d7e63
--- /dev/null
@@ -0,0 +1,23 @@
+// Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by an apache-2.0 license that can be
+// found in the LICENSE file.
+
+#include "abstract_request_handler.hh"
+
+#include "pkgmgrinfo_debug.h"
+
+#include <string>
+
+namespace pkgmgr_server {
+namespace request_handler {
+
+void AbstractRequestHandler::SetPID(pid_t pid) {
+  pid_ = pid;
+}
+
+pid_t AbstractRequestHandler::GetPID() {
+  return pid_;
+}
+
+}  // namespace request_handler
+}  // namespace pkgmgr_server
index 49f0c98..c60aaba 100644 (file)
@@ -6,6 +6,9 @@
 #define SERVER_ABSTRACT_REQUEST_HANDLER_HH_
 
 #include <string>
+
+#include <sys/types.h>
+
 #include <parcel.hh>
 
 namespace pkgmgr_server {
@@ -21,6 +24,13 @@ class EXPORT_API AbstractRequestHandler {
   virtual bool HandleRequest(unsigned char* data, int size, std::string locale) = 0;
 
   virtual std::vector<uint8_t> GetResult() = 0;
+  void SetPID(pid_t pid);
+
+ protected:
+  pid_t GetPID();
+
+ private:
+  pid_t pid_;
 };
 
 }  // namespace request_handler
index 45d428b..8ba821e 100644 (file)
@@ -36,7 +36,7 @@ bool CommandRequestHandler::HandleRequest(unsigned char* data, int size,
   }
 
   if (parcel->GetCmd() == CommandType::RemoveCache) {
-    pkgmgr_common::DBHandleProvider::GetInst(parcel->GetUid()).SetMemoryMode(false);
+    pkgmgr_common::DBHandleProvider::GetInst(parcel->GetUid()).SetMemoryMode(GetPID(), false);
     result_.WriteInt32(0);
   }
 
index 0d53cf9..f9e7873 100644 (file)
@@ -37,7 +37,7 @@ bool GetAppinfoRequestHandler::HandleRequest(unsigned char* data, int size,
     return false;
   }
 
-  AppInfoDBHandler db(parcel->GetUid());
+  AppInfoDBHandler db(parcel->GetUid(), GetPID());
   db.SetLocale(locale);
   db.SetFilter(const_cast<pkgmgrinfo_filter_x*>(parcel->GetFilter()));
   int ret = db.Execute();
index 82b704d..ee31472 100644 (file)
@@ -36,7 +36,7 @@ bool GetCertRequestHandler::HandleRequest(unsigned char* data, int size,
     return false;
   }
 
-  CertGetDBHandler db(parcel->GetUid());
+  CertGetDBHandler db(parcel->GetUid(), GetPID());
   db.SetLocale(locale);
   db.SetPkgID(parcel->GetPkgId());
 
index 3765672..c9c4aba 100644 (file)
@@ -37,7 +37,7 @@ bool GetDepinfoRequestHandler::HandleRequest(unsigned char* data, int size,
     return false;
   }
 
-  DepInfoGetDBHandler db(parcel->GetUid());
+  DepInfoGetDBHandler db(parcel->GetUid(), GetPID());
   db.SetPkgID(parcel->GetPkgID());
   int ret = db.Execute();
 
index f2b8da3..0307c11 100644 (file)
@@ -37,7 +37,7 @@ bool GetPkginfoRequestHandler::HandleRequest(unsigned char* data, int size,
     return false;
   }
 
-  PkgGetDBHandler db(parcel->GetUid());
+  PkgGetDBHandler db(parcel->GetUid(), GetPID());
   db.SetLocale(locale);
   db.SetFilter(const_cast<pkgmgrinfo_filter_x*>(parcel->GetFilter()));
   int ret = db.Execute();
index 7949a71..7044e32 100644 (file)
@@ -37,7 +37,7 @@ bool QueryRequestHandler::HandleRequest(unsigned char* data, int size,
     return false;
   }
 
-  QueryHandler db(parcel->GetUid());
+  QueryHandler db(parcel->GetUid(), GetPID());
   db.SetLocale(locale);
   db.SetQuery(parcel->GetQueries());
   db.SetDBType(parcel->GetDBType());
index 06f76a9..5b7b72a 100644 (file)
@@ -31,7 +31,7 @@ bool SetCertRequestHandler::HandleRequest(unsigned char* data, int size,
     return false;
   }
 
-  CertSetDBHandler db(parcel->GetUid());
+  CertSetDBHandler db(parcel->GetUid(), GetPID());
   db.SetLocale(locale);
   db.SetCertHandle(const_cast<pkgmgr_certinfo_x*>(parcel->GetCertInfo()));
 
index 5823f72..904c434 100644 (file)
@@ -38,7 +38,7 @@ bool SetPkginfoRequestHandler::HandleRequest(unsigned char* data, int size,
     return false;
   }
 
-  PkgSetDBHandler db(parcel->GetUid());
+  PkgSetDBHandler db(parcel->GetUid(), GetPID());
   db.SetLocale(locale);
   db.SetWriteType(parcel->GetWriteType());
 
index e2e2f8f..a5e8225 100644 (file)
@@ -89,7 +89,7 @@ int AbstractSocket::GetFd() { return fd_; }
 
 std::string AbstractSocket::GetPath() { return path_; }
 
-int AbstractSocket::GetPID() {
+pid_t AbstractSocket::GetPID() {
   int r;
   struct ucred cred;
   socklen_t len;
index 1220b86..bed1ec7 100644 (file)
@@ -18,6 +18,7 @@
 #define COMMON_ABSTRACT_SOCKET_HH_
 
 #include <sys/un.h>
+#include <sys/types.h>
 
 #include <string>
 
@@ -40,7 +41,7 @@ class EXPORT_API AbstractSocket {
 
   int GetFd();
   std::string GetPath();
-  int GetPID();
+  pid_t GetPID();
 
  protected:
   void SetOption();
index 5203d5e..7cfa918 100644 (file)
@@ -34,7 +34,7 @@ unsigned char* PkgRequest::GetData() { return data_; }
 
 int PkgRequest::GetSize() { return data_size_; }
 
-int PkgRequest::GetSenderPID() {
+pid_t PkgRequest::GetSenderPID() {
   return socket_->GetPID();
 }
 
index 2036e54..afe5ab5 100644 (file)
@@ -18,6 +18,9 @@
 #define SERVER_PKG_REQUEST_HH_
 
 #include <memory>
+
+#include <sys/types.h>
+
 #include "data_socket.hh"
 #include "request_type.hh"
 
@@ -33,7 +36,7 @@ class EXPORT_API PkgRequest {
   ~PkgRequest();
   unsigned char* GetData();
   int GetSize();
-  int GetSenderPID();
+  pid_t GetSenderPID();
   pkgmgr_common::ReqType GetRequestType();
   bool ReceiveData();
   bool SendData(unsigned char* data, int size);
index 587f75d..42ac368 100644 (file)
@@ -106,6 +106,7 @@ void WorkerThread::Run() {
     }
 
     try {
+      handler[type]->SetPID(req->GetSenderPID());
       if (!handler[type]->HandleRequest(req->GetData(), req->GetSize(),
                                         locale_.GetObject()))
         LOGE("Failed to handle request");
index e67889a..e106a4a 100644 (file)
@@ -40,6 +40,6 @@ class DatabaseTest : public ::testing::Test {
 };
 
 TEST_F(DatabaseTest, AppInfoDBHandler) {
-  pd::AppInfoDBHandler db_handler(0);
+  pd::AppInfoDBHandler db_handler(0, 0);
   EXPECT_NE(db_handler.Execute(), PMINFO_R_OK);
 }