mirror of https://gitee.com/bigwinds/arangodb
test fixes
This commit is contained in:
parent
a809b58541
commit
413ce6c50c
|
@ -2751,7 +2751,16 @@ namespace triagens {
|
|||
|
||||
if (_state == 0) {
|
||||
if (_offset > 0) {
|
||||
ExecutionBlock::_dependencies[0]->skip(_offset);
|
||||
// TODO: here we're calling getSome to skip over elements
|
||||
// this must be implemented properly using skip() when it works
|
||||
// ATM skip() doesn't work here in the following case:
|
||||
// FOR i IN 0..99 LIMIT 10,50 LIMIT 1,20 RETURN i (returns wrong rows ATM)
|
||||
// ExecutionBlock::_dependencies[0]->skip(_offset);
|
||||
auto tmp = ExecutionBlock::_dependencies[0]->getSome(_offset, _offset);
|
||||
if (tmp != nullptr) {
|
||||
delete tmp;
|
||||
}
|
||||
|
||||
_state = 1;
|
||||
_count = 0;
|
||||
if (_limit == 0) {
|
||||
|
|
|
@ -83,7 +83,7 @@ ExecutionPlan* ExecutionPlan::instanciateFromAst (Ast const* ast) {
|
|||
try {
|
||||
plan->_root = plan->fromNode(ast, root);
|
||||
|
||||
std::cout << plan->_root->toJson().toString() << "\n";
|
||||
// std::cout << plan->_root->toJson().toString() << "\n";
|
||||
|
||||
return plan;
|
||||
}
|
||||
|
|
|
@ -180,7 +180,7 @@ QueryResult Query::execute () {
|
|||
parser.ast()->injectBindParameters(_bindParameters);
|
||||
// optimize the ast
|
||||
parser.ast()->optimize();
|
||||
std::cout << "AST: " << triagens::basics::JsonHelper::toString(parser.ast()->toJson(TRI_UNKNOWN_MEM_ZONE)) << "\n";
|
||||
// std::cout << "AST: " << triagens::basics::JsonHelper::toString(parser.ast()->toJson(TRI_UNKNOWN_MEM_ZONE)) << "\n";
|
||||
|
||||
triagens::arango::AqlTransaction<triagens::arango::V8TransactionContext<true>> trx(_vocbase, _collections.collections());
|
||||
|
||||
|
|
|
@ -252,7 +252,7 @@ V8Executor::~V8Executor () {
|
|||
V8Expression* V8Executor::generateExpression (AstNode const* node) {
|
||||
generateCodeExpression(node);
|
||||
|
||||
std::cout << "Executor::generateExpression: " << _buffer->c_str() << "\n";
|
||||
// std::cout << "Executor::generateExpression: " << _buffer->c_str() << "\n";
|
||||
|
||||
v8::TryCatch tryCatch;
|
||||
// compile the expression
|
||||
|
@ -272,7 +272,7 @@ V8Expression* V8Executor::generateExpression (AstNode const* node) {
|
|||
TRI_json_t* V8Executor::executeExpression (AstNode const* node) {
|
||||
generateCodeExpression(node);
|
||||
|
||||
std::cout << "Executor::ExecuteExpression: " << _buffer->c_str() << "\n";
|
||||
// std::cout << "Executor::ExecuteExpression: " << _buffer->c_str() << "\n";
|
||||
|
||||
// note: if this function is called without an already opened handle scope,
|
||||
// it will fail badly
|
||||
|
|
|
@ -293,14 +293,10 @@ function ahuacatlQueryOptimiserLimitTestSuite () {
|
|||
for (var i = 0; i < tests.length; ++i) {
|
||||
var test = tests[i];
|
||||
|
||||
var query = "FOR c IN " + cn + " LIMIT " + test.offset + ", " + test.limit + " LIMIT " + test.offset2 + ", " + test.limit2 + " RETURN c";
|
||||
var query = "FOR c IN " + cn + " SORT c.value LIMIT " + test.offset + ", " + test.limit + " LIMIT " + test.offset2 + ", " + test.limit2 + " RETURN c";
|
||||
|
||||
var actual = getQueryResults(query);
|
||||
assertEqual(test.expectedLength, actual.length);
|
||||
|
||||
var explain = getQueryExplanation(query);
|
||||
assertEqual("for", explain[0].type);
|
||||
assertEqual(test.offset + test.limit, explain[0]["expression"]["extra"]["limit"]);
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -671,10 +667,10 @@ function ahuacatlQueryOptimiserLimitTestSuite () {
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
testLimitNested3 : function () {
|
||||
var query = "FOR o IN [ 1, 2, 3 ] FOR i IN [ 5, 6, 7 ] LIMIT 1, 1 RETURN { o: o, i: i }";
|
||||
var query = "FOR o IN [ 1, 2, 3 ] FOR i IN [ 5, 6, 7 ] SORT o, i LIMIT 1, 1 RETURN { o: o, i: i }";
|
||||
|
||||
var actual = getQueryResults(query);
|
||||
assertEqual([ { i: 6, o: 2 } ], actual);
|
||||
assertEqual([ { i: 6, o: 1 } ], actual);
|
||||
},
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
Loading…
Reference in New Issue