valueBucket

Signed-off-by: lihuihui <lihuihui29@huawei.com>
This commit is contained in:
lihuihui 2023-04-13 21:56:58 +08:00
parent b4811168d5
commit 420e14f08a
3 changed files with 8 additions and 0 deletions

View File

@ -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')";

View File

@ -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')";

View File

@ -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>();