1
0
Fork 0

Merge branch 'devel' of https://github.com/arangodb/arangodb into devel

This commit is contained in:
Kaveh Vahedipour 2016-02-12 11:13:33 +01:00
commit 068386338a
8 changed files with 82 additions and 13 deletions

4
3rdParty/libev/ev.3 vendored
View File

@ -1,4 +1,4 @@
.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "LIBEV 3"
.TH LIBEV 3 "2016-02-09" "libev-4.22" "libev - high performance full featured event loop"
.TH LIBEV 3 "2016-02-11" "libev-4.22" "libev - high performance full featured event loop"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l

View File

@ -12,19 +12,23 @@ v3.0.0 (XXXX-XX-XX)
Examples:
[ 1, 2, 3 ] ANY == 2 // true
[ 1, 2, 3 ] ANY == 4 // false
[ 1, 2, 3 ] ANY > 0 // true
[ 1, 2, 3 ] ANY IN [ 4, 5, 6 ] // false
[ 1, 2, 3 ] ANY IN [ 1, 42 ] // true
[ 1, 2, 3 ] ALL IN [ 2, 3, 4 ] // false
[ 1, 2, 3 ] ALL IN [ 1, 2, 3 ] // true
[ 1, 2, 3 ] ALL > 2 // false
[ 1, 2, 3 ] ALL > 0 // true
[ 1, 2, 3 ] NONE IN [ 3 ] // false
[ 1, 2, 3 ] NONE IN [ 23, 42 ] // true
[ 1, 2, 3 ] ANY == 2 // true
[ 1, 2, 3 ] ANY == 4 // false
[ 1, 2, 3 ] ANY > 0 // true
[ 1, 2, 3 ] ANY <= 1 // true
[ 1, 2, 3 ] ALL > 2 // false
[ 1, 2, 3 ] ALL > 0 // true
[ 1, 2, 3 ] ALL >= 3 // false
[ 1, 2, 3 ] NONE < 99 // false
[ 1, 2, 3 ] NONE > 10 // true
["foo", "bar"] ALL != "moo" // true
["foo", "bar"] NONE == "bar" // false
* improved AQL optimizer to remove unnecessary sort operations in more cases

View File

@ -535,6 +535,9 @@ else()
message ("Boost unit test framework not found. Unit tests are disabled.")
endif()
# Tcmalloc ---------------------------------------------------------------------
find_package(tcmalloc)
# OpenSSL ----------------------------------------------------------------------
#set (OPENSSL_USE_STATIC_LIBS "TRUE")
find_package(OpenSSL REQUIRED)

View File

@ -493,6 +493,9 @@ static void AppendAsString(arangodb::basics::StringBuffer& buffer,
break;
}
}
// make it null-terminated for all c-string-related functions
buffer.ensureNullTerminated();
}
////////////////////////////////////////////////////////////////////////////////

36
cmake/Findtcmalloc.cmake Normal file
View File

@ -0,0 +1,36 @@
# - Locate tcmalloc library
# Defines:
#
# TCMALLOC_FOUND
# TCMALLOC_INCLUDE_DIR
# TCMALLOC_INCLUDE_DIRS (not cached)
# TCMALLOC_tcmalloc_LIBRARY
# TCMALLOC_profiler_LIBRARY
# TCMALLOC_LIBRARIES (not cached)
# TCMALLOC_LIBRARY_DIRS (not cached)
# PPROF_EXECUTABLE
find_path(TCMALLOC_INCLUDE_DIR google/tcmalloc.h)
foreach(component tcmalloc profiler)
find_library(TCMALLOC_${component}_LIBRARY NAMES ${component})
mark_as_advanced(TCMALLOC_${component}_LIBRARY)
endforeach()
find_program(PPROF_EXECUTABLE NAMES pprof
HINTS ${TCMALLOC_INCLUDE_DIR}/../bin)
set(TCMALLOC_INCLUDE_DIRS ${TCMALLOC_INCLUDE_DIR})
set(TCMALLOC_LIBRARIES ${TCMALLOC_tcmalloc_LIBRARY} ${TCMALLOC_profiler_LIBRARY})
# handle the QUIETLY and REQUIRED arguments and set TCMALLOC_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(tcmalloc DEFAULT_MSG TCMALLOC_INCLUDE_DIR TCMALLOC_LIBRARIES)
mark_as_advanced(TCMALLOC_FOUND TCMALLOC_INCLUDE_DIR PPROF_EXECUTABLE)
if(TCMALLOC_tcmalloc_LIBRARY)
get_filename_component(TCMALLOC_LIBRARY_DIRS ${TCMALLOC_tcmalloc_LIBRARY} PATH)
elseif(TCMALLOC_profiler_LIBRARY)
get_filename_component(TCMALLOC_LIBRARY_DIRS ${TCMALLOC_profiler_LIBRARY} PATH)
endif()

