Home
last modified time | relevance | path

Searched refs:stmt (Results 1 - 25 of 75) sorted by relevance

123

/foundation/distributeddatamgr/relational_store/frameworks/native/rdb/include/
H A Drd_utils.h36 static int RdSqlPrepare(GRD_DB *db, const char *str, uint32_t strLen, GRD_SqlStmt **stmt, const char **unusedStr);
37 static int RdSqlReset(GRD_SqlStmt *stmt);
38 static int RdSqlFinalize(GRD_SqlStmt *stmt);
40 static int RdSqlBindBlob(GRD_SqlStmt *stmt, uint32_t idx, const void *val, int32_t len, void (*freeFunc)(void *));
41 static int RdSqlBindText(GRD_SqlStmt *stmt, uint32_t idx, const void *val, int32_t len, void (*freeFunc)(void *));
42 static int RdSqlBindInt(GRD_SqlStmt *stmt, uint32_t idx, int32_t val);
43 static int RdSqlBindInt64(GRD_SqlStmt *stmt, uint32_t idx, int64_t val);
44 static int RdSqlBindDouble(GRD_SqlStmt *stmt, uint32_t idx, double val);
45 static int RdSqlBindNull(GRD_SqlStmt *stmt, uint32_t idx);
47 GRD_SqlStmt *stmt, uint32_
[all...]
H A Dgrd_api_manager.h30 GRD_DB *db, const char *str, uint32_t strLen, GRD_SqlStmt **stmt, const char **unusedStr);
31 typedef int32_t (*DBSqlReset)(GRD_SqlStmt *stmt);
32 typedef int32_t (*DBSqlFinalize)(GRD_SqlStmt *stmt);
34 GRD_SqlStmt *stmt, uint32_t idx, const void *val, int32_t len, void (*freeFunc)(void *));
36 GRD_SqlStmt *stmt, uint32_t idx, const void *val, int32_t len, void (*freeFunc)(void *));
37 typedef int32_t (*DBSqlBindInt)(GRD_SqlStmt *stmt, uint32_t idx, int32_t val);
38 typedef int32_t (*DBSqlBindInt64)(GRD_SqlStmt *stmt, uint32_t idx, int64_t val);
39 typedef int32_t (*DBSqlBindDouble)(GRD_SqlStmt *stmt, uint32_t idx, double val);
40 typedef int32_t (*DBSqlBindNull)(GRD_SqlStmt *stmt, uint32_t idx);
42 GRD_SqlStmt *stmt, uint32_
[all...]
/foundation/distributeddatamgr/relational_store/frameworks/native/rdb/src/
H A Drd_utils.cpp147 int RdUtils::RdSqlPrepare(GRD_DB *db, const char *str, uint32_t strLen, GRD_SqlStmt **stmt, const char **unusedStr) in RdSqlPrepare() argument
155 return TransferGrdErrno(GRD_KVApiInfo.DBSqlPrepare(db, str, strLen, stmt, unusedStr)); in RdSqlPrepare()
158 int RdUtils::RdSqlReset(GRD_SqlStmt *stmt) in RdSqlReset() argument
166 return TransferGrdErrno(GRD_KVApiInfo.DBSqlReset(stmt)); in RdSqlReset()
169 int RdUtils::RdSqlFinalize(GRD_SqlStmt *stmt) in RdSqlFinalize() argument
177 return TransferGrdErrno(GRD_KVApiInfo.DBSqlFinalize(stmt)); in RdSqlFinalize()
185 int RdUtils::RdSqlBindBlob(GRD_SqlStmt *stmt, uint32_t idx, const void *val, int32_t len, void (*freeFunc)(void *)) in RdSqlBindBlob() argument
210 return TransferGrdErrno(GRD_KVApiInfo.DBSqlBindBlob(stmt, idx, tmpVal, len, freeFunc)); in RdSqlBindBlob()
218 int RdUtils::RdSqlBindText(GRD_SqlStmt *stmt, uint32_t idx, const void *val, int32_t len, void (*freeFunc)(void *)) in RdSqlBindText() argument
243 return TransferGrdErrno(GRD_KVApiInfo.DBSqlBindText(stmt, id in RdSqlBindText()
246 RdSqlBindInt(GRD_SqlStmt *stmt, uint32_t idx, int32_t val) RdSqlBindInt() argument
257 RdSqlBindInt64(GRD_SqlStmt *stmt, uint32_t idx, int64_t val) RdSqlBindInt64() argument
268 RdSqlBindDouble(GRD_SqlStmt *stmt, uint32_t idx, double val) RdSqlBindDouble() argument
279 RdSqlBindNull(GRD_SqlStmt *stmt, uint32_t idx) RdSqlBindNull() argument
295 RdSqlBindFloatVector(GRD_SqlStmt *stmt, uint32_t idx, float *val, uint32_t dim, void (*freeFunc)(void *)) RdSqlBindFloatVector() argument
324 RdSqlStep(GRD_SqlStmt *stmt) RdSqlStep() argument
335 RdSqlColCnt(GRD_SqlStmt *stmt) RdSqlColCnt() argument
346 RdSqlColType(GRD_SqlStmt *stmt, uint32_t idx) RdSqlColType() argument
357 RdSqlColBytes(GRD_SqlStmt *stmt, uint32_t idx) RdSqlColBytes() argument
368 RdSqlColName(GRD_SqlStmt *stmt, uint32_t idx) RdSqlColName() argument
379 RdSqlColValue(GRD_SqlStmt *stmt, uint32_t idx) RdSqlColValue() argument
390 RdSqlColBlob(GRD_SqlStmt *stmt, uint32_t idx) RdSqlColBlob() argument
401 RdSqlColText(GRD_SqlStmt *stmt, uint32_t idx) RdSqlColText() argument
412 RdSqlColInt(GRD_SqlStmt *stmt, uint32_t idx) RdSqlColInt() argument
423 RdSqlColInt64(GRD_SqlStmt *stmt, uint32_t idx) RdSqlColInt64() argument
434 RdSqlColDouble(GRD_SqlStmt *stmt, uint32_t idx) RdSqlColDouble() argument
445 RdSqlColumnFloatVector(GRD_SqlStmt *stmt, uint32_t idx, uint32_t *dim) RdSqlColumnFloatVector() argument
[all...]
H A Dshare_block.cpp99 int FillSharedBlockOpt(SharedBlockInfo *info, sqlite3_stmt *stmt) in FillSharedBlockOpt() argument
101 SharedBlockSerializerInfo serializer(info->sharedBlock, stmt, info->columnNum, info->startPos); in FillSharedBlockOpt()
106 auto db = sqlite3_db_handle(stmt); in FillSharedBlockOpt()
107 int err = sqlite3_db_config(db, SQLITE_DBCONFIG_SET_SHAREDBLOCK, stmt, &sqliteBlock); in FillSharedBlockOpt()
114 err = sqlite3_step(stmt); in FillSharedBlockOpt()
129 err = sqlite3_db_config(db, SQLITE_DBCONFIG_SET_SHAREDBLOCK, stmt, nullptr); in FillSharedBlockOpt()
136 int FillSharedBlock(SharedBlockInfo *info, sqlite3_stmt *stmt) in FillSharedBlock() argument
143 int err = sqlite3_step(stmt); in FillSharedBlock()
150 FillRow(info, stmt); in FillSharedBlock()
174 void FillRow(SharedBlockInfo *info, sqlite3_stmt *stmt) in FillRow() argument
329 ResetStatement(SharedBlockInfo *info, sqlite3_stmt *stmt) ResetStatement() argument
[all...]
/foundation/distributeddatamgr/kv_store/frameworks/libs/distributeddb/test/unittest/common/storage/
H A Ddistributeddb_sqlite_utils_test.cpp88 NativeSqlite::ExecSql(g_db, "INSERT INTO t1 VALUES(?, ?)", [&blob](sqlite3_stmt *stmt) { in HWTEST_F()
89 (void)SQLiteUtils::BindInt64ToStatement(stmt, 1, 1); in HWTEST_F()
90 (void)SQLiteUtils::BindBlobToStatement(stmt, 2, blob); // 2: bind index in HWTEST_F()
94 NativeSqlite::ExecSql(g_db, "SELECT b FROM t1", nullptr, [](sqlite3_stmt *stmt) { in HWTEST_F()
96 EXPECT_EQ(SQLiteUtils::GetColumnBlobValue(stmt, 0, val), E_OK); in HWTEST_F()
117 NativeSqlite::ExecSql(g_db, "INSERT INTO t1 VALUES(?, ?)", [&blob](sqlite3_stmt *stmt) { in HWTEST_F()
118 (void)SQLiteUtils::BindInt64ToStatement(stmt, 1, 1); in HWTEST_F()
119 (void)SQLiteUtils::BindBlobToStatement(stmt, 2, blob); // 2: bind index in HWTEST_F()
123 NativeSqlite::ExecSql(g_db, "SELECT b FROM t1", nullptr, [&blob](sqlite3_stmt *stmt) { in HWTEST_F()
125 EXPECT_EQ(SQLiteUtils::GetColumnBlobValue(stmt, in HWTEST_F()
[all...]
/foundation/distributeddatamgr/kv_store/frameworks/libs/distributeddb/storage/src/sqlite/relational/
H A Dsqlite_relational_utils.cpp75 std::vector<DataValue> SQLiteRelationalUtils::GetSelectValues(sqlite3_stmt *stmt) in GetSelectValues() argument
78 for (int cid = 0, colCount = sqlite3_column_count(stmt); cid < colCount; ++cid) { in GetSelectValues()
80 (void)GetDataValueByType(stmt, cid, value); in GetSelectValues()
238 int SQLiteRelationalUtils::GetSelectVBucket(sqlite3_stmt *stmt, VBucket &bucket) in GetSelectVBucket() argument
240 if (stmt == nullptr) { in GetSelectVBucket()
243 for (int cid = 0, colCount = sqlite3_column_count(stmt); cid < colCount; ++cid) { in GetSelectVBucket()
245 int errCode = GetTypeValByStatement(stmt, cid, typeVal); in GetSelectVBucket()
247 LOGE("get typeVal from stmt failed"); in GetSelectVBucket()
250 const char *colName = sqlite3_column_name(stmt, cid); in GetSelectVBucket()
270 int SQLiteRelationalUtils::GetTypeValByStatement(sqlite3_stmt *stmt, in argument
316 GetBlobByStatement(sqlite3_stmt *stmt, int cid, Type &typeVal) GetBlobByStatement() argument
366 sqlite3_stmt *stmt = nullptr; SelectServerObserver() local
413 sqlite3_stmt *stmt = nullptr; QueryCount() local
[all...]
H A Dsqlite_single_ver_relational_storage_extend_executor.cpp79 sqlite3_stmt *stmt = nullptr; in GetFillDownloadAssetStatement() local
80 int errCode = SQLiteUtils::GetStatement(dbHandle_, sql, stmt); in GetFillDownloadAssetStatement()
86 errCode = BindOneField(i + 1, vBucket, fields[i], stmt); in GetFillDownloadAssetStatement()
88 SQLiteUtils::ResetStatement(stmt, true, errCode); in GetFillDownloadAssetStatement()
92 statement = stmt; in GetFillDownloadAssetStatement()
136 sqlite3_stmt *stmt = nullptr; in FillCloudAssetForDownload() local
137 errCode = GetFillDownloadAssetStatement(tableSchema.name, dbAssets, assetsField, stmt); in FillCloudAssetForDownload()
141 errCode = ExecuteFillDownloadAssetStatement(stmt, assetsField.size() + 1, cloudGid); in FillCloudAssetForDownload()
156 LOGE("get update asset data cursor stmt failed %d.", errCode); in IncreaseCursorOnAssetData()
164 LOGW("Reset stmt faile in IncreaseCursorOnAssetData()
203 sqlite3_stmt *stmt = nullptr; FillCloudAssetForUpload() local
255 BindUpdateVersionStatement(const VBucket &vBucket, const Bytes &hashKey, sqlite3_stmt *&stmt) BindUpdateVersionStatement() argument
554 sqlite3_stmt *stmt = nullptr; ClearAllTempSyncTrigger() local
937 BindStmtWithCloudGid(const CloudSyncData &cloudDataResult, bool ignoreEmptyGid, sqlite3_stmt *&stmt) BindStmtWithCloudGid() argument
1072 BindStmtWithCloudGidInner(const std::string &gid, int64_t rowid, sqlite3_stmt *&stmt, int &fillGidCount) BindStmtWithCloudGidInner() argument
1155 sqlite3_stmt *stmt = nullptr; UpdateAssetIdOnUserTable() local
1246 sqlite3_stmt *stmt = nullptr; CleanAssetsIdOnUserTable() local
1285 sqlite3_stmt *stmt = nullptr; GetAssetsByGidOrHashKey() local
1320 InitGetAssetStmt(const std::string &sql, const std::string &gid, const Bytes &hashKey, sqlite3_stmt *&stmt) InitGetAssetStmt() argument
1425 ExecuteFillDownloadAssetStatement(sqlite3_stmt *&stmt, int beginIndex, const std::string &cloudGid) ExecuteFillDownloadAssetStatement() argument
1533 BindAssetToBlobStatement(const Asset &asset, int index, sqlite3_stmt *&stmt) BindAssetToBlobStatement() argument
1549 BindAssetsToBlobStatement(const Assets &assets, int index, sqlite3_stmt *&stmt) BindAssetsToBlobStatement() argument
1565 BindAssetFiledToBlobStatement(const TableSchema &tableSchema, const std::vector<Asset> &assetOfOneRecord, const std::vector<Assets> &assetsOfOneRecord, sqlite3_stmt *&stmt) BindAssetFiledToBlobStatement() argument
1601 sqlite3_stmt *stmt = nullptr; UpdateAssetsIdForOneRecord() local
1738 sqlite3_stmt *stmt = nullptr; UpdateRecordFlag() local
1778 sqlite3_stmt *stmt = nullptr; MarkFlagAsUploadFinished() local
1821 sqlite3_stmt *stmt = nullptr; GetWaitCompensatedSyncDataPk() local
1855 sqlite3_stmt *stmt = nullptr; ClearUnLockingStatus() local
1872 GetRecordFromStmt(sqlite3_stmt *stmt, const std::vector<Field> &fields, int startIndex, VBucket &record) GetRecordFromStmt() argument
[all...]
H A Dsqlite_single_ver_relational_continue_token.cpp90 int SQLiteSingleVerRelationalContinueToken::GetQuerySyncStatement(sqlite3 *db, sqlite3_stmt *&stmt) in GetQuerySyncStatement() argument
101 return helper.GetRelationalQueryStatement(db, timeRange_.beginTime, timeRange_.endTime, fieldNames_, stmt); in GetQuerySyncStatement()
104 int SQLiteSingleVerRelationalContinueToken::GetMissQueryStatement(sqlite3 *db, sqlite3_stmt *&stmt) in GetMissQueryStatement() argument
111 return helper.GetRelationalMissQueryStatement(db, timeRange_.lastQueryTime + 1, INT64_MAX, fieldNames_, stmt); in GetMissQueryStatement()
114 int SQLiteSingleVerRelationalContinueToken::GetDeletedDataStmt(sqlite3 *db, sqlite3_stmt *&stmt) const in GetDeletedDataStmt()
116 // get stmt in GetDeletedDataStmt()
118 int errCode = SQLiteUtils::GetStatement(db, sql, stmt); in GetDeletedDataStmt()
123 // bind stmt in GetDeletedDataStmt()
124 errCode = SQLiteUtils::BindInt64ToStatement(stmt, 1, timeRange_.deleteBeginTime); // 1 means begin time in GetDeletedDataStmt()
128 errCode = SQLiteUtils::BindInt64ToStatement(stmt, in GetDeletedDataStmt()
[all...]
H A Dsqlite_relational_utils.h30 static std::vector<DataValue> GetSelectValues(sqlite3_stmt *stmt);
38 static int GetSelectVBucket(sqlite3_stmt *stmt, VBucket &bucket);
53 static int GetTypeValByStatement(sqlite3_stmt *stmt, int cid, Type &typeVal);
54 static int GetBlobByStatement(sqlite3_stmt *stmt, int cid, Type &typeVal);
H A Dsqlite_single_ver_relational_storage_executor.cpp149 sqlite3_stmt *stmt = nullptr; in GetExistedDataTimeOffset() local
150 int errCode = SQLiteUtils::GetStatement(db, sql, stmt); in GetExistedDataTimeOffset()
154 errCode = SQLiteUtils::StepWithRetry(stmt, isMem); in GetExistedDataTimeOffset()
156 timeOffset = static_cast<int64_t>(sqlite3_column_int64(stmt, 0)); in GetExistedDataTimeOffset()
159 SQLiteUtils::ResetStatement(stmt, true, errCode); in GetExistedDataTimeOffset()
323 sqlite3_stmt *stmt = nullptr; in GetDeviceTableName() local
324 int errCode = SQLiteUtils::GetStatement(handle, checkSql, stmt); in GetDeviceTableName()
330 errCode = SQLiteUtils::StepWithRetry(stmt, false); in GetDeviceTableName()
339 errCode = SQLiteUtils::GetColumnTextValue(stmt, 0, realTableName); // 0: table name result column index in GetDeviceTableName()
349 SQLiteUtils::ResetStatement(stmt, tru in GetDeviceTableName()
831 DeleteSyncDataItem(const DataItem &dataItem, RelationalSyncDataInserter &inserter, sqlite3_stmt *&stmt) DeleteSyncDataItem() argument
893 DeleteSyncLog(const DataItem &dataItem, RelationalSyncDataInserter &inserter, sqlite3_stmt *&stmt) DeleteSyncLog() argument
1046 GetDataItemForSync(sqlite3_stmt *stmt, DataItem &dataItem, bool isGettingDeletedData) const GetDataItemForSync() argument
1088 StepNext(bool isMemDB, sqlite3_stmt *stmt, Timestamp &timestamp) StepNext() argument
1344 sqlite3_stmt *stmt = nullptr; CheckAndCleanDistributedTable() local
1437 sqlite3_stmt *stmt = nullptr; CheckQueryObjectLegal() local
1467 sqlite3_stmt *stmt = nullptr; GetMaxTimestamp() local
1500 GetRowDatas(sqlite3_stmt *stmt, bool isMemDb, std::vector<std::string> &colNames, std::vector<RelationalRowData *> &data) GetRowDatas() argument
1552 sqlite3_stmt *stmt = nullptr; ExecuteQueryBySqlStmt() local
[all...]
H A Dsqlite_single_ver_relational_storage_executor_extend.cpp389 sqlite3_stmt *stmt = nullptr; in GetCursor() local
390 int errCode = SQLiteUtils::GetStatement(dbHandle_, sql, stmt); in GetCursor()
395 ResFinalizer finalizer([stmt]() { in GetCursor()
396 sqlite3_stmt *statement = stmt; in GetCursor()
400 LOGW("Reset stmt failed %d when get cursor", ret); in GetCursor()
405 errCode = SQLiteUtils::BindBlobToStatement(stmt, 1, key, false); // first arg. in GetCursor()
409 errCode = SQLiteUtils::StepWithRetry(stmt, isMemDb_); in GetCursor()
411 cursor = static_cast<int64_t>(sqlite3_column_int64(stmt, 0)); in GetCursor()
419 sqlite3_stmt *stmt = nullptr; in SetCursor() local
420 int errCode = SQLiteUtils::GetStatement(dbHandle_, sql, stmt); in SetCursor()
1154 sqlite3_stmt *stmt = nullptr; UpdateRecordStatus() local
1229 sqlite3_stmt *stmt = nullptr; ReviseLocalModTime() local
1371 sqlite3_stmt *stmt = nullptr; MarkFlagAsConsistent() local
1406 sqlite3_stmt *stmt = nullptr; FillCloudVersionForUpload() local
1443 sqlite3_stmt *stmt = nullptr; GetUploadCountInner() local
1508 sqlite3_stmt *stmt = nullptr; UpdateCloudLogGid() local
1577 GetAssetInfoOnTable(sqlite3_stmt *&stmt, const std::vector<Field> &assetFields, VBucket &assetInfo) GetAssetInfoOnTable() argument
[all...]
H A Dsqlite_single_ver_relational_continue_token.h48 int GetQuerySyncStatement(sqlite3 *db, sqlite3_stmt *&stmt);
49 int GetDeletedDataStmt(sqlite3 *db, sqlite3_stmt *&stmt) const;
50 int GetMissQueryStatement(sqlite3 *db, sqlite3_stmt *&stmt);
/foundation/distributeddatamgr/kv_store/frameworks/libs/distributeddb/storage/src/sqlite/
H A Dsqlite_single_ver_storage_executor_subscribe.cpp45 int SQLiteSingleVerStorageExecutor::CheckMissQueryDataItem(sqlite3_stmt *stmt, const std::string &deviceName, in CheckMissQueryDataItem() argument
48 int errCode = SQLiteUtils::StepWithRetry(stmt, isMemDb_); in CheckMissQueryDataItem()
52 errCode = SQLiteUtils::GetColumnBlobValue(stmt, SYNC_RES_DEVICE_INDEX, dev); in CheckMissQueryDataItem()
57 auto timestamp = static_cast<Timestamp>(sqlite3_column_int64(stmt, SYNC_RES_TIME_INDEX)); in CheckMissQueryDataItem()
74 int SQLiteSingleVerStorageExecutor::CheckMissQueryDataItems(sqlite3_stmt *&stmt, const SqliteQueryHelper &helper, in CheckMissQueryDataItems() argument
80 errCode = helper.BindSyncDataCheckStmt(stmt, item.key); in CheckMissQueryDataItems()
85 errCode = CheckMissQueryDataItem(stmt, deviceInfo.deviceName, item); in CheckMissQueryDataItems()
90 SQLiteUtils::ResetStatement(stmt, false, errCode); in CheckMissQueryDataItems()
115 sqlite3_stmt *stmt = nullptr; in CheckDataWithQuery() local
116 errCode = SQLiteUtils::GetStatement(dbHandle_, sql, stmt); in CheckDataWithQuery()
162 sqlite3_stmt *stmt = nullptr; AddSubscribeTrigger() local
252 sqlite3_stmt *stmt = nullptr; GetTriggers() local
[all...]
H A Dsqlite_cloud_kv_executor_utils.cpp32 auto [errCode, stmt] = token.GetCloudQueryStmt(db, data.isCloudForcePushStrategy, stepNext, data.mode); in GetCloudData()
41 errCode = SQLiteUtils::StepNext(stmt, isMemory); in GetCloudData()
48 errCode = GetCloudDataForSync(config, recorder, stmt, data, detail); in GetCloudData()
141 void SqliteCloudKvExecutorUtils::GetCloudLog(sqlite3_stmt *stmt, VBucket &logInfo, in GetCloudLog() argument
144 int64_t modifyTime = static_cast<int64_t>(sqlite3_column_int64(stmt, CLOUD_QUERY_MODIFY_TIME_INDEX)); in GetCloudLog()
157 static_cast<int64_t>(sqlite3_column_int64(stmt, CLOUD_QUERY_CREATE_TIME_INDEX))); in GetCloudLog()
159 if (sqlite3_column_text(stmt, CLOUD_QUERY_CLOUD_GID_INDEX) != nullptr) { in GetCloudLog()
161 sqlite3_column_text(stmt, CLOUD_QUERY_CLOUD_GID_INDEX)); in GetCloudLog()
176 SQLiteUtils::GetColumnTextValue(stmt, CLOUD_QUERY_VERSION_INDEX, version); in GetCloudLog()
181 void SqliteCloudKvExecutorUtils::GetCloudExtraLog(sqlite3_stmt *stmt, VBucke argument
196 GetCloudKvData(sqlite3_stmt *stmt, VBucket &data, uint32_t &totalSize) GetCloudKvData() argument
221 GetCloudKvBlobData(const std::string &keyStr, int index, sqlite3_stmt *stmt, VBucket &data, uint32_t &totalSize) GetCloudKvBlobData() argument
265 sqlite3_stmt *stmt = nullptr; GetLogInfo() local
300 GetLogInfoInner(sqlite3_stmt *stmt, bool isMemory, const std::string &gid, const Bytes &key, const std::string &userId) GetLogInfoInner() argument
354 FillLogInfoWithStmt(sqlite3_stmt *stmt) FillLogInfoWithStmt() argument
1023 sqlite3_stmt *stmt = nullptr; CountCloudDataInner() local
1080 sqlite3_stmt *stmt = nullptr; CountAllCloudData() local
1151 sqlite3_stmt *stmt = nullptr; GetLocalCloudVersionInner() local
1190 GetCloudVersionRecord(bool isMemory, sqlite3_stmt *stmt, CloudSyncData &syncData) GetCloudVersionRecord() argument
1292 GetCloudVersionRecordData(sqlite3_stmt *stmt, VBucket &data, uint32_t &totalSize) GetCloudVersionRecordData() argument
1307 sqlite3_stmt *stmt = nullptr; GetWaitCompensatedSyncDataPk() local
1344 sqlite3_stmt *stmt = nullptr; GetWaitCompensatedSyncDataUserId() local
1403 sqlite3_stmt *stmt = nullptr; QueryCloudGid() local
[all...]
H A Dsqlite_utils_extend.cpp456 int SQLiteUtils::ExpandedSql(sqlite3_stmt *stmt, std::string &basicString) in ExpandedSql() argument
458 if (stmt == nullptr) { in ExpandedSql()
461 char *eSql = sqlite3_expanded_sql(stmt); in ExpandedSql()
488 sqlite3_stmt *stmt = nullptr; in CheckTableEmpty() local
489 int errCode = SQLiteUtils::GetStatement(db, cntSql, stmt); in CheckTableEmpty()
494 errCode = SQLiteUtils::StepWithRetry(stmt, false); in CheckTableEmpty()
496 isEmpty = (sqlite3_column_type(stmt, 0) == SQLITE_NULL); in CheckTableEmpty()
500 SQLiteUtils::ResetStatement(stmt, true, errCode); in CheckTableEmpty()
537 void SQLiteUtils::GetSelectCols(sqlite3_stmt *stmt, std::vector<std::string> &colNames) in GetSelectCols() argument
540 for (int i = 0; i < sqlite3_column_count(stmt); in GetSelectCols()
660 sqlite3_stmt *stmt = nullptr; CheckTableExists() local
685 StepNext(sqlite3_stmt *stmt, bool isMemDb) StepNext() argument
[all...]
/foundation/communication/dsoftbus/core/common/utils/
H A Dsqlite3_utils.c139 rc = sqlite3_prepare_v2(ctx->db, sql, len, &ctx->stmt, NULL); in ExecuteSql()
140 if (rc != SQLITE_OK || ctx->stmt == NULL) { in ExecuteSql()
144 paraNum = sqlite3_bind_parameter_count(ctx->stmt); in ExecuteSql()
146 rc = sqlite3_step(ctx->stmt); in ExecuteSql()
154 (void)sqlite3_finalize(ctx->stmt); in ExecuteSql()
155 ctx->stmt = NULL; in ExecuteSql()
161 (void)sqlite3_finalize(ctx->stmt); in ExecuteSql()
162 ctx->stmt = NULL; in ExecuteSql()
165 rc = sqlite3_step(ctx->stmt); in ExecuteSql()
178 (void)sqlite3_finalize(ctx->stmt); in QueryData()
[all...]
/foundation/distributeddatamgr/kv_store/frameworks/libs/distributeddb/test/unittest/common/common/
H A Dnative_sqlite.cpp56 sqlite3_stmt *stmt = nullptr; in ExecSql() local
57 int ret = sqlite3_prepare_v2(db, sql.c_str(), -1, &stmt, nullptr); in ExecSql()
64 ret = bindCallback(stmt); in ExecSql()
72 ret = sqlite3_step(stmt); in ExecSql()
82 ret = resultCallback(stmt); in ExecSql()
86 // continue step stmt while callback return E_OK in ExecSql()
88 (void)sqlite3_reset(stmt); in ExecSql()
92 (void)sqlite3_finalize(stmt); in ExecSql()
/foundation/distributeddatamgr/kv_store/frameworks/libs/distributeddb/gaussdb_rd/src/oh_adapter/src/
H A Dsqlite_store_executor_impl.cpp118 [key, value](sqlite3_stmt *stmt) { in PutData()
119 RDSQLiteUtils::BindBlobToStatement(stmt, 1, key); in PutData()
120 RDSQLiteUtils::BindBlobToStatement(stmt, 2, value); in PutData()
147 [key, value](sqlite3_stmt *stmt) { in InsertData()
148 RDSQLiteUtils::BindBlobToStatement(stmt, 1, key); in InsertData()
149 RDSQLiteUtils::BindBlobToStatement(stmt, 2, value); in InsertData()
174 [key](sqlite3_stmt *stmt) { in GetDataByKey()
175 RDSQLiteUtils::BindBlobToStatement(stmt, 1, key); in GetDataByKey()
178 [&value, &innerErrorCode](sqlite3_stmt *stmt, bool &isMatchOneData) { in GetDataByKey()
179 RDSQLiteUtils::GetColumnBlobValue(stmt, in GetDataByKey()
[all...]
H A Drd_sqlite_utils.cpp249 sqlite3_stmt *stmt = nullptr; in ExecSql() local
251 int errCode = RDSQLiteUtils::GetStatement(db, sql, stmt); in ExecSql()
257 errCode = bindCallback(stmt); in ExecSql()
265 errCode = RDSQLiteUtils::StepWithRetry(stmt); in ExecSql()
272 errCode = resultCallback(stmt, isMatchOneData); in ExecSql()
278 errCode = RDSQLiteUtils::ResetStatement(stmt, false); in ExecSql()
282 (void)RDSQLiteUtils::ResetStatement(stmt, true); in ExecSql()
/foundation/distributeddatamgr/relational_store/rdbmock/frameworks/native/rdb/
H A Dmock.cpp41 __attribute__((visibility("default"))) int FillSharedBlockOpt(SharedBlockInfo *info, sqlite3_stmt *stmt) in FillSharedBlockOpt() argument
44 (void)stmt; in FillSharedBlockOpt()
48 __attribute__((visibility("default"))) int FillSharedBlock(SharedBlockInfo *info, sqlite3_stmt *stmt) in FillSharedBlock() argument
51 (void)stmt; in FillSharedBlock()
55 __attribute__((visibility("default"))) bool ResetStatement(SharedBlockInfo *info, sqlite3_stmt *stmt) in ResetStatement() argument
58 (void)stmt; in ResetStatement()
/foundation/distributeddatamgr/kv_store/frameworks/libs/distributeddb/storage/src/relational/
H A Drelational_sync_data_inserter.cpp110 int RelationalSyncDataInserter::GetInsertStatement(sqlite3 *db, sqlite3_stmt *&stmt) in GetInsertStatement() argument
112 if (stmt != nullptr) { in GetInsertStatement()
131 int errCode = SQLiteUtils::GetStatement(db, sql, stmt); in GetInsertStatement()
138 int RelationalSyncDataInserter::BindInsertStatement(sqlite3_stmt *stmt, const DataItem &dataItem) in BindInsertStatement() argument
140 if (stmt == nullptr) { in BindInsertStatement()
165 errCode = SQLiteUtils::BindDataValueByType(stmt, data.optionalData[dataIdx], bindIdx++); in BindInsertStatement()
176 int RelationalSyncDataInserter::GetDeleteLogStmt(sqlite3 *db, sqlite3_stmt *&stmt) in GetDeleteLogStmt() argument
185 int errCode = SQLiteUtils::GetStatement(db, sql, stmt); in GetDeleteLogStmt()
192 int RelationalSyncDataInserter::GetDeleteSyncDataStmt(sqlite3 *db, sqlite3_stmt *&stmt) in GetDeleteSyncDataStmt() argument
201 int errCode = SQLiteUtils::GetStatement(db, sql, stmt); in GetDeleteSyncDataStmt()
234 PrepareStatement(sqlite3 *db, SaveSyncDataStmt &stmt) PrepareStatement() argument
[all...]
H A Drelational_sync_data_inserter.h64 int BindInsertStatement(sqlite3_stmt *stmt, const DataItem &dataItem);
66 int PrepareStatement(sqlite3 *db, SaveSyncDataStmt &stmt);
67 int GetDeleteLogStmt(sqlite3 *db, sqlite3_stmt *&stmt);
68 int GetDeleteSyncDataStmt(sqlite3 *db, sqlite3_stmt *&stmt);
72 int GetInsertStatement(sqlite3 *db, sqlite3_stmt *&stmt);
/foundation/distributeddatamgr/kv_store/frameworks/libs/distributeddb/interfaces/src/relational/
H A Drelational_store_sqlite_ext.cpp376 int GetStatement(sqlite3 *db, const std::string &sql, sqlite3_stmt *&stmt);
377 int ResetStatement(sqlite3_stmt *&stmt);
378 int BindBlobToStatement(sqlite3_stmt *stmt, int index, const std::vector<uint8_t> &value, bool permEmpty = false);
379 int StepWithRetry(sqlite3_stmt *stmt);
380 int GetColumnBlobValue(sqlite3_stmt *stmt, int index, std::vector<uint8_t> &value);
381 int GetColumnTextValue(sqlite3_stmt *stmt, int index, std::string &value);
503 sqlite3_stmt *stmt = nullptr; in GetLocalTimeOffsetFromMeta() local
504 int errCode = GetStatement(db, "SELECT value FROM naturalbase_rdb_aux_metadata WHERE key = ?", stmt); in GetLocalTimeOffsetFromMeta()
506 LOGE("Prepare meta data stmt failed. %d", errCode); in GetLocalTimeOffsetFromMeta()
512 errCode = BindBlobToStatement(stmt, in GetLocalTimeOffsetFromMeta()
849 sqlite3_stmt *stmt = nullptr; GetPrimaryKeyName() local
1059 ResetStatement(sqlite3_stmt *&stmt) ResetStatement() argument
1068 GetStatement(sqlite3 *db, const std::string &sql, sqlite3_stmt *&stmt) GetStatement() argument
1097 StepWithRetry(sqlite3_stmt *stmt) StepWithRetry() argument
1109 BindBlobToStatement(sqlite3_stmt *stmt, int index, const std::vector<uint8_t> &value, bool permEmpty) BindBlobToStatement() argument
1124 GetColumnTextValue(sqlite3_stmt *stmt, int index, std::string &value) GetColumnTextValue() argument
1134 GetColumnBlobValue(sqlite3_stmt *stmt, int index, std::vector<uint8_t> &value) GetColumnBlobValue() argument
1203 sqlite3_stmt *stmt = nullptr; CheckTableExists() local
1386 sqlite3_stmt *stmt = nullptr; CheckUnLockingDataExists() local
1411 sqlite3_stmt *stmt = nullptr; HandleDataStatus() local
1512 sqlite3_stmt *stmt = nullptr; GetTableInfos() local
[all...]
/foundation/communication/netmanager_base/services/netstatsmanager/src/
H A Dnet_stats_sqlite_statement.cpp36 sqlite3_stmt *stmt = nullptr; in Prepare() local
37 int32_t errCode = sqlite3_prepare_v2(dbHandle, newSql.c_str(), newSql.length(), &stmt, nullptr); in Prepare()
39 if (stmt != nullptr) { in Prepare()
40 sqlite3_finalize(stmt); in Prepare()
46 stmtHandle_ = stmt; in Prepare()
/foundation/distributeddatamgr/kv_store/frameworks/libs/distributeddb/test/unittest/common/syncer/cloud/
H A Ddistributeddb_cloud_syncer_download_assets_test.cpp176 sqlite3_stmt *stmt = nullptr; in InsertLocalData() local
177 ASSERT_EQ(SQLiteUtils::GetStatement(db, sql, stmt), E_OK); in InsertLocalData()
178 ASSERT_EQ(SQLiteUtils::BindInt64ToStatement(stmt, 1, std::get<int64_t>(vBucket[COL_ID])), E_OK); // 1 is id in InsertLocalData()
179 ASSERT_EQ(SQLiteUtils::BindTextToStatement(stmt, 2, std::get<string>(vBucket[COL_NAME])), E_OK); // 2 is name in InsertLocalData()
181 sqlite3_bind_double(stmt, 3, std::get<double>(vBucket[COL_HEIGHT]))), E_OK); // 3 is height in InsertLocalData()
183 ASSERT_EQ(sqlite3_bind_null(stmt, 4), SQLITE_OK); // 4 is asset in InsertLocalData()
186 ASSERT_EQ(SQLiteUtils::BindBlobToStatement(stmt, 4, assetBlob, false), E_OK); // 4 is asset in InsertLocalData()
190 ASSERT_EQ(SQLiteUtils::BindBlobToStatement(stmt, 5, assetsBlob, false), E_OK); // 5 is assets in InsertLocalData()
191 ASSERT_EQ(SQLiteUtils::BindInt64ToStatement(stmt, 6, std::get<int64_t>(vBucket[COL_AGE])), E_OK); // 6 is age in InsertLocalData()
192 EXPECT_EQ(SQLiteUtils::StepWithRetry(stmt), SQLiteUtil in InsertLocalData()
202 sqlite3_stmt *stmt = nullptr; UpdateLocalData() local
216 sqlite3_stmt *stmt = nullptr; UpdateLocalData() local
347 sqlite3_stmt *stmt = nullptr; CheckDownloadFailedForTest002() local
379 sqlite3_stmt *stmt = nullptr; UpdateAssetsForLocal() local
497 sqlite3_stmt *stmt = nullptr; CheckLocaLAssets() local
521 sqlite3_stmt *stmt = nullptr; CheckLocalAssetIsEmpty() local
534 sqlite3_stmt *stmt = nullptr; CheckCursorData() local
1265 sqlite3_stmt *stmt = nullptr; HWTEST_F() local
1553 sqlite3_stmt *stmt = nullptr; HWTEST_F() local
2454 sqlite3_stmt *stmt = nullptr; HWTEST_F() local
[all...]

Completed in 21 milliseconds

123