Allow DB queries with NULL outparam for containing query result 74/75674/1
authorMu-Woong Lee <muwoong.lee@samsung.com>
Tue, 21 Jun 2016 02:55:40 +0000 (11:55 +0900)
committerMu-Woong Lee <muwoong.lee@samsung.com>
Tue, 21 Jun 2016 02:55:40 +0000 (11:55 +0900)
Change-Id: Ifad60aae43fc4745bc4dd55d5cba442934dbef5a
Signed-off-by: Mu-Woong Lee <muwoong.lee@samsung.com>
src/server/DatabaseThread.cpp

index 14e6d5e..d2006b5 100644 (file)
@@ -165,7 +165,7 @@ bool DatabaseThread::insertSync(const char *tableName, Json record, int64_t *row
 
 bool DatabaseThread::executeSync(const char *query, std::vector<Json> *records)
 {
-       IF_FAIL_RETURN(query && records, false);
+       IF_FAIL_RETURN(query, false);
 
        _SD("SQL: %s", query);
 
@@ -294,6 +294,8 @@ void DatabaseThread::__dispatchResult(QueryType type, unsigned int queryId, IDat
 
 int DatabaseThread::__executionCb(void *userData, int dim, char **value, char **column)
 {
+       IF_FAIL_RETURN(userData, 0);
+
        std::vector<Json> *records = static_cast<std::vector<Json>*>(userData);
        Json row;
        bool columnNull = false;