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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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