mirror of https://gitee.com/bigwinds/arangodb
parent
55ca6c8660
commit
4290f381af
|
@ -1,6 +1,8 @@
|
||||||
v3.5.2 (XXXX-XX-XX)
|
v3.5.2 (XXXX-XX-XX)
|
||||||
-------------------
|
-------------------
|
||||||
|
|
||||||
|
* Fixed issue #10270: Query: Expecting type Array or Object (while executing).
|
||||||
|
|
||||||
* Fix a problem with AQL constrained sort in the cluster, which might abort
|
* Fix a problem with AQL constrained sort in the cluster, which might abort
|
||||||
queries. The AQL sort-limit optimization rule may now also speed up fullCount
|
queries. The AQL sort-limit optimization rule may now also speed up fullCount
|
||||||
with sorted indexes and a limit in the cluster.
|
with sorted indexes and a limit in the cluster.
|
||||||
|
@ -9,8 +11,8 @@ v3.5.2 (XXXX-XX-XX)
|
||||||
x s" from occurring when this is not the case. Due to a data race, the
|
x s" from occurring when this is not the case. Due to a data race, the
|
||||||
message could previously also occur if the queue was empty.
|
message could previously also occur if the queue was empty.
|
||||||
|
|
||||||
* The General Graph document API is now persistent with the document API in its
|
* The General Graph document API is now consistent with the document API in its
|
||||||
errormessages. When attempting to create / modify edges pointing to non
|
error messages. When attempting to create / modify edges pointing to non
|
||||||
existing vertex collections HTTP 400 is returned instead of 404.
|
existing vertex collections HTTP 400 is returned instead of 404.
|
||||||
|
|
||||||
* Disallow the usage of subqueries inside AQL traversal PRUNE conditions.
|
* Disallow the usage of subqueries inside AQL traversal PRUNE conditions.
|
||||||
|
|
|
@ -38,6 +38,17 @@
|
||||||
using namespace arangodb;
|
using namespace arangodb;
|
||||||
using namespace arangodb::aql;
|
using namespace arangodb::aql;
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
void throwArrayExpectedException(AqlValue const& value) {
|
||||||
|
THROW_ARANGO_EXCEPTION_MESSAGE(
|
||||||
|
TRI_ERROR_QUERY_ARRAY_EXPECTED,
|
||||||
|
std::string("collection or ") + TRI_errno_string(TRI_ERROR_QUERY_ARRAY_EXPECTED) +
|
||||||
|
std::string(
|
||||||
|
" as operand to FOR loop; you provided a value of type '") +
|
||||||
|
value.getTypeString() + std::string("'"));
|
||||||
|
}
|
||||||
|
} // namespace
|
||||||
|
|
||||||
EnumerateListExecutorInfos::EnumerateListExecutorInfos(
|
EnumerateListExecutorInfos::EnumerateListExecutorInfos(
|
||||||
RegisterId inputRegister, RegisterId outputRegister,
|
RegisterId inputRegister, RegisterId outputRegister,
|
||||||
RegisterId nrInputRegisters, RegisterId nrOutputRegisters,
|
RegisterId nrInputRegisters, RegisterId nrOutputRegisters,
|
||||||
|
@ -65,7 +76,6 @@ std::pair<ExecutionState, NoStats> EnumerateListExecutor::produceRows(OutputAqlI
|
||||||
// HIT in first run, because pos and length are initiliazed
|
// HIT in first run, because pos and length are initiliazed
|
||||||
// both with 0
|
// both with 0
|
||||||
|
|
||||||
// if (_inputArrayPosition == _inputArrayLength || _inputArrayPosition == _inputArrayLength - 1) {
|
|
||||||
if (_inputArrayPosition == _inputArrayLength) {
|
if (_inputArrayPosition == _inputArrayLength) {
|
||||||
// we need to set position back to zero
|
// we need to set position back to zero
|
||||||
// because we finished iterating over existing array
|
// because we finished iterating over existing array
|
||||||
|
@ -94,6 +104,9 @@ std::pair<ExecutionState, NoStats> EnumerateListExecutor::produceRows(OutputAqlI
|
||||||
if (inputList.isDocvec()) {
|
if (inputList.isDocvec()) {
|
||||||
_inputArrayLength = inputList.docvecSize();
|
_inputArrayLength = inputList.docvecSize();
|
||||||
} else {
|
} else {
|
||||||
|
if (!inputList.isArray()) {
|
||||||
|
throwArrayExpectedException(inputList);
|
||||||
|
}
|
||||||
_inputArrayLength = inputList.length();
|
_inputArrayLength = inputList.length();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,20 +41,6 @@ var assertQueryError = helper.assertQueryError;
|
||||||
function ahuacatlQuerySimpleTestSuite () {
|
function ahuacatlQuerySimpleTestSuite () {
|
||||||
return {
|
return {
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
/// @brief set up
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
setUp : function () {
|
|
||||||
},
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
/// @brief tear down
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
tearDown : function () {
|
|
||||||
},
|
|
||||||
|
|
||||||
testNoArraySorting1 : function () {
|
testNoArraySorting1 : function () {
|
||||||
let query = "LET values = [9,16,8,15,7,14,6,13,5,12,4,11,3,10,2,1] RETURN values";
|
let query = "LET values = [9,16,8,15,7,14,6,13,5,12,4,11,3,10,2,1] RETURN values";
|
||||||
assertEqual([9, 16, 8, 15, 7, 14, 6, 13, 5, 12, 4, 11, 3, 10, 2, 1], AQL_EXECUTE(query).json[0]);
|
assertEqual([9, 16, 8, 15, 7, 14, 6, 13, 5, 12, 4, 11, 3, 10, 2, 1], AQL_EXECUTE(query).json[0]);
|
||||||
|
@ -1338,7 +1324,13 @@ function ahuacatlQuerySimpleTestSuite () {
|
||||||
var actual = getQueryResults(query[0]);
|
var actual = getQueryResults(query[0]);
|
||||||
assertEqual(query[1], actual);
|
assertEqual(query[1], actual);
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
|
|
||||||
|
testForWithoutArray : function () {
|
||||||
|
assertQueryError(errors.ERROR_QUERY_ARRAY_EXPECTED.code, "LET a = null FOR x IN a RETURN 1");
|
||||||
|
|
||||||
|
assertQueryError(errors.ERROR_QUERY_ARRAY_EXPECTED.code, "LET a = NOOPT(null) FOR x IN a RETURN 1");
|
||||||
|
},
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue