diff --git a/js/server/tests/aql-optimizer-rule-use-index-for-sort.js b/js/server/tests/aql-optimizer-rule-use-index-for-sort.js index 6d353c28f9..0d794e02e5 100644 --- a/js/server/tests/aql-optimizer-rule-use-index-for-sort.js +++ b/js/server/tests/aql-optimizer-rule-use-index-for-sort.js @@ -660,38 +660,38 @@ function optimizerRuleTestSuite() { //////////////////////////////////////////////////////////////////////////////// testRangeBandpassInvalid: function () { // TODO: this doesn't do anything. should it simply flush that range since its empty? or even raise? -> NoResultsNode???? -// var query = "FOR v IN " + colName + " FILTER v.a > 7 && v.a < 4 RETURN [v.a, v.b]"; -// -// var XPresult; -// var QResults=[]; -// -// // the index we will compare to sorts by a & b, so we need to re-sort the result here to accomplish similarity. -// QResults[0] = AQL_EXECUTE(query, { }, paramNone).json.sort(sortArray); -// -// // -> use-index-range alone. -// QResults[1] = AQL_EXECUTE(query, { }, paramIndexRange).json; -// -// -// XPresult = AQL_EXPLAIN(query, { }, paramIndexRange); -// require("internal").print(XPresult); -// assertEqual([ secondRuleName ], XPresult.plan.rules); -// // the sortnode and its calculation node should be there. -// hasCalculationNodes(XPresult, 2); -// -// // The IndexRangeNode created by this rule should be more clever, it knows the ranges. -// var RAs = getRangeAttributes(XPresult); -// require("internal").print(RAs); -// var first = getRangeAttribute(RAs, "v", "a", 1); -// -// require("internal").print(first); -// require("internal").print(first); -// assertEqual(first.low.bound.vType, "int", "Type is int"); -// assertEqual(first.low.bound.value, 4, "proper value was set"); -// assertEqual(first.high.bound.vType, "int", "Type is int"); -// assertEqual(first.high.bound.value, 10, "proper value was set"); -// -// assertTrue(isEqual(QResults[0], QResults[1]), "Results are Equal?"); -// + var query = "FOR v IN " + colName + " FILTER v.a > 7 && v.a < 4 RETURN [v.a, v.b]"; + + var XPresult; + var QResults=[]; + + // the index we will compare to sorts by a & b, so we need to re-sort the result here to accomplish similarity. + QResults[0] = AQL_EXECUTE(query, { }, paramNone).json.sort(sortArray); + + // -> use-index-range alone. + QResults[1] = AQL_EXECUTE(query, { }, paramIndexRange).json; + + + XPresult = AQL_EXPLAIN(query, { }, paramIndexRange); + require("internal").print(XPresult); + assertEqual([ secondRuleName ], XPresult.plan.rules); + // the sortnode and its calculation node should be there. + hasCalculationNodes(XPresult, 2); + + // The IndexRangeNode created by this rule should be more clever, it knows the ranges. + var RAs = getRangeAttributes(XPresult); + require("internal").print(RAs); + var first = getRangeAttribute(RAs, "v", "a", 1); + + require("internal").print(first); + require("internal").print(first); + assertEqual(first.low.bound.vType, "int", "Type is int"); + assertEqual(first.low.bound.value, 4, "proper value was set"); + assertEqual(first.high.bound.vType, "int", "Type is int"); + assertEqual(first.high.bound.value, 10, "proper value was set"); + + assertTrue(isEqual(QResults[0], QResults[1]), "Results are Equal?"); + },