diff --git a/3rdParty/CMakeLists.txt b/3rdParty/CMakeLists.txt index 52ca321e97..d0c4682d26 100644 --- a/3rdParty/CMakeLists.txt +++ b/3rdParty/CMakeLists.txt @@ -98,10 +98,6 @@ set(CMAKE_USE_LIBSSH2 OFF CACHE type BOOL) set(CMAKE_USE_OPENSSL ON CACHE type BOOL) # mop: super important...if this is off curl will not handle request timeouts < 1000ms set(ENABLE_THREADED_RESOLVER ON CACHE type BOOL) -# bugfix for HAVE_POSIX_STRERROR_R define on cross compiling. -if (CROSS_COMPILING) - add_definitions("-DHAVE_POSIX_STRERROR_R=1") -endif() add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/curl/curl-7.50.3) ################################################################################ diff --git a/3rdParty/velocypack/include/velocypack/Utf8Helper.h b/3rdParty/velocypack/include/velocypack/Utf8Helper.h new file mode 100644 index 0000000000..0f48cc601a --- /dev/null +++ b/3rdParty/velocypack/include/velocypack/Utf8Helper.h @@ -0,0 +1,42 @@ +//////////////////////////////////////////////////////////////////////////////// +/// @brief Library to build up VPack documents. +/// +/// DISCLAIMER +/// +/// Copyright 2015 ArangoDB GmbH, Cologne, Germany +/// +/// Licensed under the Apache License, Version 2.0 (the "License"); +/// you may not use this file except in compliance with the License. +/// You may obtain a copy of the License at +/// +/// http://www.apache.org/licenses/LICENSE-2.0 +/// +/// Unless required by applicable law or agreed to in writing, software +/// distributed under the License is distributed on an "AS IS" BASIS, +/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +/// See the License for the specific language governing permissions and +/// limitations under the License. +/// +/// Copyright holder is ArangoDB GmbH, Cologne, Germany +/// +/// @author Max Neunhoeffer +/// @author Jan Steemann +/// @author Copyright 2015, ArangoDB GmbH, Cologne, Germany +//////////////////////////////////////////////////////////////////////////////// + +#ifndef VELOCYPACK_UTF8HELPER_H +#define VELOCYPACK_UTF8HELPER_H 1 + +#include "velocypack/velocypack-common.h" + +namespace arangodb { +namespace velocypack { + +struct Utf8Helper { + static bool isValidUtf8(uint8_t const* p, ValueLength len); +}; + +} +} + +#endif diff --git a/3rdParty/velocypack/include/velocypack/velocypack-aliases.h b/3rdParty/velocypack/include/velocypack/velocypack-aliases.h index 42c6158e1c..cb1a4edde7 100644 --- a/3rdParty/velocypack/include/velocypack/velocypack-aliases.h +++ b/3rdParty/velocypack/include/velocypack/velocypack-aliases.h @@ -151,6 +151,13 @@ using VPackSlimBuffer = arangodb::velocypack::SliceContainer; #endif #endif +#ifdef VELOCYPACK_UTF8HELPER_H +#ifndef VELOCYPACK_ALIAS_UTF8HELPER +#define VELOCYPACK_ALIAS_UTF8HELPER +using VPackUtf8Helper = arangodb::velocypack::Utf8Helper; +#endif +#endif + #ifdef VELOCYPACK_VALIDATOR_H #ifndef VELOCYPACK_ALIAS_VALIDATOR #define VELOCYPACK_ALIAS_VALIDATOR diff --git a/3rdParty/velocypack/src/Utf8Helper.cpp b/3rdParty/velocypack/src/Utf8Helper.cpp new file mode 100644 index 0000000000..1f7e7b23e9 --- /dev/null +++ b/3rdParty/velocypack/src/Utf8Helper.cpp @@ -0,0 +1,69 @@ +//////////////////////////////////////////////////////////////////////////////// +/// @brief Library to build up VPack documents. +/// +/// DISCLAIMER +/// +/// Copyright 2015 ArangoDB GmbH, Cologne, Germany +/// +/// Licensed under the Apache License, Version 2.0 (the "License"); +/// you may not use this file except in compliance with the License. +/// You may obtain a copy of the License at +/// +/// http://www.apache.org/licenses/LICENSE-2.0 +/// +/// Unless required by applicable law or agreed to in writing, software +/// distributed under the License is distributed on an "AS IS" BASIS, +/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +/// See the License for the specific language governing permissions and +/// limitations under the License. +/// +/// Copyright holder is ArangoDB GmbH, Cologne, Germany +/// +/// @author Max Neunhoeffer +/// @author Jan Steemann +/// @author Copyright 2015, ArangoDB GmbH, Cologne, Germany +//////////////////////////////////////////////////////////////////////////////// + +#include "velocypack/velocypack-common.h" +#include "velocypack/Utf8Helper.h" + +using namespace arangodb::velocypack; + +namespace { + +static constexpr uint8_t ValidChar = 0; +static constexpr uint8_t InvalidChar = 1; + +static const uint8_t states[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // 00..1f + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // 20..3f + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // 40..5f + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // 60..7f + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, // 80..9f + 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, // a0..bf + 8,8,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, // c0..df + 0xa,0x3,0x3,0x3,0x3,0x3,0x3,0x3,0x3,0x3,0x3,0x3,0x3,0x4,0x3,0x3, // e0..ef + 0xb,0x6,0x6,0x6,0x5,0x8,0x8,0x8,0x8,0x8,0x8,0x8,0x8,0x8,0x8,0x8, // f0..ff + 0x0,0x1,0x2,0x3,0x5,0x8,0x7,0x1,0x1,0x1,0x4,0x6,0x1,0x1,0x1,0x1, // s0..s0 + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,0,1,0,1,1,1,1,1,1, // s1..s2 + 1,2,1,1,1,1,1,2,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1, // s3..s4 + 1,2,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,3,1,3,1,1,1,1,1,1, // s5..s6 + 1,3,1,1,1,1,1,3,1,3,1,1,1,1,1,1,1,3,1,1,1,1,1,1,1,1,1,1,1,1,1,1, // s7..s8 +}; + +} + +bool Utf8Helper::isValidUtf8(uint8_t const* p, ValueLength len) { + uint8_t const* end = p + len; + + uint8_t state = ValidChar; + while (p < end) { + state = states[256 + state * 16 + states[*p]]; + if (state == InvalidChar) { + return false; + } + ++p; + } + + return (state == ValidChar); +} diff --git a/3rdParty/velocypack/src/Validator.cpp b/3rdParty/velocypack/src/Validator.cpp index f89c37fc7d..9315536560 100644 --- a/3rdParty/velocypack/src/Validator.cpp +++ b/3rdParty/velocypack/src/Validator.cpp @@ -28,6 +28,7 @@ #include "velocypack/Validator.h" #include "velocypack/Exception.h" #include "velocypack/Slice.h" +#include "velocypack/Utf8Helper.h" #include "velocypack/ValueType.h" using namespace arangodb::velocypack; @@ -88,11 +89,23 @@ bool Validator::validate(uint8_t const* ptr, size_t length, bool isSubPart) cons } case ValueType::String: { + uint8_t const* p; + ValueLength len; if (head == 0xbfU) { // long UTF-8 string. must be at least 9 bytes long so we // can read the entire string length safely validateBufferLength(1 + 8, length, true); - } + p = ptr + 1 + 8; + len = readInteger(p, 8); + } else { + p = ptr + 1; + len = head - 0x40U; + } + validateBufferLength(length - (p - ptr), length, true); + + if (options->validateUtf8Strings && !Utf8Helper::isValidUtf8(p, len)) { + throw Exception(Exception::InvalidUtf8Sequence); + } break; } diff --git a/CHANGELOG b/CHANGELOG index caf6b8e703..2766633a50 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -5,7 +5,6 @@ devel db._query("FOR i IN 1..100000 SORT i RETURN i", {}, { options: { memoryLimit: 100000 } }); - * added convenience function to create vertex-centric indexes. Usage: `db.collection.ensureVertexCentricIndex("label", {type: "hash", direction: "outbound"})` That will create an index that can be used on OUTBOUND with filtering on the @@ -26,7 +25,16 @@ edge attribute `label`. * process.stdout.isTTY now returns `true` in arangosh and when running arangod with the `--console` flag -v3.1.3 (xxxx-xx-xx) + +v3.1.4 (XXXX-XX-XX) +------------------- + +* fixed issue #2211 + +* fixed issue #2204 + + +v3.1.3 (2016-12-02) ------------------- * fix a traversal bug when using skiplist indexes: @@ -39,7 +47,8 @@ v3.1.3 (xxxx-xx-xx) * fix endless loop when trying to create a collection with replicationFactor: -1 -v3.1.2 (20XX-XX-XX) + +v3.1.2 (2016-11-24) ------------------- * added support for descriptions field in Foxx dependencies @@ -48,8 +57,9 @@ v3.1.2 (20XX-XX-XX) Now they state correctly how many documents were fetched from the index and how many have been filtered. +* Prevent uniform shard distribution when replicationFactor == numServers -v3.1.1 (XXXX-XX-XX) +v3.1.1 (2016-11-15) ------------------- * fixed issue #2176 @@ -343,13 +353,27 @@ v3.1.0 (2016-10-29) * fixed issue #2156 -v3.0.12 (XXXX-XX-XX) +v3.0.13 (XXXX-XX-XX) -------------------- +* fixed issue #2210 + + +v3.0.12 (2016-11-23) +-------------------- + +* fixed issue #2176 + +* fixed issue #2168 + * fixed issues #2149, #2159 * fixed error reporting for issue #2158 +* fixed assembly linkage bug in CRC4 module + +* added support for descriptions field in Foxx dependencies + v3.0.11 (2016-11-08) -------------------- diff --git a/Documentation/Books/AQL/Graphs/Traversals.mdpp b/Documentation/Books/AQL/Graphs/Traversals.mdpp index 315e79098f..a3ad32aed8 100644 --- a/Documentation/Books/AQL/Graphs/Traversals.mdpp +++ b/Documentation/Books/AQL/Graphs/Traversals.mdpp @@ -284,6 +284,18 @@ FOR v, e, p IN 1..5 OUTBOUND 'circles/A' GRAPH 'traversalGraph' It is guaranteed that at least one, but potentially more edges fulfill the condition. All of the above filters can be defined on vertices in the exact same way. +### Filtering on the path vs. filtering on vertices or edges +Filtering on the path influences the Iteration on your graph. If certain conditions +aren't met, the traversal may stop continuing along this path. + +In contrast filters on vertex or edge only express whether you're interestet in the actual value of these +documents. Thus, it influences the list of returned documents (if you return v or e) similar +as specifying a non-null `min` value. If you specify a min value of 2, the traversal over the first +two nodes of these paths has to be executed - you just won't see them in your result array. + +Similar are filters on vertices or edges - the traverser has to walk along these nodes, since +you may be interested in documents further down the path. + ### Examples diff --git a/Documentation/Books/AQL/HEADER.html b/Documentation/Books/AQL/HEADER.html index 603484fe86..970dc9e9a6 100644 --- a/Documentation/Books/AQL/HEADER.html +++ b/Documentation/Books/AQL/HEADER.html @@ -14,13 +14,6 @@ - - - - - - -