1
0
Fork 0

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

This commit is contained in:
scottashton 2014-05-15 10:33:25 +02:00
commit db29d7bc2c
15 changed files with 34 additions and 34 deletions

View File

@ -297,7 +297,7 @@ void runTest (int mode)
/* mainly for debugging rather than regression */
gi=GeoIndex_new();
i=GeoIndex_hint(gi,10); /* set it to "robust" mode */
GeoIndex_hint(gi,10); /* set it to "robust" mode */
for(i=0;i<50;i++)
{
gcp.latitude = 90.0;
@ -313,7 +313,7 @@ void runTest (int mode)
gcp.latitude = 89.9;
gcp.longitude = -180.0;
gcp.data = ix + 64;
r = GeoIndex_insert(gi,&gcp);
GeoIndex_insert(gi,&gcp);
list1 = GeoIndex_NearestCountPoints(gi,&gcp,1);
gccheck(13,list1, 1,"AAAAAAAAAAAAAAAABAAAAAAAA");
gicheck(14,gi);
@ -1097,7 +1097,7 @@ void runTest (int mode)
list1 = GeoIndex_PointsWithinRadius(gi,&gcp,9800000.0);
for(j=0;j<(int) list1->length;j++) /* delete before freeing list1! */
{
r=GeoIndex_remove(gi,list1->coordinates+j);
GeoIndex_remove(gi,list1->coordinates+j);
}
gcmass(400+5*i,list1, np[i], hs[i]);
}

View File