View File

@ -3419,6 +3419,7 @@ function ahuacatlFunctionsTestSuite () {
[ { a: 1, b: 2, c: 3 }, [ "a", "b", "c" ], [ 1, 2, 3 ] ],
[ { foo: "baz", bar: "foo", baz: "bar" }, [ "foo", "bar", "baz" ], [ "baz", "foo", "bar" ] ],
[ { a: null, b: false, c: true, d: 42, e: 2.5, f: "test", g: [], h: [ "test1", "test2" ], i : { something: "else", more: "less" } }, [ "a", "b", "c", "d", "e", "f", "g", "h", "i" ], [ null, false, true, 42, 2.5, "test", [ ], [ "test1", "test2" ], { something: "else", more: "less" } ] ],
[ { a11111: "value", b222: "value", c: "value" }, [ "a11111", "b222", "c" ], [ "value", "value", "value" ] ]
];
values.forEach(function (value) {
@ -3434,6 +3435,23 @@ function ahuacatlFunctionsTestSuite () {
});
},
////////////////////////////////////////////////////////////////////////////////
/// @brief test zip function
////////////////////////////////////////////////////////////////////////////////
testZipSubquery : function () {
// Opt
var query = "LET value = (FOR i IN 1..3 RETURN 'value') RETURN ZIP([ 'a11111', 'b222', 'c' ], value)";
var actual = getQueryResults(query);
assertEqual({ a11111: "value", b222: "value", c: "value" }, actual[0]);
// No opt / No v8
query = "LET value = (FOR i IN 1..3 RETURN 'value') RETURN NOOPT(ZIP([ 'a11111', 'b222', 'c' ], value))";
assertEqual({ a11111: "value", b222: "value", c: "value" }, actual[0]);
// No opt / v8
query = "LET value = (FOR i IN 1..3 RETURN 'value') RETURN NOOPT(V8(ZIP([ 'a11111', 'b222', 'c' ], value)))";
assertEqual({ a11111: "value", b222: "value", c: "value" }, actual[0]);
},
////////////////////////////////////////////////////////////////////////////////
/// @brief test zip function
////////////////////////////////////////////////////////////////////////////////

View File

@ -801,17 +801,13 @@ int TRI_AppendUrlEncodedStringStringBuffer(TRI_string_buffer_t* self,
'8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};
size_t len = strlen(src);
int res;
char const* end;
res = Reserve(self, len * 3);
int res = Reserve(self, len * 3);
if (res != TRI_ERROR_NO_ERROR) {
return res;
}
end = src + len;
char const* end = src + len;
for (; src < end; ++src) {
if ('0' <= *src && *src <= '9') {

View File

@ -744,6 +744,15 @@ class StringBuffer {
_buffer._current = other->_current;
_buffer._len = other->_len;
}
//////////////////////////////////////////////////////////////////////////////
/// @brief make sure the buffer is null-terminated
//////////////////////////////////////////////////////////////////////////////
void ensureNullTerminated () {
TRI_AppendCharStringBuffer(&_buffer, '\0');
--_buffer._current;
}
//////////////////////////////////////////////////////////////////////////////
/// @brief appends character