1
0
Fork 0

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

This commit is contained in:
jsteemann 2017-01-06 13:28:01 +01:00
commit 7ccc20d3e4
8 changed files with 125 additions and 89 deletions

View File

@ -12,6 +12,11 @@
!include nsDialogs.nsh
!include WinMessages.nsh
;--------------------------------
; get commandline parameters
!include FileFunc.nsh
!insertmacro GetParameters
!insertmacro GetOptions
;--------------------------------
; You must define these values
@ -28,23 +33,27 @@
@CPACK_ARANGODB_NSIS_DEFINES@
;--------------------------------
;Variables
;Variables x -> from userinput
!define EMPTY ""
var retryCount
Var MUI_TEMP
Var STARTMENU_FOLDER
Var SV_ALLUSERS
Var START_MENU
Var DO_NOT_ADD_TO_PATH
Var ADD_TO_PATH_ALL_USERS
Var ADD_TO_PATH_CURRENT_USER
Var INSTALL_DESKTOP
Var DO_NOT_ADD_TO_PATH ; x bool
Var ADD_TO_PATH_ALL_USERS ; x bool
Var ADD_TO_PATH_CURRENT_USER ; x bool
Var INSTALL_DESKTOP ; x bool: add desktop icon
Var IS_DEFAULT_INSTALLDIR
Var PASSWORD
Var PASSWORD_AGAIN
Var PASSWORD ; x string
Var PASSWORD_AGAIN ; x string / only for comparison
; Variables for definition of instdir
; posible values: SingleUser | AllUsers | Service
VAR TRI_INSTALL_TYPE
VAR TRI_INSTALL_TYPE ; x
!define TEMP1 $R0 ;Temp variable
;--------------------------------
@ -69,11 +78,11 @@ Function openLinkNewWindow
Exch
ReadRegStr $0 HKCR "http\shell\open\command" ""
# Get browser path
; Get browser path
DetailPrint $0
StrCpy $2 '"'
StrCpy $2 '"' ;"
StrCpy $1 $0 1
StrCmp $1 $2 +2 # if path is not enclosed in " look for space as final char
StrCmp $1 $2 +2 ; if path is not enclosed in " look for space as final char
StrCpy $2 ' '
StrCpy $3 1
loop:
@ -87,7 +96,7 @@ Function openLinkNewWindow
found:
StrCpy $1 $0 $3
StrCmp $2 " " +2
StrCpy $1 '$1"'
StrCpy $1 '$1"' ;"
Pop $0
Exec '$1 $0'
@ -350,7 +359,7 @@ Function AddToPath
Push $2
Push $3
# don't add if the path doesn't exist
; don't add if the path doesn't exist
IfFileExists "$0\*.*" "" AddToPath_done
ReadEnvStr $1 PATH
@ -425,7 +434,7 @@ Function un.RemoveFromPath
Push $5
Push $6
IntFmt $6 "%c" 26 # DOS EOF
IntFmt $6 "%c" 26 ; DOS EOF
StrCmp $ADD_TO_PATH_ALL_USERS "1" unReadAllKey
ReadRegStr $1 ${NT_current_env} "PATH"
@ -433,26 +442,26 @@ Function un.RemoveFromPath
unReadAllKey:
ReadRegStr $1 ${NT_all_env} "PATH"
unDoTrim:
StrCpy $5 $1 1 -1 # copy last char
StrCmp $5 ";" +2 # if last char != ;
StrCpy $1 "$1;" # append ;
StrCpy $5 $1 1 -1 ; copy last char
StrCmp $5 ";" +2 ; if last char != ;
StrCpy $1 "$1;" ; append ;
Push $1
Push "$0;"
Call un.StrStr ; Find `$0;` in $1
Pop $2 ; pos of our dir
StrCmp $2 "" unRemoveFromPath_done
; else, it is in path
# $0 - path to add
# $1 - path var
; $0 - path to add
; $1 - path var
StrLen $3 "$0;"
StrLen $4 $2
StrCpy $5 $1 -$4 # $5 is now the part before the path to remove
StrCpy $6 $2 "" $3 # $6 is now the part after the path to remove
StrCpy $5 $1 -$4 ; $5 is now the part before the path to remove
StrCpy $6 $2 "" $3 ; $6 is now the part after the path to remove
StrCpy $3 $5$6
StrCpy $5 $3 1 -1 # copy last char
StrCmp $5 ";" 0 +2 # if last char == ;
StrCpy $3 $3 -1 # remove last char
StrCpy $5 $3 1 -1 ; copy last char
StrCmp $5 ";" 0 +2 ; if last char == ;
StrCpy $3 $3 -1 ; remove last char
StrCmp $ADD_TO_PATH_ALL_USERS "1" unWriteAllKey
WriteRegExpandStr ${NT_current_env} "PATH" $3
@ -476,9 +485,9 @@ FunctionEnd
; Uninstall sutff
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
###########################################
# Utility Functions #
###########################################
;###########################################
;# Utility Functions #
;###########################################
; StrStr
; input, top of stack = string to search for
@ -1136,6 +1145,15 @@ Function un.onInit
SetShellVarContext current
${EndIf}
${GetParameters} $R0
ClearErrors
${GetOptions} $PASSWORD /PASSWORD= $0
${GetOptions} $INSTALL_DESKTOP /DESKTOPICON $0
${GetOptions} $DO_NOT_ADD_TO_PATH /NOPATH $0
${GetOptions} $ADD_TO_PATH_ALL_USERS /ALLPATH $0
${GetOptions} $ADD_TO_PATH_CURRENT_USER /CURPATH $0
${GetOptions} $TRI_INSTALL_TYPE /INSTALLTYPE= $0
${GetOptions} $INSTDIR /INSTDIR= $0
FunctionEnd
;--- Add/Remove callback functions: ---
@ -1353,7 +1371,7 @@ Function .onInit
uninst:
ClearErrors
StrLen $2 "\Uninstall.exe"
StrCpy $3 $0 -$2 # remove "\Uninstall.exe" from UninstallString to get path
StrCpy $3 $0 -$2 ; remove "\Uninstall.exe" from UninstallString to get path
ExecWait '$0 _?=$3' ;Do not copy the uninstaller to a temp file
IfErrors uninst_failed inst

