diff --git a/Documentation/Books/Users/Aql/ArrayFunctions.mdpp b/Documentation/Books/Users/Aql/ArrayFunctions.mdpp index 869a7e4ee7..23679e3db2 100644 --- a/Documentation/Books/Users/Aql/ArrayFunctions.mdpp +++ b/Documentation/Books/Users/Aql/ArrayFunctions.mdpp @@ -11,19 +11,19 @@ AQL supports the following functions to operate on array values: are added as they are. The function will recurse into sub-arrays up to a depth of *depth*. *depth* has a default value of 1. -*Examples* + *Examples* FLATTEN([ 1, 2, [ 3, 4 ], 5, [ 6, 7 ], [ 8, [ 9, 10 ] ]) - will produce: + will produce: [ 1, 2, 3, 4, 5, 6, 7, 8, [ 9, 10 ] ] - To fully flatten the array, use a *depth* of 2: + To fully flatten the array, use a *depth* of 2: FLATTEN([ 1, 2, [ 3, 4 ], 5, [ 6, 7 ], [ 8, [ 9, 10 ] ], 2) - This will produce: + This will produce: [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ] @@ -99,27 +99,27 @@ AQL supports the following functions to operate on array values: If *start* is negative, it can be used to indicate positions from the end of the array. -*Examples* + *Examples* SLICE([ 1, 2, 3, 4, 5 ], 0, 1) - will return *[ 1 ]* + will return *[ 1 ]* SLICE([ 1, 2, 3, 4, 5 ], 1, 2) - will return *[ 2, 3 ]* + will return *[ 2, 3 ]* SLICE([ 1, 2, 3, 4, 5 ], 3) - will return *[ 4, 5 ]* + will return *[ 4, 5 ]* SLICE([ 1, 2, 3, 4, 5 ], 1, -1) - will return *[ 2, 3, 4 ]* + will return *[ 2, 3, 4 ]* SLICE([ 1, 2, 3, 4, 5 ], 0, -2) - will return *[ 1, 2, 3 ]* + will return *[ 1, 2, 3 ]* - *UNIQUE(array)*: Returns all unique elements in *array*. To determine uniqueness, the function will use the comparison order. @@ -132,18 +132,18 @@ AQL supports the following functions to operate on array values: Note: No duplicates will be removed. In order to remove duplicates, please use either *UNION_DISTINCT* function or apply the *UNIQUE* on the result of *union*. -*Examples* + *Examples* RETURN UNION( [ 1, 2, 3 ], [ 1, 2 ] ) - will produce: + will produce: [ [ 1, 2, 3, 1, 2 ] ] - with duplicate removal: + with duplicate removal: RETURN UNIQUE( UNION( @@ -152,7 +152,7 @@ AQL supports the following functions to operate on array values: ) ) - will produce: + will produce: [ [ 1, 2, 3 ] ] diff --git a/Documentation/Books/Users/IndexHandling/README.mdpp b/Documentation/Books/Users/IndexHandling/README.mdpp index 52ea8f3b5c..013ece8638 100644 --- a/Documentation/Books/Users/IndexHandling/README.mdpp +++ b/Documentation/Books/Users/IndexHandling/README.mdpp @@ -4,10 +4,12 @@ This is an introduction to ArangoDB's interface for indexes in general. There are special sections for - [index basics](../IndexHandling/IndexBasics.md) +- [Which Index to use when](../IndexHandling/WhichIndex.md) +- [How ArangoDB uses indexes](../IndexHandling/HowArangoDBUsesIndexes.md) - [working with indexes](../IndexHandling/WorkingWithIndexes.md) -- [hash indexes](../IndexHandling/Hash.md) -- [skiplists](../IndexHandling/Skiplist.md) -- [fulltext indexes](../IndexHandling/Fulltext.md) -- [geo-spatial indexes](../IndexHandling/Geo.md) -- [cap constraints](../IndexHandling/Cap.md) + - [hash indexes](../IndexHandling/Hash.md) + - [skiplists](../IndexHandling/Skiplist.md) + - [fulltext indexes](../IndexHandling/Fulltext.md) + - [geo-spatial indexes](../IndexHandling/Geo.md) + - [cap constraints](../IndexHandling/Cap.md) diff --git a/arangod/Cluster/ClusterInfo.h b/arangod/Cluster/ClusterInfo.h index 89505235e1..a83821c050 100644 --- a/arangod/Cluster/ClusterInfo.h +++ b/arangod/Cluster/ClusterInfo.h @@ -72,7 +72,7 @@ namespace triagens { CollectionInfo (); - CollectionInfo (struct TRI_json_t*); + explicit CollectionInfo (struct TRI_json_t*); CollectionInfo (CollectionInfo const&); diff --git a/arangod/Cluster/ClusterTraverser.cpp b/arangod/Cluster/ClusterTraverser.cpp index 4b88fbfe60..3211e7bd26 100644 --- a/arangod/Cluster/ClusterTraverser.cpp +++ b/arangod/Cluster/ClusterTraverser.cpp @@ -181,7 +181,14 @@ void ClusterTraverser::EdgeGetter::operator() (std::string const& startVertex, if (_traverser->_vertices.find(toId) == _traverser->_vertices.end()) { verticesToFetch.emplace(toId); } - _traverser->_edges.emplace(edgeId, edge.copy().steal()); + std::unique_ptr copy(edge.copy().steal()); + if (copy != nullptr) { + if (_traverser->_edges.emplace(edgeId, copy.get()).second) { + // if insertion was successful, hand over the ownership + copy.release(); + } + // else we have a duplicate and we need to free the copy again + } } std::vector expVertices; diff --git a/js/server/modules/@arangodb/testing.js b/js/server/modules/@arangodb/testing.js index addf5f94c3..16c976fd14 100644 --- a/js/server/modules/@arangodb/testing.js +++ b/js/server/modules/@arangodb/testing.js @@ -518,6 +518,20 @@ function readImportantLogLines(logPath) { } function analyzeCoreDump(instanceInfo, options, storeArangodPath, pid) { +/* + * We assume the system has core files in /var/tmp/, and we have a gdb. + * you can do this at runtime doing: + * + * echo 1 > /proc/sys/kernel/core_uses_pid + * echo /var/tmp/core-%e-%p-%t > /proc/sys/kernel/core_pattern + * + * or at system startup by altering /etc/sysctl.d/corepattern.conf : + * # We want core files to be located in a central location + * # and know the PID plus the process name for later use. + * kernel.core_uses_pid = 1 + * kernel.core_pattern = /var/tmp/core-%e-%p-%t + */ + var command; command = '('; command += "printf 'bt full\\n thread apply all bt\\n';"; diff --git a/lib/Basics/operating-system.h b/lib/Basics/operating-system.h index b3ab4ed6d8..4fb775a8b3 100644 --- a/lib/Basics/operating-system.h +++ b/lib/Basics/operating-system.h @@ -167,10 +167,10 @@ /// @brief files //////////////////////////////////////////////////////////////////////////////// -#define TRI_DIR_SEPARATOR_CHAR '/' -#define TRI_DIR_SEPARATOR_STR "/" +#define TRI_DIR_SEPARATOR_CHAR '/' +#define TRI_DIR_SEPARATOR_STR "/" -#define TRI_O_CLOEXEC O_CLOEXEC +#define TRI_O_CLOEXEC O_CLOEXEC #define TRI_CHDIR chdir #define TRI_CLOSE close @@ -326,10 +326,10 @@ /// @brief files //////////////////////////////////////////////////////////////////////////////// -#define TRI_DIR_SEPARATOR_CHAR '/' -#define TRI_DIR_SEPARATOR_STR "/" +#define TRI_DIR_SEPARATOR_CHAR '/' +#define TRI_DIR_SEPARATOR_STR "/" -#define TRI_O_CLOEXEC O_CLOEXEC +#define TRI_O_CLOEXEC O_CLOEXEC #define TRI_CHDIR chdir #define TRI_CLOSE close @@ -501,10 +501,10 @@ /// @brief files //////////////////////////////////////////////////////////////////////////////// -#define TRI_DIR_SEPARATOR_CHAR '/' -#define TRI_DIR_SEPARATOR_STR "/" +#define TRI_DIR_SEPARATOR_CHAR '/' +#define TRI_DIR_SEPARATOR_STR "/" -#define TRI_O_CLOEXEC O_CLOEXEC +#define TRI_O_CLOEXEC O_CLOEXEC #define TRI_CHDIR chdir #define TRI_CLOSE close @@ -734,7 +734,7 @@ typedef unsigned char bool; #define S_IRGRP _S_IREAD #define S_IWGRP _S_IWRITE -#define TRI_O_CLOEXEC +#define TRI_O_CLOEXEC 0 #define O_RDONLY _O_RDONLY #define TRI_CHDIR _chdir