Skip to content

Commit

Permalink
Fix #88: Parsing issues with large int
Browse files Browse the repository at this point in the history
  • Loading branch information
vishakha041 committed Apr 10, 2019
1 parent a43c982 commit 43d6160
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/PMGDQuery.cc
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ void PMGDQuery::set_value(const std::string& key, const PMGDProp& p,
break;

case PMGDProp::IntegerType:
prop[key] = (Json::Value::UInt64) p.int_value();
prop[key] = (Json::Value::Int64) p.int_value();
break;

case PMGDProp::StringType:
Expand All @@ -172,8 +172,9 @@ void PMGDQuery::set_property(PMGDProp* p, const std::string& key,

switch (val.type()) {
case Json::intValue:
case Json::uintValue:
p->set_type(PMGDProp::IntegerType);
p->set_int_value(val.asInt());
p->set_int_value(val.asInt64());
break;

case Json::booleanValue:
Expand Down Expand Up @@ -209,7 +210,9 @@ void PMGDQuery::set_property(PMGDProp* p, const std::string& key,
break;

default:
p->set_type(PMGDProp::NoValueType);
printf("%s\n", key.c_str());
throw ExceptionCommand(PMGDTransactiontError,
"Object Type Error");
}
}

Expand Down

0 comments on commit 43d6160

Please sign in to comment.