From b4e876e2823c71024d991f998dd39a6900fc20cd Mon Sep 17 00:00:00 2001 From: Jan Steemann Date: Tue, 19 Apr 2016 16:57:26 +0200 Subject: [PATCH 1/4] prefer explicit options over positional argument --- arangosh/Import/ImportFeature.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/arangosh/Import/ImportFeature.cpp b/arangosh/Import/ImportFeature.cpp index c2a7376daf..aa6244eda3 100644 --- a/arangosh/Import/ImportFeature.cpp +++ b/arangosh/Import/ImportFeature.cpp @@ -147,7 +147,11 @@ void ImportFeature::validateOptions( size_t n = positionals.size(); if (1 == n) { - _filename = positionals[0]; + // only take positional file name attribute into account if user + // did not specify the --file option as well + if (!options->processingResult().touched("--file")) { + _filename = positionals[0]; + } } else if (1 < n) { LOG(ERR) << "expecting at most one filename, got " + StringUtils::join(positionals, ", "); From 2c246c860c1f9408350c99edb711049ad97877d9 Mon Sep 17 00:00:00 2001 From: Michael Hackstein Date: Tue, 19 Apr 2016 17:07:18 +0200 Subject: [PATCH 2/4] Fixed a bug in general-graph module. It was possible to create a graph using document collections for relations. This did lead into undefined behaviour. --- js/common/modules/@arangodb/general-graph.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/js/common/modules/@arangodb/general-graph.js b/js/common/modules/@arangodb/general-graph.js index 584bc98f09..6682d4a6da 100644 --- a/js/common/modules/@arangodb/general-graph.js +++ b/js/common/modules/@arangodb/general-graph.js @@ -87,6 +87,11 @@ var findOrCreateCollectionByName = function (name, type, noCreate) { err.errorNum = arangodb.errors.ERROR_GRAPH_NOT_AN_ARANGO_COLLECTION.code; err.errorMessage = name + arangodb.errors.ERROR_GRAPH_NOT_AN_ARANGO_COLLECTION.message; throw err; + } else if (type == ArangoCollection.TYPE_EDGE && col.type() !== type) { + var err = new ArangoError(); + err.errorNum = arangodb.errors.ERROR_ARANGO_COLLECTION_TYPE_INVALID.code; + err.errorMessage = name + " cannot be used as relation. It is not an edge collection"; + throw err; } return res; }; From 7455347263310664937af838e6c473de266b6cc3 Mon Sep 17 00:00:00 2001 From: Michael Hackstein Date: Tue, 19 Apr 2016 17:08:16 +0200 Subject: [PATCH 3/4] Start Local cluster will now fail if upgrading and bootstrapping fails --- scripts/startLocalCluster.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/scripts/startLocalCluster.sh b/scripts/startLocalCluster.sh index cf641fedeb..fe0535cbf1 100755 --- a/scripts/startLocalCluster.sh +++ b/scripts/startLocalCluster.sh @@ -247,12 +247,21 @@ if [ -n "$SECONDARIES" ]; then fi echo Bootstrapping DBServers... -curl -s -X POST "http://127.0.0.1:8530/_admin/cluster/bootstrapDbServers" \ +curl -s -f -X POST "http://127.0.0.1:8530/_admin/cluster/bootstrapDbServers" \ -d '{"isRelaunch":false}' >> cluster/DBServersUpgrade.log 2>&1 +if [ "$?" != 0 ] ; then + echo "Bootstrapping DBServers failed" + exit 1; +fi + echo Running DB upgrade on cluster... -curl -s -X POST "http://127.0.0.1:8530/_admin/cluster/upgradeClusterDatabase" \ +curl -s -f -X POST "http://127.0.0.1:8530/_admin/cluster/upgradeClusterDatabase" \ -d '{"isRelaunch":false}' >> cluster/DBUpgrade.log 2>&1 +if [ "$?" != 0 ] ; then + echo "DB upgrade on cluster failed" + exit 1; +fi echo Bootstrapping Coordinators... PIDS="" From 95662103f2720c33b7534a1dc8390090a62f6b2f Mon Sep 17 00:00:00 2001 From: Michael Hackstein Date: Tue, 19 Apr 2016 17:39:58 +0200 Subject: [PATCH 4/4] Fixed JSLint --- js/common/modules/@arangodb/general-graph.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/js/common/modules/@arangodb/general-graph.js b/js/common/modules/@arangodb/general-graph.js index 6682d4a6da..77019646f0 100644 --- a/js/common/modules/@arangodb/general-graph.js +++ b/js/common/modules/@arangodb/general-graph.js @@ -87,11 +87,11 @@ var findOrCreateCollectionByName = function (name, type, noCreate) { err.errorNum = arangodb.errors.ERROR_GRAPH_NOT_AN_ARANGO_COLLECTION.code; err.errorMessage = name + arangodb.errors.ERROR_GRAPH_NOT_AN_ARANGO_COLLECTION.message; throw err; - } else if (type == ArangoCollection.TYPE_EDGE && col.type() !== type) { - var err = new ArangoError(); - err.errorNum = arangodb.errors.ERROR_ARANGO_COLLECTION_TYPE_INVALID.code; - err.errorMessage = name + " cannot be used as relation. It is not an edge collection"; - throw err; + } else if (type === ArangoCollection.TYPE_EDGE && col.type() !== type) { + var err2 = new ArangoError(); + err2.errorNum = arangodb.errors.ERROR_ARANGO_COLLECTION_TYPE_INVALID.code; + err2.errorMessage = name + " cannot be used as relation. It is not an edge collection"; + throw err2; } return res; };