@ -161,8 +161,6 @@ int InitialSyncer::run (string& errorMsg) {
return TRI_ERROR_REPLICATION_NO_RESPONSE;
}
res = TRI_ERROR_NO_ERROR;
if (response->wasHttpError()) {
res = TRI_ERROR_REPLICATION_MASTER_ERROR;

View File

@ -453,6 +453,8 @@ bool TRI_LoadAuthInfo (TRI_vocbase_t* vocbase) {
LOG_FATAL_AND_EXIT("collection '_users' cannot be loaded");
}
assert(primary != NULL);
TRI_WriteLockReadWriteLock(&vocbase->_authInfoLock);
ClearAuthInfo(vocbase);
@ -460,7 +462,7 @@ bool TRI_LoadAuthInfo (TRI_vocbase_t* vocbase) {
// inside a write transaction
// .............................................................................
collection->_collection->beginRead(collection->_collection);
primary->beginRead(primary);
beg = primary->_primaryIndex._table;
end = beg + primary->_primaryIndex._nrAlloc;

View File

@ -4047,12 +4047,13 @@ static int BitarrayBasedIndexFromJson (TRI_document_collection_t* document,
// undefined. Determine if this is the case.
// ...........................................................................
supportUndef = false;
supportUndefIndex = TRI_LookupArrayJson(definition, "undefined");
if (supportUndefIndex == NULL || supportUndefIndex->_type != TRI_JSON_BOOLEAN) {
LOG_ERROR("ignoring index %llu, could not determine if index supports undefined values", (unsigned long long) iid);
return TRI_set_errno(TRI_ERROR_BAD_PARAMETER);
}
supportUndef = supportUndefIndex->_value._boolean;
// ...........................................................................
@ -4154,17 +4155,15 @@ static int PathBasedIndexFromJson (TRI_document_collection_t* document,
}
// determine if the hash index is unique or non-unique
unique = false;
bv = TRI_LookupArrayJson(definition, "unique");
if (bv != NULL && bv->_type == TRI_JSON_BOOLEAN) {
unique = bv->_value._boolean;
}
else {
if (bv == NULL || bv->_type != TRI_JSON_BOOLEAN) {
LOG_ERROR("ignoring index %llu, could not determine if unique or non-unique", (unsigned long long) iid);
return TRI_set_errno(TRI_ERROR_BAD_PARAMETER);
}
unique = bv->_value._boolean;
// Initialise the vector in which we store the fields on which the hashing
// will be based.
TRI_InitVectorPointer(&attributes, TRI_CORE_MEM_ZONE);

View File

@ -849,8 +849,6 @@ int TRI_ConfigureReplicationApplier (TRI_replication_applier_t* applier,
return TRI_ERROR_CLUSTER_UNSUPPORTED;
}
res = TRI_ERROR_NO_ERROR;
if (config->_endpoint == NULL || strlen(config->_endpoint) == 0) {
// no endpoint
return TRI_ERROR_REPLICATION_INVALID_APPLIER_CONFIGURATION;

View File

@ -1093,6 +1093,7 @@ static int GetStateInactive (TRI_replication_logger_t* logger,
if (vocbase->_type == TRI_VOCBASE_TYPE_COORDINATOR) {
dst->_lastLogTick = 0;
dst->_totalEvents = 0;
dst->_active = false;
return TRI_ERROR_NO_ERROR;
}
@ -1108,6 +1109,7 @@ static int GetStateInactive (TRI_replication_logger_t* logger,
primary = (TRI_primary_collection_t*) col->_collection;
dst->_lastLogTick = primary->base._info._revision;
dst->_totalEvents = 0;
dst->_active = false;
TRI_ReleaseCollectionVocBase(vocbase, col);
@ -1770,8 +1772,6 @@ int TRI_StateReplicationLogger (TRI_replication_logger_t* logger,
TRI_replication_logger_state_t* state) {
int res;
res = TRI_ERROR_NO_ERROR;
TRI_ReadLockReadWriteLock(&logger->_statusLock);
if (logger->_state._active) {

View File

@ -586,13 +586,10 @@ void ApplicationServer::start () {
////////////////////////////////////////////////////////////////////////////////
void ApplicationServer::wait () {
bool running = true;
// wait until we receive a stop signal
while (running && _stopping == 0) {
while (_stopping == 0) {
// check the parent and wait for a second
if (! checkParent()) {
running = false;
break;
}

View File

@ -192,11 +192,7 @@ namespace triagens {
assert(res != Z_STREAM_ERROR);
switch (res) {
case Z_NEED_DICT: {
res = Z_DATA_ERROR;
}
// fall-through intentional
case Z_NEED_DICT:
case Z_DATA_ERROR:
case Z_MEM_ERROR: {
(void) inflateEnd(&strm);
@ -266,11 +262,7 @@ namespace triagens {
assert(res != Z_STREAM_ERROR);
switch (res) {
case Z_NEED_DICT: {
res = Z_DATA_ERROR;
}
// fall-through intentional
case Z_NEED_DICT:
case Z_DATA_ERROR:
case Z_MEM_ERROR: {
(void) inflateEnd(&strm);

View File

@ -377,6 +377,8 @@ void TRI_Free (TRI_memory_zone_t* zone, void* m) {
fprintf(stderr,
"freeing nil ptr " ZONE_DEBUG_LOCATION
ZONE_DEBUG_PARAMS);
// crash intentionally
assert(false);
}
// zone->_zid is a uint32_t but we'll decrease by sizeof(uintptr_t) bytes for good alignment everywhere

View File

@ -196,7 +196,7 @@ static int UnzipFile (unzFile uf,
const char* password) {
unz_global_info64 gi;
uLong i;
int res;
int res = TRI_ERROR_NO_ERROR;
if (unzGetGlobalInfo64(uf, &gi) != UNZ_OK) {
return TRI_ERROR_INTERNAL;

View File

@ -131,6 +131,7 @@ void ApplicationDispatcher::buildStandardQueue (size_t nrThreads,
LOG_TRACE("setting up a standard queue with %d threads", (int) nrThreads);
assert(_dispatcher != 0);
_dispatcher->addQueue("STANDARD", nrThreads, maxSize);
}
@ -147,6 +148,7 @@ void ApplicationDispatcher::buildNamedQueue (string const& name,
LOG_TRACE("setting up a named queue '%s' with %d threads", name.c_str(), (int) nrThreads);
assert(_dispatcher != 0);
_dispatcher->addQueue(name, nrThreads, maxSize);
}

View File

@ -1532,7 +1532,6 @@ bool TRI_ParseFileProgramOptions (TRI_program_options_t * options,
// used by routine getline()
buffer = NULL;
len = 0;
// current section
section = TRI_DuplicateString("");

View File

@ -380,6 +380,7 @@ void ApplicationScheduler::installSignalHandler (SignalTask* task) {
LOG_FATAL_AND_EXIT("no scheduler is known, cannot install signal handler");
}
assert(_scheduler != 0);
_scheduler->registerTask(task);
}
@ -561,6 +562,8 @@ void ApplicationScheduler::buildSchedulerReporter () {
if (_scheduler == 0) {
LOG_FATAL_AND_EXIT("no scheduler is known, cannot create control-c handler");
}
assert(_scheduler != 0);
if (0.0 < _reportInterval) {
Task* reporter = new SchedulerReporterTask(_scheduler, _reportInterval);
@ -578,6 +581,8 @@ void ApplicationScheduler::buildControlCHandler () {
if (_scheduler == 0) {
LOG_FATAL_AND_EXIT("no scheduler is known, cannot create control-c handler");
}
assert(_scheduler != 0);
// control C handler
Task* controlC = new ControlCTask(_applicationServer);

View File

@ -469,7 +469,6 @@ void TRI_PrintShapeAccessor (TRI_shape_access_t* accessor) {
printf(" result shape: %lu\n", (unsigned long) accessor->_shape->_sid);
void const** ops = static_cast<void const**>(accessor->_code);
shape = accessor->_shape;
while (true) {
TRI_shape_ac_bc_e op = static_cast<TRI_shape_ac_bc_e>(*(TRI_shape_ac_bc_e*) ops);

View File

@ -2662,11 +2662,15 @@ static v8::Handle<v8::Value> JS_StatusExternal (v8::Arguments const& argv) {
}
v8::Handle<v8::Object> obj = v8::Handle<v8::Object>::Cast(argv[0]);
if (!obj->Has(pidname)) {
if (! obj->Has(pidname)) {
TRI_V8_EXCEPTION_MESSAGE(scope, TRI_ERROR_BAD_PARAMETER,
"statusExternal: pid must be given");
}
TRI_external_id_t pid;
memset(&pid, 0, sizeof(TRI_external_id_t));
#ifndef _WIN32
pid._pid = static_cast<TRI_pid_t>(TRI_ObjectToUInt64(obj->Get(pidname),true));
#else
@ -2676,6 +2680,7 @@ static v8::Handle<v8::Value> JS_StatusExternal (v8::Arguments const& argv) {
if (argv.Length() == 2) {
wait = TRI_ObjectToBoolean(argv[1]);
}
TRI_external_status_t external = TRI_CheckExternalProcess(pid, wait);
v8::Handle<v8::Object> result = v8::Object::New();
@ -2724,6 +2729,8 @@ static v8::Handle<v8::Value> JS_KillExternal (v8::Arguments const& argv) {
"statusExternal: pid must be given");
}
TRI_external_id_t pid;
memset(&pid, 0, sizeof(TRI_external_id_t));
#ifndef _WIN32
pid._pid = static_cast<TRI_pid_t>(TRI_ObjectToUInt64(obj->Get(pidname),true));
#else