mirror of
https://gitee.com/openharmony/distributeddatamgr_relational_store
synced 2024-11-27 01:01:02 +00:00
valueBucket
Signed-off-by: lihuihui <lihuihui29@huawei.com>
This commit is contained in:
parent
b4811168d5
commit
420e14f08a
@ -31,6 +31,7 @@ public:
|
||||
static constexpr int DB_WAL_SIZE_LIMIT = 200 * 1024 * 1024; /* default wal file maximum size : 200M */
|
||||
static constexpr int WAL_AUTO_CHECKPOINT = 100; /* 100 pages */
|
||||
static constexpr int APP_DEFAULT_UMASK = 0002;
|
||||
static constexpr int SQLITE_MAX_COLUMN = 2000;
|
||||
static constexpr char ATTACH_BACKUP_SQL[] = "ATTACH ? AS backup KEY ?";
|
||||
static constexpr char ATTACH_SQL[] = "ATTACH ? AS ? KEY ?";
|
||||
static constexpr char EXPORT_SQL[] = "SELECT export_database('backup')";
|
||||
|
@ -32,6 +32,7 @@ public:
|
||||
static constexpr int DB_WAL_SIZE_LIMIT = 200 * 1024 * 1024; /* default wal file maximum size : 200M */
|
||||
static constexpr int WAL_AUTO_CHECKPOINT = 100; /* 100 pages */
|
||||
static constexpr int APP_DEFAULT_UMASK = 0002;
|
||||
static constexpr int SQLITE_MAX_COLUMN = 2000;
|
||||
static constexpr char ATTACH_BACKUP_SQL[] = "ATTACH ? AS backup KEY ?";
|
||||
static constexpr char ATTACH_SQL[] = "ATTACH ? AS ? KEY ?";
|
||||
static constexpr char EXPORT_SQL[] = "SELECT export_database('backup')";
|
||||
|
@ -14,6 +14,8 @@
|
||||
*/
|
||||
|
||||
#include "values_bucket.h"
|
||||
#include "sqlite_global_config.h"
|
||||
#include "logger.h"
|
||||
|
||||
namespace OHOS {
|
||||
namespace NativeRdb {
|
||||
@ -124,6 +126,10 @@ ValuesBucket *ValuesBucket::Unmarshalling(Parcel &parcel)
|
||||
int mapSize = parcel.ReadInt32();
|
||||
std::map<std::string, ValueObject> valuesMap;
|
||||
ValueObject *value = nullptr;
|
||||
if (mapSize > GlobalExpr::SQLITE_MAX_COLUMN) {
|
||||
LOG_ERROR("The mapSize is %{public}d ", mapSize);
|
||||
return new ValuesBucket(valuesMap);
|
||||
}
|
||||
for (int i = 0; i < mapSize; i++) {
|
||||
std::string key = parcel.ReadString();
|
||||
value = parcel.ReadParcelable<ValueObject>();
|
||||
|
Loading…
Reference in New Issue
Block a user