1
0
Fork 0

clean up AQL functions a little bit (#5401)

This commit is contained in:
Jan 2018-05-19 21:15:14 +02:00 committed by GitHub
parent 6139ae6225
commit 379e848919
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 6 additions and 25 deletions

View File

@ -345,7 +345,6 @@ void AqlFunctionFeature::addMiscFunctions() {
add({"PASSTHRU", ".", false, false, true, &Functions::Passthru});
addAlias("NOOPT", "PASSTHRU");
add({"V8", ".", true, false, true });
add({"TEST_INTERNAL", ".,.", false, false, true });
add({"SLEEP", ".", false, true, true, &Functions::Sleep});
add({"COLLECTIONS", "", false, true, false, &Functions::Collections});
add({"NOT_NULL", ".|+", true, false, true, &Functions::NotNull});

View File

@ -1012,7 +1012,7 @@ AqlValue Expression::executeSimpleExpressionFCallJS(
} else {
// a call to a built-in V8 function
auto func = static_cast<Function*>(node->getData());
jsName = "AQL_" + func->nonAliasedName;
jsName = "AQL_" + func->name;
for (size_t i = 0; i < n; ++i) {
auto arg = member->getMemberUnchecked(i);

View File

@ -33,7 +33,6 @@ Function::Function(std::string const& name,
FunctionImplementation implementation,
ExecutionCondition condition)
: name(name),
nonAliasedName(name),
arguments(arguments),
isDeterministic(isDeterministic),
canThrow(canThrow),
@ -42,24 +41,19 @@ Function::Function(std::string const& name,
condition(condition),
conversions() {
initializeArguments();
// condition must only be set if we also have an implementation
TRI_ASSERT(implementation != nullptr || condition == nullptr);
LOG_TOPIC(TRACE, Logger::FIXME) << "setting up AQL function '" << name <<
LOG_TOPIC(TRACE, Logger::FIXME) << "registered AQL function '" << name <<
"'. cacheable: " << isCacheable() <<
", deterministic: " << isDeterministic <<
", canThrow: " << canThrow <<
", canRunOnDBServer: " << canRunOnDBServer <<
", hasCxxImplementation: " << (implementation != nullptr) <<
", hasConversions: " << !conversions.empty();
// condition must only be set if we also have an implementation
TRI_ASSERT(implementation != nullptr || condition == nullptr);
LOG_TOPIC(TRACE, Logger::FIXME) << "setting up AQL function '" << name << ", hasImpl:" << hasImplementation();
}
/// @brief destroy the function
Function::~Function() {}
/// @brief parse the argument list and set the minimum and maximum number of
/// arguments
void Function::initializeArguments() {

View File

@ -42,9 +42,6 @@ struct Function {
FunctionImplementation implementation = nullptr,
ExecutionCondition = nullptr);
/// @brief destroy the function
~Function();
inline bool hasImplementation() const {
return implementation != nullptr;
}
@ -68,11 +65,6 @@ struct Function {
return conversions[position];
}
/// @brief return the name of the function's v8 implementation
std::string v8FunctionName() const {
return std::string("AQL_") + nonAliasedName;
}
/// @brief parse the argument list and set the minimum and maximum number of
/// arguments
void initializeArguments();
@ -80,9 +72,6 @@ struct Function {
/// @brief function name (name visible to the end user, may be an alias)
std::string name;
/// @brief function name (internal, must not be an alias)
std::string const nonAliasedName;
/// @brief function arguments
char const* arguments;

View File

@ -4703,7 +4703,6 @@ AqlValue Functions::IsInPolygon(arangodb::aql::Query* query,
AqlValue p2 = ExtractFunctionParameterValue(parameters, 1);
AqlValue p3 = ExtractFunctionParameterValue(parameters, 2);
LOG_TOPIC(WARN, Logger::QUERIES) << "IS_IN_POLYGON is deprecated use GEO_CONTAINS";
if (!coords.isArray()) {
::registerWarning(query, "IS_IN_POLYGON", TRI_ERROR_QUERY_ARRAY_EXPECTED);
return AqlValue(AqlValueHintNull());
@ -6721,7 +6720,7 @@ AqlValue Functions::CallApplyBackend(arangodb::aql::Query* query,
args[2] = TRI_V8_ASCII_STRING(isolate, AFN);
} else {
// a call to a built-in V8 function
jsName = "AQL_" + func->nonAliasedName;
jsName = "AQL_" + func->name;
for (int i = 0; i < n; ++i) {
args[i] = invokeParams[i].toV8(isolate, trx);
}