mirror of https://gitee.com/bigwinds/arangodb
Merge branch 'devel' of github.com:triAGENS/ArangoDB into devel
This commit is contained in:
commit
478e3a73f3
|
@ -224,7 +224,8 @@ describe ArangoDB do
|
|||
doc.parsed_response['code'].should eq(200)
|
||||
doc.parsed_response['id'].should eq(@cid)
|
||||
doc.parsed_response['name'].should eq(@cn)
|
||||
[2,4].include?(doc.parsed_response['status']).should be_true
|
||||
p doc.parsed_response['status']
|
||||
[2, 4].include?(doc.parsed_response['status'].to_i).should eq(true)
|
||||
end
|
||||
|
||||
# get
|
||||
|
@ -251,7 +252,7 @@ describe ArangoDB do
|
|||
doc.parsed_response['code'].should eq(200)
|
||||
doc.parsed_response['id'].should eq(@cid)
|
||||
doc.parsed_response['name'].should eq(@cn)
|
||||
[2,4].include?(doc.parsed_response['status']).should be_true
|
||||
[2, 4].include?(doc.parsed_response['status'].to_i).should eq(true)
|
||||
end
|
||||
|
||||
# get count
|
||||
|
@ -751,7 +752,7 @@ describe ArangoDB do
|
|||
doc.parsed_response['code'].should eq(200)
|
||||
doc.parsed_response['id'].should eq(cid)
|
||||
doc.parsed_response['name'].should eq(@cn)
|
||||
[2,4].include?(doc.parsed_response['status']).should be_true
|
||||
[2, 4].include?(doc.parsed_response['status'].to_i).should eq(true)
|
||||
|
||||
ArangoDB.drop_collection(@cn)
|
||||
end
|
||||
|
@ -769,7 +770,7 @@ describe ArangoDB do
|
|||
doc.parsed_response['code'].should eq(200)
|
||||
doc.parsed_response['id'].should eq(cid)
|
||||
doc.parsed_response['name'].should eq(@cn)
|
||||
[2,4].include?(doc.parsed_response['status']).should be_true
|
||||
[2, 4].include?(doc.parsed_response['status'].to_i).should eq(true)
|
||||
|
||||
ArangoDB.drop_collection(@cn)
|
||||
end
|
||||
|
@ -797,7 +798,7 @@ describe ArangoDB do
|
|||
doc = ArangoDB.post(cmd, :body => body)
|
||||
end
|
||||
|
||||
ArangoDB.size_collection(@cid).should eq(10)
|
||||
ArangoDB.size_collection(@cid).to_i.should eq(10)
|
||||
|
||||
cmd = api + "/" + @cn + "/truncate"
|
||||
doc = ArangoDB.log_put("#{prefix}-identifier-truncate", cmd)
|
||||
|
|
|
@ -470,6 +470,7 @@ SHELL_SERVER_ONLY = \
|
|||
@top_srcdir@/js/server/tests/shell-foxx-repository-spec.js \
|
||||
@top_srcdir@/js/server/tests/shell-foxx-query-spec.js \
|
||||
@top_srcdir@/js/server/tests/shell-foxx-model.js \
|
||||
@top_srcdir@/js/server/tests/shell-foxx-model-events-spec.js \
|
||||
@top_srcdir@/js/server/tests/shell-foxx-base-middleware.js \
|
||||
@top_srcdir@/js/server/tests/shell-foxx-template-middleware.js \
|
||||
@top_srcdir@/js/server/tests/shell-foxx-format-middleware.js \
|
||||
|
|
|
@ -994,7 +994,7 @@ yy_find_action:
|
|||
if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
|
||||
{
|
||||
yy_size_t yyl;
|
||||
for ( yyl = 0; yyl < (int) yyleng; ++yyl )
|
||||
for ( yyl = 0; yyl < yyleng; ++yyl )
|
||||
if ( yytext[yyl] == '\n' )
|
||||
|
||||
do{ yylineno++;
|
||||
|
@ -2311,7 +2311,7 @@ YY_BUFFER_STATE Aql_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len
|
|||
if ( ! buf )
|
||||
YY_FATAL_ERROR( "out of dynamic memory in Aql_scan_bytes()" );
|
||||
|
||||
for ( i = 0; i < (int) _yybytes_len; ++i )
|
||||
for ( i = 0; i < _yybytes_len; ++i )
|
||||
buf[i] = yybytes[i];
|
||||
|
||||
buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
|
||||
|
|
|
@ -374,8 +374,8 @@ ApplicationV8::V8Context* ApplicationV8::enterContext (std::string const& name,
|
|||
|
||||
v8::HandleScope scope(isolate);
|
||||
auto localContext = v8::Local<v8::Context>::New(isolate, context->_context);
|
||||
/// v8::Context::Scope contextScope(localContext);
|
||||
localContext->Enter();
|
||||
v8::Context::Scope contextScope(localContext);
|
||||
|
||||
TRI_ASSERT(context->_locker->IsLocked(isolate));
|
||||
TRI_ASSERT(v8::Locker::IsLocked(isolate));
|
||||
|
@ -427,7 +427,6 @@ void ApplicationV8::exitContext (V8Context* context) {
|
|||
context->_hasDeadObjects = v8g->_hasDeadObjects;
|
||||
++context->_numExecutions;
|
||||
|
||||
/// TODO do we need this? v8::Context::Scope contextScope(localContext);
|
||||
// check for cancelation requests
|
||||
bool const canceled = v8g->_canceled;
|
||||
v8g->_canceled = false;
|
||||
|
@ -708,10 +707,10 @@ void ApplicationV8::upgradeDatabase (bool skip,
|
|||
isolate->Enter();
|
||||
{
|
||||
v8::HandleScope scope(isolate);
|
||||
|
||||
|
||||
auto localContext = v8::Local<v8::Context>::New(isolate, context->_context);
|
||||
//// TODO do we need this? v8::Context::Scope contextScope(localContext);
|
||||
localContext->Enter();
|
||||
v8::Context::Scope contextScope(localContext);
|
||||
|
||||
// run upgrade script
|
||||
if (! skip) {
|
||||
|
@ -755,45 +754,42 @@ void ApplicationV8::upgradeDatabase (bool skip,
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (perform) {
|
||||
|
||||
if (perform) {
|
||||
// issue #391: when invoked with --upgrade, the server will not always shut down
|
||||
LOG_INFO("database upgrade passed");
|
||||
delete context->_locker;
|
||||
|
||||
// issue #391: when invoked with --upgrade, the server will not always shut down
|
||||
LOG_INFO("database upgrade passed");
|
||||
localContext->Exit();
|
||||
delete context->_locker;
|
||||
// regular shutdown... wait for all threads to finish
|
||||
|
||||
// regular shutdown... wait for all threads to finish
|
||||
// again, can do this without the lock
|
||||
for (size_t j = 0; j < _server->_databases._nrAlloc; ++j) {
|
||||
TRI_vocbase_t* vocbase = static_cast<TRI_vocbase_t*>(_server->_databases._table[j]);
|
||||
|
||||
// again, can do this without the lock
|
||||
for (size_t j = 0; j < _server->_databases._nrAlloc; ++j) {
|
||||
TRI_vocbase_t* vocbase = static_cast<TRI_vocbase_t*>(_server->_databases._table[j]);
|
||||
if (vocbase != nullptr) {
|
||||
vocbase->_state = 2;
|
||||
|
||||
if (vocbase != nullptr) {
|
||||
vocbase->_state = 2;
|
||||
int res = TRI_ERROR_NO_ERROR;
|
||||
|
||||
int res = TRI_ERROR_NO_ERROR;
|
||||
res |= TRI_StopCompactorVocBase(vocbase);
|
||||
vocbase->_state = 3;
|
||||
res |= TRI_JoinThread(&vocbase->_cleanup);
|
||||
|
||||
res |= TRI_StopCompactorVocBase(vocbase);
|
||||
vocbase->_state = 3;
|
||||
res |= TRI_JoinThread(&vocbase->_cleanup);
|
||||
|
||||
if (res != TRI_ERROR_NO_ERROR) {
|
||||
LOG_ERROR("unable to join database threads for database '%s'", vocbase->_name);
|
||||
}
|
||||
if (res != TRI_ERROR_NO_ERROR) {
|
||||
LOG_ERROR("unable to join database threads for database '%s'", vocbase->_name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
LOG_INFO("finished");
|
||||
TRI_EXIT_FUNCTION(EXIT_SUCCESS, NULL);
|
||||
}
|
||||
else {
|
||||
// and return from the context
|
||||
localContext->Exit();
|
||||
delete context->_locker;
|
||||
LOG_INFO("finished");
|
||||
TRI_EXIT_FUNCTION(EXIT_SUCCESS, NULL);
|
||||
}
|
||||
else {
|
||||
// and return from the context
|
||||
delete context->_locker;
|
||||
|
||||
LOG_TRACE("finished database init/upgrade");
|
||||
}
|
||||
LOG_TRACE("finished database init/upgrade");
|
||||
}
|
||||
isolate->Exit();
|
||||
}
|
||||
|
@ -816,8 +812,8 @@ void ApplicationV8::versionCheck () {
|
|||
{
|
||||
v8::HandleScope scope(isolate);
|
||||
auto localContext = v8::Local<v8::Context>::New(isolate, context->_context);
|
||||
/// v8::Context::Scope contextScope(localContext);
|
||||
localContext->Enter();
|
||||
v8::Context::Scope contextScope(localContext);
|
||||
|
||||
// run upgrade script
|
||||
LOG_DEBUG("running database version check");
|
||||
|
@ -928,8 +924,8 @@ bool ApplicationV8::prepareNamedContexts (const string& name,
|
|||
{
|
||||
v8::HandleScope scope(isolate);
|
||||
auto localContext = v8::Local<v8::Context>::New(isolate, context->_context);
|
||||
/// v8::Context::Scope contextScope(localContext);
|
||||
localContext->Enter();
|
||||
v8::Context::Scope contextScope(localContext);
|
||||
|
||||
{
|
||||
v8::TryCatch tryCatch;
|
||||
|
@ -1290,7 +1286,7 @@ bool ApplicationV8::prepareV8Instance (const string& name, size_t i, bool useAct
|
|||
auto localContext = v8::Local<v8::Context>::New(isolate, persistentContext);
|
||||
|
||||
localContext->Enter();
|
||||
/// TODO v8::Context::Scope contextScope(localContext);
|
||||
v8::Context::Scope contextScope(localContext);
|
||||
|
||||
context->_context.Reset(context->isolate, localContext);
|
||||
|
||||
|
@ -1388,8 +1384,8 @@ void ApplicationV8::prepareV8Server (const string& name, const size_t i, const s
|
|||
{
|
||||
v8::HandleScope handle_scope(isolate);
|
||||
auto localContext = v8::Local<v8::Context>::New(isolate, context->_context);
|
||||
/// TODO: do we need this? v8::Context::Scope contextScope(localContext);
|
||||
localContext->Enter();
|
||||
v8::Context::Scope contextScope(localContext);
|
||||
|
||||
// load server startup file
|
||||
bool ok = _startupLoader.loadScript(isolate, localContext, startupFile);
|
||||
|
@ -1424,8 +1420,8 @@ void ApplicationV8::shutdownV8Instance (const string& name, size_t i) {
|
|||
v8::HandleScope scope(isolate);
|
||||
|
||||
auto localContext = v8::Local<v8::Context>::New(isolate, context->_context);
|
||||
//// TODO v8::Context::Scope contextScope(localContext);
|
||||
localContext->Enter();
|
||||
v8::Context::Scope contextScope(localContext);
|
||||
|
||||
isolate->LowMemoryNotification();
|
||||
while (! isolate->IdleNotification(1000)) {
|
||||
|
|
|
@ -141,7 +141,7 @@ TRI_shaper_t* TRI_document_collection_t::getShaper () const {
|
|||
/// @brief add a WAL operation for a transaction collection
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
int TRI_AddOperationTransaction (triagens::wal::DocumentOperation&, bool);
|
||||
int TRI_AddOperationTransaction (triagens::wal::DocumentOperation&, bool&);
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- forward declarations
|
||||
|
@ -588,7 +588,7 @@ static int InsertDocument (TRI_transaction_collection_t* trxCollection,
|
|||
TRI_doc_mptr_t* header,
|
||||
triagens::wal::DocumentOperation& operation,
|
||||
TRI_doc_mptr_copy_t* mptr,
|
||||
bool syncRequested) {
|
||||
bool& waitForSync) {
|
||||
|
||||
TRI_ASSERT(header != nullptr);
|
||||
TRI_ASSERT(mptr != nullptr);
|
||||
|
@ -627,7 +627,7 @@ static int InsertDocument (TRI_transaction_collection_t* trxCollection,
|
|||
THROW_ARANGO_EXCEPTION(TRI_ERROR_DEBUG);
|
||||
}
|
||||
|
||||
res = TRI_AddOperationTransaction(operation, syncRequested);
|
||||
res = TRI_AddOperationTransaction(operation, waitForSync);
|
||||
|
||||
if (res != TRI_ERROR_NO_ERROR) {
|
||||
return res;
|
||||
|
@ -4896,6 +4896,7 @@ int TRI_RemoveShapedJsonDocumentCollection (TRI_transaction_collection_t* trxCol
|
|||
|
||||
TRI_doc_mptr_t* header;
|
||||
int res;
|
||||
TRI_voc_tick_t markerTick = 0;
|
||||
{
|
||||
TRI_IF_FAILURE("RemoveDocumentNoLock") {
|
||||
// test what happens if no lock can be acquired
|
||||
|
@ -4946,6 +4947,15 @@ int TRI_RemoveShapedJsonDocumentCollection (TRI_transaction_collection_t* trxCol
|
|||
}
|
||||
|
||||
res = TRI_AddOperationTransaction(operation, forceSync);
|
||||
|
||||
if (res == TRI_ERROR_NO_ERROR && forceSync) {
|
||||
markerTick = operation.tick;
|
||||
}
|
||||
}
|
||||
|
||||
if (markerTick > 0) {
|
||||
// need to wait for tick, outside the lock
|
||||
triagens::wal::LogfileManager::instance()->slots()->waitForTick(markerTick);
|
||||
}
|
||||
|
||||
return res;
|
||||
|
@ -5019,6 +5029,7 @@ int TRI_InsertShapedJsonDocumentCollection (TRI_transaction_collection_t* trxCol
|
|||
|
||||
TRI_ASSERT(marker != nullptr);
|
||||
|
||||
TRI_voc_tick_t markerTick = 0;
|
||||
// now insert into indexes
|
||||
{
|
||||
TRI_IF_FAILURE("InsertDocumentNoLock") {
|
||||
|
@ -5064,9 +5075,18 @@ int TRI_InsertShapedJsonDocumentCollection (TRI_transaction_collection_t* trxCol
|
|||
|
||||
if (res == TRI_ERROR_NO_ERROR) {
|
||||
TRI_ASSERT(mptr->getDataPtr() != nullptr); // PROTECTED by trx in trxCollection
|
||||
|
||||
if (forceSync) {
|
||||
markerTick = operation.tick;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (markerTick > 0) {
|
||||
// need to wait for tick, outside the lock
|
||||
triagens::wal::LogfileManager::instance()->slots()->waitForTick(markerTick);
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
|
@ -5097,7 +5117,7 @@ int TRI_UpdateShapedJsonDocumentCollection (TRI_transaction_collection_t* trxCol
|
|||
//TRI_ASSERT_EXPENSIVE(lock || TRI_IsLockedCollectionTransaction(trxCollection, TRI_TRANSACTION_WRITE, 0));
|
||||
|
||||
int res = TRI_ERROR_NO_ERROR;
|
||||
|
||||
TRI_voc_tick_t markerTick = 0;
|
||||
{
|
||||
TRI_IF_FAILURE("UpdateDocumentNoLock") {
|
||||
return TRI_ERROR_DEBUG;
|
||||
|
@ -5154,6 +5174,10 @@ int TRI_UpdateShapedJsonDocumentCollection (TRI_transaction_collection_t* trxCol
|
|||
operation.init();
|
||||
|
||||
res = UpdateDocument(trxCollection, oldHeader, operation, mptr, forceSync);
|
||||
|
||||
if (res == TRI_ERROR_NO_ERROR && forceSync) {
|
||||
markerTick = operation.tick;
|
||||
}
|
||||
}
|
||||
|
||||
if (res == TRI_ERROR_NO_ERROR) {
|
||||
|
@ -5161,6 +5185,11 @@ int TRI_UpdateShapedJsonDocumentCollection (TRI_transaction_collection_t* trxCol
|
|||
TRI_ASSERT(mptr->_rid > 0);
|
||||
}
|
||||
|
||||
if (markerTick > 0) {
|
||||
// need to wait for tick, outside the lock
|
||||
triagens::wal::LogfileManager::instance()->slots()->waitForTick(markerTick);
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
|
|
|
@ -2797,9 +2797,8 @@ bool TRI_MSync (int fd,
|
|||
|
||||
char* b = (char*)( (p / g) * g );
|
||||
char* e = (char*)( ((q + g - 1) / g) * g );
|
||||
int res;
|
||||
|
||||
res = TRI_FlushMMFile(fd, &mmHandle, b, e - b, MS_SYNC);
|
||||
int res = TRI_FlushMMFile(fd, &mmHandle, b, e - b, MS_SYNC);
|
||||
|
||||
if (res != TRI_ERROR_NO_ERROR) {
|
||||
TRI_set_errno(res);
|
||||
|
|
|
@ -1058,7 +1058,7 @@ bool TRI_IsLockedCollectionTransaction (TRI_transaction_collection_t const* trxC
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
int TRI_AddOperationTransaction (triagens::wal::DocumentOperation& operation,
|
||||
bool syncRequested) {
|
||||
bool& waitForSync) {
|
||||
TRI_transaction_collection_t* trxCollection = operation.trxCollection;
|
||||
TRI_transaction_t* trx = trxCollection->_transaction;
|
||||
|
||||
|
@ -1066,17 +1066,18 @@ int TRI_AddOperationTransaction (triagens::wal::DocumentOperation& operation,
|
|||
|
||||
bool const isSingleOperationTransaction = IsSingleOperationTransaction(trx);
|
||||
|
||||
// default is false
|
||||
bool waitForSync = false;
|
||||
if (isSingleOperationTransaction) {
|
||||
waitForSync = syncRequested || trxCollection->_waitForSync;
|
||||
}
|
||||
|
||||
// upgrade the info for the transaction
|
||||
if (syncRequested || trxCollection->_waitForSync) {
|
||||
if (waitForSync || trxCollection->_waitForSync) {
|
||||
trx->_waitForSync = true;
|
||||
}
|
||||
|
||||
// default is false
|
||||
waitForSync = false;
|
||||
if (isSingleOperationTransaction) {
|
||||
waitForSync |= trxCollection->_waitForSync;
|
||||
}
|
||||
|
||||
|
||||
TRI_IF_FAILURE("TransactionOperationNoSlot") {
|
||||
return TRI_ERROR_DEBUG;
|
||||
}
|
||||
|
@ -1105,7 +1106,7 @@ int TRI_AddOperationTransaction (triagens::wal::DocumentOperation& operation,
|
|||
auto oldm = reinterpret_cast<triagens::wal::document_marker_t*>(oldmarker);
|
||||
if ((oldm->_type == TRI_WAL_MARKER_DOCUMENT ||
|
||||
oldm->_type == TRI_WAL_MARKER_EDGE) &&
|
||||
!triagens::wal::LogfileManager::instance()->suppressShapeInformation()) {
|
||||
! triagens::wal::LogfileManager::instance()->suppressShapeInformation()) {
|
||||
// In this case we have to take care of the legend, we know that the
|
||||
// marker does not have a legend so far, so first try to get away
|
||||
// with this:
|
||||
|
@ -1113,7 +1114,7 @@ int TRI_AddOperationTransaction (triagens::wal::DocumentOperation& operation,
|
|||
TRI_voc_cid_t cid = oldm->_collectionId;
|
||||
TRI_shape_sid_t sid = oldm->_shape;
|
||||
void* oldLegend;
|
||||
triagens::wal::SlotInfoCopy slotInfo = triagens::wal::LogfileManager::instance()->allocateAndWrite(oldmarker, operation.marker->size(), waitForSync, cid, sid, 0, oldLegend);
|
||||
triagens::wal::SlotInfoCopy slotInfo = triagens::wal::LogfileManager::instance()->allocateAndWrite(oldmarker, operation.marker->size(), false, cid, sid, 0, oldLegend);
|
||||
if (slotInfo.errorCode == TRI_ERROR_LEGEND_NOT_IN_WAL_FILE) {
|
||||
// Oh dear, we have to build a legend and patch the marker:
|
||||
triagens::basics::JsonLegend legend(document->getShaper()); // PROTECTED by trx in trxCollection
|
||||
|
@ -1139,14 +1140,14 @@ int TRI_AddOperationTransaction (triagens::wal::DocumentOperation& operation,
|
|||
auto newm = reinterpret_cast<triagens::wal::document_marker_t*>(newmarker);
|
||||
newm->_size = newMarkerSize;
|
||||
newm->_offsetJson = (uint32_t) (oldm->_offsetLegend + legend.getSize());
|
||||
triagens::wal::SlotInfoCopy slotInfo2 = triagens::wal::LogfileManager::instance()->allocateAndWrite(newmarker, newMarkerSize, waitForSync, cid, sid, newm->_offsetLegend, oldLegend);
|
||||
triagens::wal::SlotInfoCopy slotInfo2 = triagens::wal::LogfileManager::instance()->allocateAndWrite(newmarker, newMarkerSize, false, cid, sid, newm->_offsetLegend, oldLegend);
|
||||
delete[] newmarker;
|
||||
if (slotInfo2.errorCode != TRI_ERROR_NO_ERROR) {
|
||||
return slotInfo2.errorCode;
|
||||
}
|
||||
fid = slotInfo2.logfileId;
|
||||
position = slotInfo2.mem;
|
||||
|
||||
operation.tick = slotInfo2.tick;
|
||||
}
|
||||
}
|
||||
else if (slotInfo.errorCode != TRI_ERROR_NO_ERROR) {
|
||||
|
@ -1159,6 +1160,7 @@ int TRI_AddOperationTransaction (triagens::wal::DocumentOperation& operation,
|
|||
-reinterpret_cast<char*>(legendPtr);
|
||||
// This means that we can find the old legend relative to
|
||||
// the new position in the same WAL file.
|
||||
operation.tick = slotInfo.tick;
|
||||
fid = slotInfo.logfileId;
|
||||
position = slotInfo.mem;
|
||||
}
|
||||
|
@ -1166,11 +1168,12 @@ int TRI_AddOperationTransaction (triagens::wal::DocumentOperation& operation,
|
|||
}
|
||||
else {
|
||||
// No document or edge marker, just append it to the WAL:
|
||||
triagens::wal::SlotInfoCopy slotInfo = triagens::wal::LogfileManager::instance()->allocateAndWrite(operation.marker->mem(), operation.marker->size(), waitForSync);
|
||||
triagens::wal::SlotInfoCopy slotInfo = triagens::wal::LogfileManager::instance()->allocateAndWrite(operation.marker->mem(), operation.marker->size(), false);
|
||||
if (slotInfo.errorCode != TRI_ERROR_NO_ERROR) {
|
||||
// some error occurred
|
||||
return slotInfo.errorCode;
|
||||
}
|
||||
operation.tick = slotInfo.tick;
|
||||
fid = slotInfo.logfileId;
|
||||
position = slotInfo.mem;
|
||||
}
|
||||
|
@ -1181,7 +1184,7 @@ int TRI_AddOperationTransaction (triagens::wal::DocumentOperation& operation,
|
|||
fid = operation.marker->fid();
|
||||
position = operation.marker->mem();
|
||||
}
|
||||
|
||||
|
||||
TRI_ASSERT(fid > 0);
|
||||
TRI_ASSERT(position != nullptr);
|
||||
|
||||
|
|
|
@ -30,6 +30,7 @@ namespace triagens {
|
|||
trxCollection(trxCollection),
|
||||
header(nullptr),
|
||||
rid(rid),
|
||||
tick(0),
|
||||
type(type),
|
||||
status(StatusType::CREATED),
|
||||
freeMarker(freeMarker) {
|
||||
|
@ -55,6 +56,7 @@ namespace triagens {
|
|||
|
||||
DocumentOperation* swap () {
|
||||
DocumentOperation* copy = new DocumentOperation(marker, freeMarker, trxCollection, type, rid);
|
||||
copy->tick = tick;
|
||||
copy->header = header;
|
||||
copy->oldHeader = oldHeader;
|
||||
copy->status = status;
|
||||
|
@ -131,6 +133,7 @@ namespace triagens {
|
|||
TRI_doc_mptr_t* header;
|
||||
TRI_doc_mptr_copy_t oldHeader;
|
||||
TRI_voc_rid_t const rid;
|
||||
TRI_voc_tick_t tick;
|
||||
TRI_voc_document_operation_e type;
|
||||
StatusType status;
|
||||
bool freeMarker;
|
||||
|
|
|
@ -17,9 +17,9 @@ runJSUnityTests = function (tests) {
|
|||
|
||||
_.each(tests, function (file) {
|
||||
// find out whether we're on server or client...
|
||||
var runenvironment = "arangoD";
|
||||
var runenvironment = "arangod";
|
||||
if (typeof(require('internal').arango) === 'object') {
|
||||
runenvironment = "ArangoSH";
|
||||
runenvironment = "arangosh";
|
||||
}
|
||||
|
||||
if (result) {
|
||||
|
|
|
@ -566,20 +566,20 @@ function runThere (options, instanceInfo, file) {
|
|||
else {
|
||||
var jasmineReportFormat = options.jasmineReportFormat || 'progress';
|
||||
t = 'var executeTestSuite = require("jasmine").executeTestSuite; '+
|
||||
'return executeTestSuite([' + JSON.stringify(file) + '],{"format": '+
|
||||
JSON.stringify(jasmineReportFormat) + '});';
|
||||
'return { status: executeTestSuite([' + JSON.stringify(file) + '],{"format": '+
|
||||
JSON.stringify(jasmineReportFormat) + '}) };';
|
||||
}
|
||||
var o = makeAuthorisationHeaders(options);
|
||||
o.method = "POST";
|
||||
o.timeout = 24*3600;
|
||||
o.returnBodyOnError = true;
|
||||
r = download(instanceInfo.url+"/_admin/execute?returnAsJSON=true",t,o);
|
||||
r = download(instanceInfo.url + "/_admin/execute?returnAsJSON=true",t,o);
|
||||
if (!r.error && r.code === 200) {
|
||||
r = JSON.parse(r.body);
|
||||
}
|
||||
if (file.indexOf("-spec") !== -1) {
|
||||
// remoting a jasmine suite...
|
||||
r = {status: r, message: ''};
|
||||
r = {status: r.status, message: ''};
|
||||
}
|
||||
}
|
||||
catch (err) {
|
||||
|
@ -698,7 +698,7 @@ function performTests(options, testList, testname, remote) {
|
|||
continue;
|
||||
}
|
||||
|
||||
print("\nArangod: Trying",te,"...");
|
||||
print("\narangod: Trying",te,"...");
|
||||
var r;
|
||||
if (remote) {
|
||||
r = runThere(options, instanceInfo, te);
|
||||
|
@ -755,7 +755,7 @@ testFuncs.single_server = function (options) {
|
|||
if (options.test !== undefined) {
|
||||
var instanceInfo = startInstance("tcp", options, [], "single_server");
|
||||
var te = options.test;
|
||||
print("\nArangod: Trying",te,"...");
|
||||
print("\narangod: Trying",te,"...");
|
||||
result = {};
|
||||
result[te] = runThere(options, instanceInfo, makePath(te));
|
||||
print("Shutting down...");
|
||||
|
@ -774,7 +774,7 @@ testFuncs.single_client = function (options) {
|
|||
if (options.test !== undefined) {
|
||||
var instanceInfo = startInstance("tcp", options, [], "single_client");
|
||||
var te = options.test;
|
||||
print("\nArangoSH: Trying ",te,"...");
|
||||
print("\narangosh: Trying ",te,"...");
|
||||
result[te] = runInArangosh(options, instanceInfo, te);
|
||||
print("Shutting down...");
|
||||
shutdownInstance(instanceInfo,options);
|
||||
|
@ -893,7 +893,7 @@ testFuncs.shell_client = function(options) {
|
|||
continue;
|
||||
}
|
||||
|
||||
print("\nArangoSH: Trying",te,"...");
|
||||
print("\narangosh: Trying",te,"...");
|
||||
|
||||
var r = runInArangosh(options, instanceInfo, te);
|
||||
results[te] = r;
|
||||
|
|
|
@ -453,7 +453,7 @@ function ahuacatlQueryOptimiserLimitTestSuite () {
|
|||
assertEqual(23, actual[0].value);
|
||||
assertEqual(24, actual[1].value);
|
||||
|
||||
assertEqual([ "SingletonNode", "ScatterNode", "RemoteNode", "EnumerateCollectionNode", "RemoteNode", "GatherNode", "CalculationNode", "FilterNode", "LimitNode", "CalculationNode", "SortNode", "ReturnNode" ], explain(query));
|
||||
assertEqual([ "SingletonNode", "ScatterNode", "RemoteNode", "IndexRangeNode", "RemoteNode", "GatherNode", "CalculationNode", "FilterNode", "LimitNode", "CalculationNode", "SortNode", "ReturnNode" ], explain(query));
|
||||
},
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -506,7 +506,7 @@ function ahuacatlQueryOptimiserLimitTestSuite () {
|
|||
assertEqual(23, actual[0].value);
|
||||
assertEqual(24, actual[1].value);
|
||||
|
||||
assertEqual([ "SingletonNode", "ScatterNode", "RemoteNode", "EnumerateCollectionNode", "RemoteNode", "GatherNode", "CalculationNode", "FilterNode", "LimitNode", "CalculationNode", "SortNode", "ReturnNode" ], explain(query));
|
||||
assertEqual([ "SingletonNode", "ScatterNode", "RemoteNode", "IndexRangeNode", "RemoteNode", "GatherNode", "CalculationNode", "FilterNode", "LimitNode", "CalculationNode", "SortNode", "ReturnNode" ], explain(query));
|
||||
},
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -634,11 +634,8 @@ function DocumentationAndConstraintsSpec () {
|
|||
assertEqual(routes[0].docs.parameters[0].name, "a");
|
||||
assertEqual(routes[0].docs.parameters[0].description, "The value of an a");
|
||||
assertEqual(routes[0].docs.parameters[0].dataType, "integer");
|
||||
print(0)
|
||||
assertEqual(routes[0].docs.parameters[0].required, true);
|
||||
print(1)
|
||||
assertEqual(routes[0].docs.parameters[0].allowMultiple, true);
|
||||
print(2)
|
||||
assertEqual(routes[0].docs.parameters[0].required, true, "param required not equal?");
|
||||
assertEqual(routes[0].docs.parameters[0].allowMultiple, true, "allows multiple parameters?");
|
||||
assertEqual(context.constraints.queryParams, {
|
||||
a: constraint
|
||||
.description("The value of an a")
|
||||
|
|
|
@ -1724,7 +1724,7 @@ YY_BUFFER_STATE tri_jsp__scan_bytes (yyconst char * yybytes, yy_size_t _yybyte
|
|||
if ( ! buf )
|
||||
YY_FATAL_ERROR( "out of dynamic memory in tri_jsp__scan_bytes()" );
|
||||
|
||||
for ( i = 0; i < (int) _yybytes_len; ++i )
|
||||
for ( i = 0; i < _yybytes_len; ++i )
|
||||
buf[i] = yybytes[i];
|
||||
|
||||
buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
|
||||
|
|
|
@ -1701,7 +1701,7 @@ YY_BUFFER_STATE tri_v8__scan_bytes (yyconst char * yybytes, yy_size_t _yybytes
|
|||
if ( ! buf )
|
||||
YY_FATAL_ERROR( "out of dynamic memory in tri_v8__scan_bytes()" );
|
||||
|
||||
for ( i = 0; i < (int) _yybytes_len; ++i )
|
||||
for ( i = 0; i < _yybytes_len; ++i )
|
||||
buf[i] = yybytes[i];
|
||||
|
||||
buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
|
||||
|
|
|
@ -26,8 +26,6 @@ test -f ${OUTPUT} || exit 1
|
|||
#############################################################################
|
||||
|
||||
cat ${OUTPUT} \
|
||||
| sed -e 's:( i = 0; i < _yybytes_len;:( i = 0; i < (int) _yybytes_len;:' \
|
||||
| sed -e 's:( yyl = 0; yyl < yyleng; ++yyl ):( yyl = 0; yyl < (int) yyleng; ++yyl ):' \
|
||||
| sed -e 's:yy_n_chars, (size_t) num_to_read );:yy_n_chars, (int) num_to_read );:' \
|
||||
| sed -e 's:register ::g' \
|
||||
> ${OUTPUT}.tmp
|
||||
|
|
|
@ -27,8 +27,6 @@ test -f ${OUTPUT} || exit 1
|
|||
|
||||
cat ${OUTPUT} \
|
||||
| sed -e 's:yy_n_chars, (size_t) num_to_read );:yy_n_chars, (int) num_to_read );:' \
|
||||
| sed -e 's:i = 0; i < _yybytes_len; :i = 0; i < (int) _yybytes_len; :' \
|
||||
| sed -e 's:yyl = 0; yyl < yyleng; :yyl = 0; yyl < (int) yyleng; :' \
|
||||
| awk '$0 == "extern int isatty (int );" {print "#ifndef _WIN32"; print $0; print "#endif"; next;} {print $0}' \
|
||||
> ${OUTPUT}.tmp
|
||||
|
||||
|
|
Loading…
Reference in New Issue