mirror of
https://gitee.com/openharmony/distributeddatamgr_relational_store
synced 2024-11-27 01:01:02 +00:00
args valueType range 判断
Signed-off-by: zhangdi <zhangdi126@huawei.com>
This commit is contained in:
parent
3c0bf2dd99
commit
5a70c4cdc9
@ -1002,7 +1002,7 @@ int SqliteConnection::TryCheckPoint(bool timeout)
|
||||
|
||||
int SqliteConnection::LimitWalSize()
|
||||
{
|
||||
if (!isConfigured_ || !isWriter_ || config_.IsMemoryRdb()) {
|
||||
if (!isConfigured_ || !isWriter_) {
|
||||
return E_OK;
|
||||
}
|
||||
|
||||
|
@ -160,9 +160,14 @@ int SqliteStatement::BindArgs(const std::vector<std::reference_wrapper<ValueObje
|
||||
bound_ = true;
|
||||
int index = 1;
|
||||
for (auto &arg : bindArgs) {
|
||||
auto action = ACTIONS[arg.get().value.index()];
|
||||
auto valueType = arg.get().value.index();
|
||||
if (valueType < ValueObject::TYPE_NULL || valueType >= ValueObject::TYPE_BUTT) {
|
||||
LOG_ERROR("index is out of range, index is %{public}zu", valueType);
|
||||
return E_INVALID_ARGS;
|
||||
}
|
||||
auto action = ACTIONS[valueType];
|
||||
if (action == nullptr) {
|
||||
LOG_ERROR("not support the type %{public}zu", arg.get().value.index());
|
||||
LOG_ERROR("not support the type %{public}zu", valueType);
|
||||
return E_INVALID_ARGS;
|
||||
}
|
||||
auto errCode = action(stmt_, index, arg.get().value);
|
||||
|
Loading…
Reference in New Issue
Block a user