From: Ilho Kim Date: Mon, 18 Dec 2023 03:36:57 +0000 (+0900) Subject: Fix Exec function to determine the cause of failure X-Git-Tag: accepted/tizen/unified/20240305.053021~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F47%2F302947%2F2;p=platform%2Fcore%2Fbase%2Fbundle.git Fix Exec function to determine the cause of failure If the sqlite3_prepare_v2 function fails when execute Exec function the cause of failure can't get from the Result Pass the db handle to the Result so that an error message can be obtained from the db handle Change-Id: I340e3ee2ccacc6194c33fc215d2e1d09d5163a15 Signed-off-by: Ilho Kim --- diff --git a/tizen-database/database.hpp b/tizen-database/database.hpp index b8e9b6c..c5f1f72 100644 --- a/tizen-database/database.hpp +++ b/tizen-database/database.hpp @@ -744,7 +744,7 @@ class Database { int r = sqlite3_prepare_v2(db_.get(), sql.GetQuery().c_str(), -1, &stmt, nullptr); if (r != SQLITE_OK) - return { nullptr, nullptr, "", true }; + return { nullptr, db_, "", true }; return { stmt, db_, sql.GetQuery(), false }; } @@ -756,7 +756,7 @@ class Database { int r = sqlite3_prepare_v2(db_.get(), sql.GetQuery().c_str(), -1, &stmt, nullptr); if (r != SQLITE_OK) { - return { nullptr, nullptr, "", true }; + return { nullptr, db_, "", true }; } std::unique_ptr stmt_auto(stmt,