View File

@ -237,7 +237,7 @@ Function AddToPath
Push $2
Push $3
# don't add if the path doesn't exist
; don't add if the path doesn't exist
IfFileExists "$0\*.*" "" AddToPath_done
ReadEnvStr $1 PATH
@ -312,7 +312,7 @@ Function un.RemoveFromPath
Push $5
Push $6
IntFmt $6 "%c" 26 # DOS EOF
IntFmt $6 "%c" 26 ; DOS EOF
StrCmp $ADD_TO_PATH_ALL_USERS "1" unReadAllKey
ReadRegStr $1 ${NT_current_env} "PATH"
@ -320,26 +320,26 @@ Function un.RemoveFromPath
unReadAllKey:
ReadRegStr $1 ${NT_all_env} "PATH"
unDoTrim:
StrCpy $5 $1 1 -1 # copy last char
StrCmp $5 ";" +2 # if last char != ;
StrCpy $1 "$1;" # append ;
StrCpy $5 $1 1 -1 ; copy last char
StrCmp $5 ";" +2 ; if last char != ;
StrCpy $1 "$1;" ; append ;
Push $1
Push "$0;"
Call un.StrStr ; Find `$0;` in $1
Pop $2 ; pos of our dir
StrCmp $2 "" unRemoveFromPath_done
; else, it is in path
# $0 - path to add
# $1 - path var
; $0 - path to add
; $1 - path var
StrLen $3 "$0;"
StrLen $4 $2
StrCpy $5 $1 -$4 # $5 is now the part before the path to remove
StrCpy $6 $2 "" $3 # $6 is now the part after the path to remove
StrCpy $5 $1 -$4 ; $5 is now the part before the path to remove
StrCpy $6 $2 "" $3 ; $6 is now the part after the path to remove
StrCpy $3 $5$6
StrCpy $5 $3 1 -1 # copy last char
StrCmp $5 ";" 0 +2 # if last char == ;
StrCpy $3 $3 -1 # remove last char
StrCpy $5 $3 1 -1 ; copy last char
StrCmp $5 ";" 0 +2 ; if last char == ;
StrCpy $3 $3 -1 ; remove last char
StrCmp $ADD_TO_PATH_ALL_USERS "1" unWriteAllKey
WriteRegExpandStr ${NT_current_env} "PATH" $3
@ -363,9 +363,9 @@ FunctionEnd
; Uninstall sutff
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
###########################################
# Utility Functions #
###########################################
;###########################################
;# Utility Functions #
;###########################################
; StrStr
; input, top of stack = string to search for
@ -1013,7 +1013,7 @@ Function .onInit
uninst:
ClearErrors
StrLen $2 "\Uninstall.exe"
StrCpy $3 $0 -$2 # remove "\Uninstall.exe" from UninstallString to get path
StrCpy $3 $0 -$2 ; remove "\Uninstall.exe" from UninstallString to get path
ExecWait '$0 _?=$3' ;Do not copy the uninstaller to a temp file
IfErrors uninst_failed inst

