1
0
Fork 0

changed functions signature

This commit is contained in:
jsteemann 2016-03-15 00:01:54 +01:00
parent 33df831f41
commit b04ec219d9
8 changed files with 466 additions and 433 deletions

View File

@ -36,7 +36,10 @@
using namespace arangodb::aql; using namespace arangodb::aql;
// construct from document ////////////////////////////////////////////////////////////////////////////////
/// @brief construct a document
////////////////////////////////////////////////////////////////////////////////
AqlValue::AqlValue(TRI_doc_mptr_t const* mptr) { AqlValue::AqlValue(TRI_doc_mptr_t const* mptr) {
_data.pointer = mptr->vpack(); _data.pointer = mptr->vpack();
setType(AqlValueType::VPACK_DOCUMENT); setType(AqlValueType::VPACK_DOCUMENT);
@ -79,6 +82,20 @@ bool AqlValue::isNull(bool emptyIsNull) const {
return (s.isNull() || (emptyIsNull && s.isNone())); return (s.isNull() || (emptyIsNull && s.isNone()));
} }
////////////////////////////////////////////////////////////////////////////////
/// @brief whether or not the value contains a null value
////////////////////////////////////////////////////////////////////////////////
bool AqlValue::isBoolean() const {
AqlValueType t = type();
if (t == VPACK_DOCUMENT || t == DOCVEC || t == RANGE) {
return false;
}
VPackSlice s(slice());
return s.isBoolean();
}
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
/// @brief whether or not the value is a number /// @brief whether or not the value is a number
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////

View File

@ -198,6 +198,12 @@ struct AqlValue final {
bool isNull(bool emptyIsNull) const; bool isNull(bool emptyIsNull) const;
//////////////////////////////////////////////////////////////////////////////
/// @brief whether or not the value contains a boolean value
//////////////////////////////////////////////////////////////////////////////
bool isBoolean() const;
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
/// @brief whether or not the value is a number /// @brief whether or not the value is a number
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////

View File

@ -40,7 +40,7 @@ CollectionScanner::~CollectionScanner() {}
VPackSlice CollectionScanner::scan(size_t batchSize) { VPackSlice CollectionScanner::scan(size_t batchSize) {
if (!_cursor.hasMore()) { if (!_cursor.hasMore()) {
return arangodb::basics::VelocyPackHelper::ArrayValue(); return arangodb::basics::VelocyPackHelper::EmptyArrayValue();
} }
_cursor.getMore(batchSize, true); _cursor.getMore(batchSize, true);
return _cursor.slice(); return _cursor.slice();

View File

@ -852,8 +852,7 @@ AqlValue Expression::executeSimpleExpressionFCall(
TRI_ASSERT(parameters.size() == destroyParameters.size()); TRI_ASSERT(parameters.size() == destroyParameters.size());
AqlValue a = func->implementation(_ast->query(), trx, parameters); AqlValue a = func->implementation(_ast->query(), trx, parameters, mustDestroy);
mustDestroy = true; // function result is dynamic
for (size_t i = 0; i < parameters.size(); ++i) { for (size_t i = 0; i < parameters.size(); ++i) {
if (destroyParameters[i]) { if (destroyParameters[i]) {
@ -1196,7 +1195,7 @@ AqlValue Expression::executeSimpleExpressionExpansion(
if (offset < 0 || count <= 0) { if (offset < 0 || count <= 0) {
// no items to return... can already stop here // no items to return... can already stop here
return AqlValue(VelocyPackHelper::ArrayValue()); return AqlValue(VelocyPackHelper::EmptyArrayValue());
} }
// FILTER // FILTER
@ -1210,7 +1209,7 @@ AqlValue Expression::executeSimpleExpressionExpansion(
filterNode = nullptr; filterNode = nullptr;
} else { } else {
// filter expression is always false // filter expression is always false
return AqlValue(VelocyPackHelper::ArrayValue()); return AqlValue(VelocyPackHelper::EmptyArrayValue());
} }
} }
@ -1230,7 +1229,7 @@ AqlValue Expression::executeSimpleExpressionExpansion(
if (!a.isArray()) { if (!a.isArray()) {
TRI_ASSERT(!mustDestroy); TRI_ASSERT(!mustDestroy);
return AqlValue(VelocyPackHelper::ArrayValue()); return AqlValue(VelocyPackHelper::EmptyArrayValue());
} }
VPackBuilder builder; VPackBuilder builder;
@ -1273,7 +1272,7 @@ AqlValue Expression::executeSimpleExpressionExpansion(
if (!a.isArray()) { if (!a.isArray()) {
TRI_ASSERT(!mustDestroy); TRI_ASSERT(!mustDestroy);
return AqlValue(VelocyPackHelper::ArrayValue()); return AqlValue(VelocyPackHelper::EmptyArrayValue());
} }
mustDestroy = localMustDestroy; // maybe we need to destroy... mustDestroy = localMustDestroy; // maybe we need to destroy...

File diff suppressed because it is too large Load Diff

View File

@ -40,7 +40,7 @@ typedef std::function<bool()> ExecutionCondition;
typedef std::vector<AqlValue> VPackFunctionParameters; typedef std::vector<AqlValue> VPackFunctionParameters;
typedef std::function<AqlValue(arangodb::aql::Query*, arangodb::AqlTransaction*, typedef std::function<AqlValue(arangodb::aql::Query*, arangodb::AqlTransaction*,
VPackFunctionParameters const&)> VPackFunctionParameters const&, bool&)>
FunctionImplementation; FunctionImplementation;
struct Functions { struct Functions {
@ -59,170 +59,170 @@ struct Functions {
static void DestroyThreadContext(); static void DestroyThreadContext();
static AqlValue IsNull(arangodb::aql::Query*, arangodb::AqlTransaction*, static AqlValue IsNull(arangodb::aql::Query*, arangodb::AqlTransaction*,
VPackFunctionParameters const&); VPackFunctionParameters const&, bool&);
static AqlValue IsBool(arangodb::aql::Query*, arangodb::AqlTransaction*, static AqlValue IsBool(arangodb::aql::Query*, arangodb::AqlTransaction*,
VPackFunctionParameters const&); VPackFunctionParameters const&, bool&);
static AqlValue IsNumber(arangodb::aql::Query*, arangodb::AqlTransaction*, static AqlValue IsNumber(arangodb::aql::Query*, arangodb::AqlTransaction*,
VPackFunctionParameters const&); VPackFunctionParameters const&, bool&);
static AqlValue IsString(arangodb::aql::Query*, arangodb::AqlTransaction*, static AqlValue IsString(arangodb::aql::Query*, arangodb::AqlTransaction*,
VPackFunctionParameters const&); VPackFunctionParameters const&, bool&);
static AqlValue IsArray(arangodb::aql::Query*, arangodb::AqlTransaction*, static AqlValue IsArray(arangodb::aql::Query*, arangodb::AqlTransaction*,
VPackFunctionParameters const&); VPackFunctionParameters const&, bool&);
static AqlValue IsObject(arangodb::aql::Query*, arangodb::AqlTransaction*, static AqlValue IsObject(arangodb::aql::Query*, arangodb::AqlTransaction*,
VPackFunctionParameters const&); VPackFunctionParameters const&, bool&);
static AqlValue ToNumber(arangodb::aql::Query*, arangodb::AqlTransaction*, static AqlValue ToNumber(arangodb::aql::Query*, arangodb::AqlTransaction*,
VPackFunctionParameters const&); VPackFunctionParameters const&, bool&);
static AqlValue ToString(arangodb::aql::Query*, arangodb::AqlTransaction*, static AqlValue ToString(arangodb::aql::Query*, arangodb::AqlTransaction*,
VPackFunctionParameters const&); VPackFunctionParameters const&, bool&);
static AqlValue ToBool(arangodb::aql::Query*, arangodb::AqlTransaction*, static AqlValue ToBool(arangodb::aql::Query*, arangodb::AqlTransaction*,
VPackFunctionParameters const&); VPackFunctionParameters const&, bool&);
static AqlValue ToArray(arangodb::aql::Query*, arangodb::AqlTransaction*, static AqlValue ToArray(arangodb::aql::Query*, arangodb::AqlTransaction*,
VPackFunctionParameters const&); VPackFunctionParameters const&, bool&);
static AqlValue Length(arangodb::aql::Query*, arangodb::AqlTransaction*, static AqlValue Length(arangodb::aql::Query*, arangodb::AqlTransaction*,
VPackFunctionParameters const&); VPackFunctionParameters const&, bool&);
static AqlValue First(arangodb::aql::Query*, arangodb::AqlTransaction*, static AqlValue First(arangodb::aql::Query*, arangodb::AqlTransaction*,
VPackFunctionParameters const&); VPackFunctionParameters const&, bool&);
static AqlValue Last(arangodb::aql::Query*, arangodb::AqlTransaction*, static AqlValue Last(arangodb::aql::Query*, arangodb::AqlTransaction*,
VPackFunctionParameters const&); VPackFunctionParameters const&, bool&);
static AqlValue Nth(arangodb::aql::Query*, arangodb::AqlTransaction*, static AqlValue Nth(arangodb::aql::Query*, arangodb::AqlTransaction*,
VPackFunctionParameters const&); VPackFunctionParameters const&, bool&);
static AqlValue Concat(arangodb::aql::Query*, arangodb::AqlTransaction*, static AqlValue Concat(arangodb::aql::Query*, arangodb::AqlTransaction*,
VPackFunctionParameters const&); VPackFunctionParameters const&, bool&);
static AqlValue Like(arangodb::aql::Query*, arangodb::AqlTransaction*, static AqlValue Like(arangodb::aql::Query*, arangodb::AqlTransaction*,
VPackFunctionParameters const&); VPackFunctionParameters const&, bool&);
static AqlValue Passthru(arangodb::aql::Query*, arangodb::AqlTransaction*, static AqlValue Passthru(arangodb::aql::Query*, arangodb::AqlTransaction*,
VPackFunctionParameters const&); VPackFunctionParameters const&, bool&);
static AqlValue Unset(arangodb::aql::Query*, arangodb::AqlTransaction*, static AqlValue Unset(arangodb::aql::Query*, arangodb::AqlTransaction*,
VPackFunctionParameters const&); VPackFunctionParameters const&, bool&);
static AqlValue UnsetRecursive(arangodb::aql::Query*, static AqlValue UnsetRecursive(arangodb::aql::Query*,
arangodb::AqlTransaction*, arangodb::AqlTransaction*,
VPackFunctionParameters const&); VPackFunctionParameters const&, bool&);
static AqlValue Keep(arangodb::aql::Query*, arangodb::AqlTransaction*, static AqlValue Keep(arangodb::aql::Query*, arangodb::AqlTransaction*,
VPackFunctionParameters const&); VPackFunctionParameters const&, bool&);
static AqlValue Merge(arangodb::aql::Query*, arangodb::AqlTransaction*, static AqlValue Merge(arangodb::aql::Query*, arangodb::AqlTransaction*,
VPackFunctionParameters const&); VPackFunctionParameters const&, bool&);
static AqlValue MergeRecursive(arangodb::aql::Query*, static AqlValue MergeRecursive(arangodb::aql::Query*,
arangodb::AqlTransaction*, arangodb::AqlTransaction*,
VPackFunctionParameters const&); VPackFunctionParameters const&, bool&);
static AqlValue Has(arangodb::aql::Query*, arangodb::AqlTransaction*, static AqlValue Has(arangodb::aql::Query*, arangodb::AqlTransaction*,
VPackFunctionParameters const&); VPackFunctionParameters const&, bool&);
static AqlValue Attributes(arangodb::aql::Query*, arangodb::AqlTransaction*, static AqlValue Attributes(arangodb::aql::Query*, arangodb::AqlTransaction*,
VPackFunctionParameters const&); VPackFunctionParameters const&, bool&);
static AqlValue Values(arangodb::aql::Query*, arangodb::AqlTransaction*, static AqlValue Values(arangodb::aql::Query*, arangodb::AqlTransaction*,
VPackFunctionParameters const&); VPackFunctionParameters const&, bool&);
static AqlValue Min(arangodb::aql::Query*, arangodb::AqlTransaction*, static AqlValue Min(arangodb::aql::Query*, arangodb::AqlTransaction*,
VPackFunctionParameters const&); VPackFunctionParameters const&, bool&);
static AqlValue Max(arangodb::aql::Query*, arangodb::AqlTransaction*, static AqlValue Max(arangodb::aql::Query*, arangodb::AqlTransaction*,
VPackFunctionParameters const&); VPackFunctionParameters const&, bool&);
static AqlValue Sum(arangodb::aql::Query*, arangodb::AqlTransaction*, static AqlValue Sum(arangodb::aql::Query*, arangodb::AqlTransaction*,
VPackFunctionParameters const&); VPackFunctionParameters const&, bool&);
static AqlValue Average(arangodb::aql::Query*, arangodb::AqlTransaction*, static AqlValue Average(arangodb::aql::Query*, arangodb::AqlTransaction*,
VPackFunctionParameters const&); VPackFunctionParameters const&, bool&);
static AqlValue Md5(arangodb::aql::Query*, arangodb::AqlTransaction*, static AqlValue Md5(arangodb::aql::Query*, arangodb::AqlTransaction*,
VPackFunctionParameters const&); VPackFunctionParameters const&, bool&);
static AqlValue Sha1(arangodb::aql::Query*, arangodb::AqlTransaction*, static AqlValue Sha1(arangodb::aql::Query*, arangodb::AqlTransaction*,
VPackFunctionParameters const&); VPackFunctionParameters const&, bool&);
static AqlValue Unique(arangodb::aql::Query*, arangodb::AqlTransaction*, static AqlValue Unique(arangodb::aql::Query*, arangodb::AqlTransaction*,
VPackFunctionParameters const&); VPackFunctionParameters const&, bool&);
static AqlValue SortedUnique(arangodb::aql::Query*, static AqlValue SortedUnique(arangodb::aql::Query*,
arangodb::AqlTransaction*, arangodb::AqlTransaction*,
VPackFunctionParameters const&); VPackFunctionParameters const&, bool&);
static AqlValue Union(arangodb::aql::Query*, arangodb::AqlTransaction*, static AqlValue Union(arangodb::aql::Query*, arangodb::AqlTransaction*,
VPackFunctionParameters const&); VPackFunctionParameters const&, bool&);
static AqlValue UnionDistinct(arangodb::aql::Query*, static AqlValue UnionDistinct(arangodb::aql::Query*,
arangodb::AqlTransaction*, arangodb::AqlTransaction*,
VPackFunctionParameters const&); VPackFunctionParameters const&, bool&);
static AqlValue Intersection(arangodb::aql::Query*, static AqlValue Intersection(arangodb::aql::Query*,
arangodb::AqlTransaction*, arangodb::AqlTransaction*,
VPackFunctionParameters const&); VPackFunctionParameters const&, bool&);
static AqlValue Neighbors(arangodb::aql::Query*, arangodb::AqlTransaction*, static AqlValue Neighbors(arangodb::aql::Query*, arangodb::AqlTransaction*,
VPackFunctionParameters const&); VPackFunctionParameters const&, bool&);
static AqlValue Near(arangodb::aql::Query*, arangodb::AqlTransaction*, static AqlValue Near(arangodb::aql::Query*, arangodb::AqlTransaction*,
VPackFunctionParameters const&); VPackFunctionParameters const&, bool&);
static AqlValue Within(arangodb::aql::Query*, arangodb::AqlTransaction*, static AqlValue Within(arangodb::aql::Query*, arangodb::AqlTransaction*,
VPackFunctionParameters const&); VPackFunctionParameters const&, bool&);
static AqlValue Flatten(arangodb::aql::Query*, arangodb::AqlTransaction*, static AqlValue Flatten(arangodb::aql::Query*, arangodb::AqlTransaction*,
VPackFunctionParameters const&); VPackFunctionParameters const&, bool&);
static AqlValue Zip(arangodb::aql::Query*, arangodb::AqlTransaction*, static AqlValue Zip(arangodb::aql::Query*, arangodb::AqlTransaction*,
VPackFunctionParameters const&); VPackFunctionParameters const&, bool&);
static AqlValue ParseIdentifier(arangodb::aql::Query*, static AqlValue ParseIdentifier(arangodb::aql::Query*,
arangodb::AqlTransaction*, arangodb::AqlTransaction*,
VPackFunctionParameters const&); VPackFunctionParameters const&, bool&);
static AqlValue Minus(arangodb::aql::Query*, arangodb::AqlTransaction*, static AqlValue Minus(arangodb::aql::Query*, arangodb::AqlTransaction*,
VPackFunctionParameters const&); VPackFunctionParameters const&, bool&);
static AqlValue Document(arangodb::aql::Query*, arangodb::AqlTransaction*, static AqlValue Document(arangodb::aql::Query*, arangodb::AqlTransaction*,
VPackFunctionParameters const&); VPackFunctionParameters const&, bool&);
static AqlValue Edges(arangodb::aql::Query*, arangodb::AqlTransaction*, static AqlValue Edges(arangodb::aql::Query*, arangodb::AqlTransaction*,
VPackFunctionParameters const&); VPackFunctionParameters const&, bool&);
static AqlValue Round(arangodb::aql::Query*, arangodb::AqlTransaction*, static AqlValue Round(arangodb::aql::Query*, arangodb::AqlTransaction*,
VPackFunctionParameters const&); VPackFunctionParameters const&, bool&);
static AqlValue Abs(arangodb::aql::Query*, arangodb::AqlTransaction*, static AqlValue Abs(arangodb::aql::Query*, arangodb::AqlTransaction*,
VPackFunctionParameters const&); VPackFunctionParameters const&, bool&);
static AqlValue Ceil(arangodb::aql::Query*, arangodb::AqlTransaction*, static AqlValue Ceil(arangodb::aql::Query*, arangodb::AqlTransaction*,
VPackFunctionParameters const&); VPackFunctionParameters const&, bool&);
static AqlValue Floor(arangodb::aql::Query*, arangodb::AqlTransaction*, static AqlValue Floor(arangodb::aql::Query*, arangodb::AqlTransaction*,
VPackFunctionParameters const&); VPackFunctionParameters const&, bool&);
static AqlValue Sqrt(arangodb::aql::Query*, arangodb::AqlTransaction*, static AqlValue Sqrt(arangodb::aql::Query*, arangodb::AqlTransaction*,
VPackFunctionParameters const&); VPackFunctionParameters const&, bool&);
static AqlValue Pow(arangodb::aql::Query*, arangodb::AqlTransaction*, static AqlValue Pow(arangodb::aql::Query*, arangodb::AqlTransaction*,
VPackFunctionParameters const&); VPackFunctionParameters const&, bool&);
static AqlValue Rand(arangodb::aql::Query*, arangodb::AqlTransaction*, static AqlValue Rand(arangodb::aql::Query*, arangodb::AqlTransaction*,
VPackFunctionParameters const&); VPackFunctionParameters const&, bool&);
static AqlValue FirstDocument(arangodb::aql::Query*, static AqlValue FirstDocument(arangodb::aql::Query*,
arangodb::AqlTransaction*, arangodb::AqlTransaction*,
VPackFunctionParameters const&); VPackFunctionParameters const&, bool&);
static AqlValue FirstList(arangodb::aql::Query*, arangodb::AqlTransaction*, static AqlValue FirstList(arangodb::aql::Query*, arangodb::AqlTransaction*,
VPackFunctionParameters const&); VPackFunctionParameters const&, bool&);
static AqlValue Push(arangodb::aql::Query*, arangodb::AqlTransaction*, static AqlValue Push(arangodb::aql::Query*, arangodb::AqlTransaction*,
VPackFunctionParameters const&); VPackFunctionParameters const&, bool&);
static AqlValue Pop(arangodb::aql::Query*, arangodb::AqlTransaction*, static AqlValue Pop(arangodb::aql::Query*, arangodb::AqlTransaction*,
VPackFunctionParameters const&); VPackFunctionParameters const&, bool&);
static AqlValue Append(arangodb::aql::Query*, arangodb::AqlTransaction*, static AqlValue Append(arangodb::aql::Query*, arangodb::AqlTransaction*,
VPackFunctionParameters const&); VPackFunctionParameters const&, bool&);
static AqlValue Unshift(arangodb::aql::Query*, arangodb::AqlTransaction*, static AqlValue Unshift(arangodb::aql::Query*, arangodb::AqlTransaction*,
VPackFunctionParameters const&); VPackFunctionParameters const&, bool&);
static AqlValue Shift(arangodb::aql::Query*, arangodb::AqlTransaction*, static AqlValue Shift(arangodb::aql::Query*, arangodb::AqlTransaction*,
VPackFunctionParameters const&); VPackFunctionParameters const&, bool&);
static AqlValue RemoveValue(arangodb::aql::Query*, arangodb::AqlTransaction*, static AqlValue RemoveValue(arangodb::aql::Query*, arangodb::AqlTransaction*,
VPackFunctionParameters const&); VPackFunctionParameters const&, bool&);
static AqlValue RemoveValues(arangodb::aql::Query*, static AqlValue RemoveValues(arangodb::aql::Query*,
arangodb::AqlTransaction*, arangodb::AqlTransaction*,
VPackFunctionParameters const&); VPackFunctionParameters const&, bool&);
static AqlValue RemoveNth(arangodb::aql::Query*, arangodb::AqlTransaction*, static AqlValue RemoveNth(arangodb::aql::Query*, arangodb::AqlTransaction*,
VPackFunctionParameters const&); VPackFunctionParameters const&, bool&);
static AqlValue NotNull(arangodb::aql::Query*, arangodb::AqlTransaction*, static AqlValue NotNull(arangodb::aql::Query*, arangodb::AqlTransaction*,
VPackFunctionParameters const&); VPackFunctionParameters const&, bool&);
static AqlValue CurrentDatabase(arangodb::aql::Query*, static AqlValue CurrentDatabase(arangodb::aql::Query*,
arangodb::AqlTransaction*, arangodb::AqlTransaction*,
VPackFunctionParameters const&); VPackFunctionParameters const&, bool&);
static AqlValue CollectionCount(arangodb::aql::Query*, static AqlValue CollectionCount(arangodb::aql::Query*,
arangodb::AqlTransaction*, arangodb::AqlTransaction*,
VPackFunctionParameters const&); VPackFunctionParameters const&, bool&);
static AqlValue VarianceSample(arangodb::aql::Query*, static AqlValue VarianceSample(arangodb::aql::Query*,
arangodb::AqlTransaction*, arangodb::AqlTransaction*,
VPackFunctionParameters const&); VPackFunctionParameters const&, bool&);
static AqlValue VariancePopulation(arangodb::aql::Query*, static AqlValue VariancePopulation(arangodb::aql::Query*,
arangodb::AqlTransaction*, arangodb::AqlTransaction*,
VPackFunctionParameters const&); VPackFunctionParameters const&, bool&);
static AqlValue StdDevSample(arangodb::aql::Query*, static AqlValue StdDevSample(arangodb::aql::Query*,
arangodb::AqlTransaction*, arangodb::AqlTransaction*,
VPackFunctionParameters const&); VPackFunctionParameters const&, bool&);
static AqlValue StdDevPopulation(arangodb::aql::Query*, static AqlValue StdDevPopulation(arangodb::aql::Query*,
arangodb::AqlTransaction*, arangodb::AqlTransaction*,
VPackFunctionParameters const&); VPackFunctionParameters const&, bool&);
static AqlValue Median(arangodb::aql::Query*, arangodb::AqlTransaction*, static AqlValue Median(arangodb::aql::Query*, arangodb::AqlTransaction*,
VPackFunctionParameters const&); VPackFunctionParameters const&, bool&);
static AqlValue Percentile(arangodb::aql::Query*, arangodb::AqlTransaction*, static AqlValue Percentile(arangodb::aql::Query*, arangodb::AqlTransaction*,
VPackFunctionParameters const&); VPackFunctionParameters const&, bool&);
static AqlValue Range(arangodb::aql::Query*, arangodb::AqlTransaction*, static AqlValue Range(arangodb::aql::Query*, arangodb::AqlTransaction*,
VPackFunctionParameters const&); VPackFunctionParameters const&, bool&);
static AqlValue Position(arangodb::aql::Query*, arangodb::AqlTransaction*, static AqlValue Position(arangodb::aql::Query*, arangodb::AqlTransaction*,
VPackFunctionParameters const&); VPackFunctionParameters const&, bool&);
static AqlValue Fulltext(arangodb::aql::Query*, arangodb::AqlTransaction*, static AqlValue Fulltext(arangodb::aql::Query*, arangodb::AqlTransaction*,
VPackFunctionParameters const&); VPackFunctionParameters const&, bool&);
static AqlValue IsSameCollection(arangodb::aql::Query*, static AqlValue IsSameCollection(arangodb::aql::Query*,
arangodb::AqlTransaction*, arangodb::AqlTransaction*,
VPackFunctionParameters const&); VPackFunctionParameters const&, bool&);
}; };
} }
} }

View File

@ -69,7 +69,7 @@ static VPackBuilder FalseBuilder;
/// expressions but must never be freed /// expressions but must never be freed
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
static VPackBuilder ArrayBuilder; static VPackBuilder EmptyArrayBuilder;
// attribute exclude handler for skipping over system attributes // attribute exclude handler for skipping over system attributes
@ -129,8 +129,8 @@ void VelocyPackHelper::initialize() {
// False value // False value
FalseBuilder.add(VPackValue(false)); FalseBuilder.add(VPackValue(false));
// Array value (empty) // Array value (empty)
ArrayBuilder.openArray(); EmptyArrayBuilder.openArray();
ArrayBuilder.close(); EmptyArrayBuilder.close();
} }
arangodb::velocypack::Slice VelocyPackHelper::NullValue() { arangodb::velocypack::Slice VelocyPackHelper::NullValue() {
@ -145,8 +145,15 @@ arangodb::velocypack::Slice VelocyPackHelper::FalseValue() {
return FalseBuilder.slice(); return FalseBuilder.slice();
} }
arangodb::velocypack::Slice VelocyPackHelper::ArrayValue() { arangodb::velocypack::Slice VelocyPackHelper::BooleanValue(bool value) {
return ArrayBuilder.slice(); if (value) {
return TrueBuilder.slice();
}
return FalseBuilder.slice();
}
arangodb::velocypack::Slice VelocyPackHelper::EmptyArrayValue() {
return EmptyArrayBuilder.slice();
} }
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////

View File

@ -213,7 +213,8 @@ class VelocyPackHelper {
static arangodb::velocypack::Slice NullValue(); static arangodb::velocypack::Slice NullValue();
static arangodb::velocypack::Slice TrueValue(); static arangodb::velocypack::Slice TrueValue();
static arangodb::velocypack::Slice FalseValue(); static arangodb::velocypack::Slice FalseValue();
static arangodb::velocypack::Slice ArrayValue(); static arangodb::velocypack::Slice BooleanValue(bool);
static arangodb::velocypack::Slice EmptyArrayValue();
}; };
} }
} }