mirror of https://gitee.com/bigwinds/arangodb
Get rid of some TODOs and FIXMEs.
This commit is contained in:
parent
cfb26c8b0a
commit
59c1935466
|
@ -275,7 +275,7 @@ AqlItemBlock* AqlItemBlock::slice (size_t from,
|
||||||
TRI_ASSERT(from < to && to <= _nrItems);
|
TRI_ASSERT(from < to && to <= _nrItems);
|
||||||
|
|
||||||
std::unordered_map<AqlValue, AqlValue> cache;
|
std::unordered_map<AqlValue, AqlValue> cache;
|
||||||
// TODO: should we pre-reserve space for cache to avoid later re-allocations?
|
cache.reserve((to-from)*_nrRegs / 4 + 1);
|
||||||
|
|
||||||
AqlItemBlock* res = nullptr;
|
AqlItemBlock* res = nullptr;
|
||||||
try {
|
try {
|
||||||
|
@ -327,7 +327,7 @@ AqlItemBlock* AqlItemBlock::slice (std::vector<size_t>& chosen,
|
||||||
TRI_ASSERT(from < to && to <= chosen.size());
|
TRI_ASSERT(from < to && to <= chosen.size());
|
||||||
|
|
||||||
std::unordered_map<AqlValue, AqlValue> cache;
|
std::unordered_map<AqlValue, AqlValue> cache;
|
||||||
// TODO: should we pre-reserve space for cache to avoid later re-allocations?
|
cache.reserve((to-from)*_nrRegs / 4 + 1);
|
||||||
|
|
||||||
AqlItemBlock* res = nullptr;
|
AqlItemBlock* res = nullptr;
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -97,8 +97,9 @@ void AqlValue::destroy () {
|
||||||
// do nothing here, since data pointers need not be freed
|
// do nothing here, since data pointers need not be freed
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default: {
|
case EMPTY: {
|
||||||
TRI_ASSERT(false);
|
// do nothing
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -453,7 +454,7 @@ v8::Handle<v8::Value> AqlValue::toV8 (triagens::arango::AqlTransaction* trx,
|
||||||
}
|
}
|
||||||
|
|
||||||
case EMPTY: {
|
case EMPTY: {
|
||||||
return v8::Object::New(); // TODO?
|
return v8::Undefined();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -506,7 +507,6 @@ Json AqlValue::toJson (triagens::arango::AqlTransaction* trx,
|
||||||
json(TRI_VOC_ATTRIBUTE_TO, Json(to));
|
json(TRI_VOC_ATTRIBUTE_TO, Json(to));
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: return _from and _to, and fix order of attributes!
|
|
||||||
return json;
|
return json;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -693,7 +693,6 @@ TRI_json_t* AstNode::toJson (TRI_memory_zone_t* zone,
|
||||||
|
|
||||||
TRI_ASSERT(variable != nullptr);
|
TRI_ASSERT(variable != nullptr);
|
||||||
|
|
||||||
/// TODO: use variable.toJson()!!!
|
|
||||||
TRI_Insert3ArrayJson(zone, node, "name", TRI_CreateStringCopyJson(zone, variable->name.c_str()));
|
TRI_Insert3ArrayJson(zone, node, "name", TRI_CreateStringCopyJson(zone, variable->name.c_str()));
|
||||||
TRI_Insert3ArrayJson(zone, node, "id", TRI_CreateNumberJson(zone, static_cast<double>(variable->id)));
|
TRI_Insert3ArrayJson(zone, node, "id", TRI_CreateNumberJson(zone, static_cast<double>(variable->id)));
|
||||||
}
|
}
|
||||||
|
|
|
@ -84,7 +84,7 @@ void BindParameters::process () {
|
||||||
|
|
||||||
if (! TRI_IsStringJson(key)) {
|
if (! TRI_IsStringJson(key)) {
|
||||||
// no string, should not happen
|
// no string, should not happen
|
||||||
THROW_ARANGO_EXCEPTION(TRI_ERROR_QUERY_BIND_PARAMETER_TYPE); // TODO: add parameter name
|
THROW_ARANGO_EXCEPTION(TRI_ERROR_QUERY_BIND_PARAMETER_TYPE);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string const k(key->_value._string.data, key->_value._string.length - 1);
|
std::string const k(key->_value._string.data, key->_value._string.length - 1);
|
||||||
|
|
|
@ -2924,8 +2924,6 @@ int ModificationBlock::extractKey (AqlValue const& value,
|
||||||
if (value.isArray()) {
|
if (value.isArray()) {
|
||||||
Json member(value.extractArrayMember(_trx, document, TRI_VOC_ATTRIBUTE_KEY));
|
Json member(value.extractArrayMember(_trx, document, TRI_VOC_ATTRIBUTE_KEY));
|
||||||
|
|
||||||
// TODO: allow _id, too
|
|
||||||
|
|
||||||
TRI_json_t const* json = member.json();
|
TRI_json_t const* json = member.json();
|
||||||
if (TRI_IsStringJson(json)) {
|
if (TRI_IsStringJson(json)) {
|
||||||
key = std::string(json->_value._string.data, json->_value._string.length - 1);
|
key = std::string(json->_value._string.data, json->_value._string.length - 1);
|
||||||
|
|
|
@ -1365,7 +1365,7 @@ class SortToIndexNode : public WalkerWorker<ExecutionNode> {
|
||||||
node->vocbase(),
|
node->vocbase(),
|
||||||
node->collection(),
|
node->collection(),
|
||||||
node->outVariable(),
|
node->outVariable(),
|
||||||
idx.index, /// TODO: estimate cost on match quality
|
idx.index,
|
||||||
result.second,
|
result.second,
|
||||||
(idx.doesMatch && idx.reverse));
|
(idx.doesMatch && idx.reverse));
|
||||||
newPlan->registerNode(newNode);
|
newPlan->registerNode(newNode);
|
||||||
|
@ -1397,7 +1397,7 @@ class SortToIndexNode : public WalkerWorker<ExecutionNode> {
|
||||||
switch (en->getType()) {
|
switch (en->getType()) {
|
||||||
case EN::ENUMERATE_LIST:
|
case EN::ENUMERATE_LIST:
|
||||||
case EN::CALCULATION:
|
case EN::CALCULATION:
|
||||||
case EN::SUBQUERY: /// TODO: find out whether it may throw
|
case EN::SUBQUERY:
|
||||||
case EN::FILTER:
|
case EN::FILTER:
|
||||||
return false; // skip. we don't care.
|
return false; // skip. we don't care.
|
||||||
|
|
||||||
|
@ -1439,9 +1439,9 @@ int triagens::aql::useIndexForSort (Optimizer* opt,
|
||||||
for (auto n : nodes) {
|
for (auto n : nodes) {
|
||||||
auto thisSortNode = static_cast<SortNode*>(n);
|
auto thisSortNode = static_cast<SortNode*>(n);
|
||||||
SortAnalysis node(thisSortNode);
|
SortAnalysis node(thisSortNode);
|
||||||
if (node.isAnalyzeable()) {
|
if (node.isAnalyzeable() && ! n->getDependencies().empty()) {
|
||||||
SortToIndexNode finder(opt, plan, &node, rule->level);
|
SortToIndexNode finder(opt, plan, &node, rule->level);
|
||||||
thisSortNode->walk(&finder);/// todo auf der dependency anfangen
|
thisSortNode->getDependencies()[0]->walk(&finder);
|
||||||
if (finder.planModified) {
|
if (finder.planModified) {
|
||||||
planModified = true;
|
planModified = true;
|
||||||
}
|
}
|
||||||
|
@ -2174,8 +2174,6 @@ class RemoveToEnumCollFinder: public WalkerWorker<ExecutionNode> {
|
||||||
}
|
}
|
||||||
auto cn = static_cast<CalculationNode*>(en);
|
auto cn = static_cast<CalculationNode*>(en);
|
||||||
auto fn = static_cast<FilterNode*>(_lastNode);
|
auto fn = static_cast<FilterNode*>(_lastNode);
|
||||||
// FIXME should the following be an assertion? I.e. can it
|
|
||||||
// ever happen?
|
|
||||||
|
|
||||||
// check these are a Calc-Filter pair
|
// check these are a Calc-Filter pair
|
||||||
if (cn->getVariablesSetHere()[0]->id != fn->getVariablesUsedHere()[0]->id) {
|
if (cn->getVariablesSetHere()[0]->id != fn->getVariablesUsedHere()[0]->id) {
|
||||||
|
@ -2190,7 +2188,7 @@ class RemoveToEnumCollFinder: public WalkerWorker<ExecutionNode> {
|
||||||
break; //abort . . .
|
break; //abort . . .
|
||||||
}
|
}
|
||||||
if (varsUsedHere[0]->id != _variable->id) {
|
if (varsUsedHere[0]->id != _variable->id) {
|
||||||
break; // abort . . . FIXME is this the desired behaviour??
|
break;
|
||||||
}
|
}
|
||||||
_lastNode = en;
|
_lastNode = en;
|
||||||
return false; // continue . . .
|
return false; // continue . . .
|
||||||
|
@ -2200,7 +2198,7 @@ class RemoveToEnumCollFinder: public WalkerWorker<ExecutionNode> {
|
||||||
// and that we have already seen a remove node
|
// and that we have already seen a remove node
|
||||||
TRI_ASSERT(_enumColl != nullptr);
|
TRI_ASSERT(_enumColl != nullptr);
|
||||||
if (en->id() != _enumColl->id()) {
|
if (en->id() != _enumColl->id()) {
|
||||||
break; // abort . . . FIXME is this the desired behaviour??
|
break;
|
||||||
}
|
}
|
||||||
return true; // reached the end!
|
return true; // reached the end!
|
||||||
}
|
}
|
||||||
|
|
|
@ -498,7 +498,6 @@ void RestAqlHandler::getInfoQuery (std::string const& operation,
|
||||||
try {
|
try {
|
||||||
int64_t number;
|
int64_t number;
|
||||||
if (operation == "count") {
|
if (operation == "count") {
|
||||||
//TODO shardId.empty()!
|
|
||||||
number = query->engine()->count();
|
number = query->engine()->count();
|
||||||
if (number == -1) {
|
if (number == -1) {
|
||||||
answerBody("count", Json("unknown"));
|
answerBody("count", Json("unknown"));
|
||||||
|
|
Loading…
Reference in New Issue