View File

@ -467,8 +467,9 @@ AqlValue Expression::executeSimpleExpression(
case NODE_TYPE_OPERATOR_UNARY_MINUS:
return executeSimpleExpressionMinus(node, trx, mustDestroy);
case NODE_TYPE_OPERATOR_BINARY_AND:
return executeSimpleExpressionAnd(node, trx, mustDestroy);
case NODE_TYPE_OPERATOR_BINARY_OR:
return executeSimpleExpressionAndOr(node, trx, mustDestroy);
return executeSimpleExpressionOr(node, trx, mustDestroy);
case NODE_TYPE_OPERATOR_BINARY_EQ:
case NODE_TYPE_OPERATOR_BINARY_NE:
case NODE_TYPE_OPERATOR_BINARY_LT:
@ -996,34 +997,38 @@ AqlValue Expression::executeSimpleExpressionMinus(AstNode const* node,
return AqlValue(-value);
}
/// @brief execute an expression of type SIMPLE with AND or OR
AqlValue Expression::executeSimpleExpressionAndOr(
/// @brief execute an expression of type SIMPLE with AND
AqlValue Expression::executeSimpleExpressionAnd(
AstNode const* node, arangodb::Transaction* trx, bool& mustDestroy) {
AqlValue left =
executeSimpleExpression(node->getMember(0), trx, mustDestroy, true);
executeSimpleExpression(node->getMemberUnchecked(0), trx, mustDestroy, true);
if (node->type == NODE_TYPE_OPERATOR_BINARY_AND) {
// AND
if (left.toBoolean()) {
// left is true => return right
if (mustDestroy) { left.destroy(); }
return executeSimpleExpression(node->getMember(1), trx, mustDestroy, true);
}
if (left.toBoolean()) {
// left is true => return right
if (mustDestroy) { left.destroy(); }
return executeSimpleExpression(node->getMemberUnchecked(1), trx, mustDestroy, true);
}
// left is false, return left
return left;
}
/// @brief execute an expression of type SIMPLE with OR
AqlValue Expression::executeSimpleExpressionOr(
AstNode const* node, arangodb::Transaction* trx, bool& mustDestroy) {
AqlValue left =
executeSimpleExpression(node->getMemberUnchecked(0), trx, mustDestroy, true);
// left is false, return left
return left;
}
// OR
if (left.toBoolean()) {
// left is true => return left
return left;
}
// left is false => return right
left.destroy();
return executeSimpleExpression(node->getMember(1), trx, mustDestroy, true);
if (mustDestroy) { left.destroy(); }
return executeSimpleExpression(node->getMemberUnchecked(1), trx, mustDestroy, true);
}
/// @brief execute an expression of type SIMPLE with AND or OR
@ -1076,11 +1081,11 @@ AqlValue Expression::executeSimpleExpressionComparison(
AstNode const* node, arangodb::Transaction* trx, bool& mustDestroy) {
AqlValue left =
executeSimpleExpression(node->getMember(0), trx, mustDestroy, false);
executeSimpleExpression(node->getMemberUnchecked(0), trx, mustDestroy, false);
AqlValueGuard guardLeft(left, mustDestroy);
AqlValue right =
executeSimpleExpression(node->getMember(1), trx, mustDestroy, false);
executeSimpleExpression(node->getMemberUnchecked(1), trx, mustDestroy, false);
AqlValueGuard guardRight(right, mustDestroy);
mustDestroy = false; // we're returning a boolean only
@ -1486,10 +1491,10 @@ AqlValue Expression::executeSimpleExpressionIterator(
AqlValue Expression::executeSimpleExpressionArithmetic(
AstNode const* node, arangodb::Transaction* trx, bool& mustDestroy) {
AqlValue lhs = executeSimpleExpression(node->getMember(0), trx, mustDestroy, true);
AqlValue lhs = executeSimpleExpression(node->getMemberUnchecked(0), trx, mustDestroy, true);
AqlValueGuard guardLhs(lhs, mustDestroy);
AqlValue rhs = executeSimpleExpression(node->getMember(1), trx, mustDestroy, true);
AqlValue rhs = executeSimpleExpression(node->getMemberUnchecked(1), trx, mustDestroy, true);
AqlValueGuard guardRhs(rhs, mustDestroy);
mustDestroy = false;
@ -1523,6 +1528,7 @@ AqlValue Expression::executeSimpleExpressionArithmetic(
}
}
mustDestroy = false;
double result;
switch (node->type) {
@ -1542,18 +1548,9 @@ AqlValue Expression::executeSimpleExpressionArithmetic(
result = fmod(l, r);
break;
default:
mustDestroy = false;
return AqlValue(VelocyPackHelper::ZeroValue());
}
if (std::isnan(result) || !std::isfinite(result) || result == HUGE_VAL || result == -HUGE_VAL) {
// convert NaN, +inf & -inf to null
mustDestroy = false;
return AqlValue(VelocyPackHelper::NullValue());
}
TransactionBuilderLeaser builder(trx);
mustDestroy = true; // builder = dynamic data
builder->add(VPackValue(result));
return AqlValue(*builder.get());
// this will convert NaN, +inf & -inf to null
return AqlValue(result);
}

View File

@ -280,10 +280,15 @@ class Expression {
AqlValue executeSimpleExpressionMinus(AstNode const*, arangodb::Transaction*,
bool& mustDestroy);
/// @brief execute an expression of type SIMPLE with AND or OR
AqlValue executeSimpleExpressionAndOr(AstNode const*,
arangodb::Transaction*,
bool& mustDestroy);
/// @brief execute an expression of type SIMPLE with AND
AqlValue executeSimpleExpressionAnd(AstNode const*,
arangodb::Transaction*,
bool& mustDestroy);
/// @brief execute an expression of type SIMPLE with OR
AqlValue executeSimpleExpressionOr(AstNode const*,
arangodb::Transaction*,
bool& mustDestroy);
/// @brief execute an expression of type SIMPLE with NARY AND or OR
AqlValue executeSimpleExpressionNaryAndOr(AstNode const*,

View File

@ -193,9 +193,14 @@ void ClusterFeature::prepare() {
auto agency =
application_features::ApplicationServer::getFeature<AgencyFeature>("Agency");
#ifdef DEBUG_SYNC_REPLICATION
bool startClusterComm = true;
#else
bool startClusterComm = false;
#endif
if (agency->isEnabled() || _enableCluster) {
// initialize ClusterComm library, must call initialize only once
ClusterComm::initialize();
startClusterComm = true;
auto authenticationFeature =
application_features::ApplicationServer::getFeature<AuthenticationFeature>(
"Authentication");
@ -207,11 +212,13 @@ void ClusterFeature::prepare() {
}
}
if (startClusterComm) {
// initialize ClusterComm library, must call initialize only once
ClusterComm::initialize();
}
// return if cluster is disabled
if (!_enableCluster) {
#ifdef DEBUG_SYNC_REPLICATION
ClusterComm::initialize();
#endif
return;
}

View File

@ -503,7 +503,9 @@ bool shardKeysChanged(std::string const& dbname, std::string const& collname,
return true;
}
#ifdef DEBUG_SYNC_REPLICATION
return false;
if (dbname == "sync-replication-test") {
return false;
}
#endif
ClusterInfo* ci = ClusterInfo::instance();

View File

@ -505,7 +505,7 @@ int TRI_vocbase_t::dropCollectionWorker(arangodb::LogicalCollection* collection,
collection->setDeleted(false);
events::DropCollection(colName, ex.code());
return ex.code();
} catch (std::exception const& ex) {
} catch (std::exception const&) {
collection->setDeleted(false);
events::DropCollection(colName, TRI_ERROR_INTERNAL);
return TRI_ERROR_INTERNAL;

View File

@ -111,3 +111,10 @@ add_custom_target(remove_packages
list(APPEND CLEAN_PACKAGES_LIST remove_packages)
if (NOT ${ENV{SYMSRV}} STREQUAL "")
message("Storing symbols:")
add_custom_command(TARGET ${BIN_ARANGOD} POST_BUILD
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
COMMAND "find -name \*pdb |grep -v Release |grep -v Debug |grep -v 3rdParty |grep -v vc120.pdb > pdbfiles_list.txt"
COMMAND "symstore.exe add /f '@${PROJECT_BINARY_DIR}/pdbfiles_list.txt' /s '${ENV{SYMSRV}}' /t ArangoDB /compress")
endif()