1
0
Fork 0

return old or new values in data-modification operations

This commit is contained in:
Jan Steemann 2015-01-08 16:35:54 +01:00
parent 61819cd420
commit f2590881f1
9 changed files with 291 additions and 195 deletions

View File

@ -3531,15 +3531,16 @@ AqlItemBlock* RemoveBlock::work (std::vector<AqlItemBlock*>& blocks) {
RegisterId const registerId = it->second.registerId;
size_t removeCount = 0;
TRI_doc_mptr_copy_t nptr;
auto trxCollection = _trx->trxCollection(_collection->cid());
if (ep->_outVariable != nullptr) {
size_t count = 0;
for (auto it = blocks.begin(); it != blocks.end(); ++it) {
auto res = (*it);
count += res->size();
count += (*it)->size();
}
if (count > 0) {
result = new AqlItemBlock(count,// * _outReg,<- currently 0
getPlanNode()->getRegisterPlan()->nrRegs[getPlanNode()->getDepth()]);
@ -3556,7 +3557,6 @@ AqlItemBlock* RemoveBlock::work (std::vector<AqlItemBlock*>& blocks) {
// loop over the complete block
for (size_t i = 0; i < n; ++i) {
TRI_doc_mptr_copy_t nptr;
AqlValue a = res->getValue(i, registerId);
std::string key;
@ -3574,8 +3574,8 @@ AqlItemBlock* RemoveBlock::work (std::vector<AqlItemBlock*>& blocks) {
errorCode = TRI_ERROR_ARANGO_DOCUMENT_TYPE_INVALID;
}
if ((errorCode == TRI_ERROR_NO_ERROR) &&
(result != nullptr)) {
if (errorCode == TRI_ERROR_NO_ERROR &&
result != nullptr) {
errorCode = _trx->readSingle(trxCollection, &nptr, key);
}
@ -3590,8 +3590,8 @@ AqlItemBlock* RemoveBlock::work (std::vector<AqlItemBlock*>& blocks) {
0,
nullptr,
ep->_options.waitForSync);
if (ExecutionEngine::isDBServer() &&
errorCode == TRI_ERROR_ARANGO_DOCUMENT_NOT_FOUND) {
if (errorCode == TRI_ERROR_ARANGO_DOCUMENT_NOT_FOUND &&
ExecutionEngine::isDBServer()) {
auto* node = static_cast<RemoveNode const*>(getPlanNode());
if (node->getOptions().ignoreDocumentNotFound) {
// Ignore document not found on the DBserver:
@ -3599,8 +3599,8 @@ AqlItemBlock* RemoveBlock::work (std::vector<AqlItemBlock*>& blocks) {
}
}
if ((result != nullptr) &&
(errorCode == TRI_ERROR_NO_ERROR)) {
if (result != nullptr &&
errorCode == TRI_ERROR_NO_ERROR) {
result->setValue(removeCount++,
_outReg,
@ -3644,6 +3644,7 @@ AqlItemBlock* InsertBlock::work (std::vector<AqlItemBlock*>& blocks) {
auto trxCollection = _trx->trxCollection(_collection->cid());
TRI_doc_mptr_copy_t nptr;
bool const isEdgeCollection = _collection->isEdgeCollection();
size_t insertCount = 0;
@ -3663,11 +3664,11 @@ AqlItemBlock* InsertBlock::work (std::vector<AqlItemBlock*>& blocks) {
size_t count = 0;
for (auto it = blocks.begin(); it != blocks.end(); ++it) {
auto res = (*it);
count += res->size();
count += (*it)->size();
}
if (count > 0) {
result = new AqlItemBlock(count, // * _outReg, <- 0
result = new AqlItemBlock(count,
getPlanNode()->getRegisterPlan()->nrRegs[getPlanNode()->getDepth()]);
result->setDocumentCollection(_outReg, trxCollection->_collection->_collection);
}
@ -3732,11 +3733,11 @@ AqlItemBlock* InsertBlock::work (std::vector<AqlItemBlock*>& blocks) {
// document
errorCode = _trx->create(trxCollection, &mptr, json.json(), nullptr, ep->_options.waitForSync);
}
if ((errorCode == TRI_ERROR_NO_ERROR) &&
(result != nullptr)) {
TRI_doc_mptr_copy_t nptr;
if (errorCode == TRI_ERROR_NO_ERROR &&
result != nullptr) {
errorCode = _trx->readSingle(trxCollection, &nptr, TRI_EXTRACT_MARKER_KEY(&mptr));
if (errorCode == TRI_ERROR_NO_ERROR) {
result->setValue(insertCount++,
_outReg,
@ -3781,6 +3782,7 @@ AqlItemBlock* UpdateBlock::work (std::vector<AqlItemBlock*>& blocks) {
RegisterId const docRegisterId = it->second.registerId;
RegisterId keyRegisterId = 0; // default initialization
TRI_doc_mptr_copy_t nptr;
bool const hasKeyVariable = (ep->_inKeyVariable != nullptr);
std::string errorMessage;
size_t updateCount = 0;
@ -3797,11 +3799,10 @@ AqlItemBlock* UpdateBlock::work (std::vector<AqlItemBlock*>& blocks) {
size_t count = 0;
for (auto it = blocks.begin(); it != blocks.end(); ++it) {
auto res = (*it);
count += res->size();
count += (*it)->size();
}
if (count > 0) {
result = new AqlItemBlock(count, // * _outReg,
result = new AqlItemBlock(count,
getPlanNode()->getRegisterPlan()->nrRegs[getPlanNode()->getDepth()]);
result->setDocumentCollection(_outReg, trxCollection->_collection->_collection);
}
@ -3881,26 +3882,33 @@ AqlItemBlock* UpdateBlock::work (std::vector<AqlItemBlock*>& blocks) {
errorCode = TRI_ERROR_ARANGO_DOCUMENT_NOT_FOUND;
}
}
if ((errorCode == TRI_ERROR_NO_ERROR) &&
(result != nullptr)) {
if (errorCode == TRI_ERROR_NO_ERROR &&
result != nullptr) {
TRI_doc_mptr_copy_t const* ptr = nullptr;
if (ep->_returnNewValues) {
TRI_doc_mptr_copy_t nptr;
errorCode = _trx->readSingle(trxCollection, &nptr, TRI_EXTRACT_MARKER_KEY(&mptr));
if (errorCode == TRI_ERROR_NO_ERROR) {
result->setValue(updateCount++,
_outReg,
AqlValue(reinterpret_cast<TRI_df_marker_t const*>(nptr.getDataPtr())));
ptr = &nptr;
}
}
else {
ptr = &oldDocument;
}
if (errorCode == TRI_ERROR_NO_ERROR) {
TRI_ASSERT(ptr != nullptr);
result->setValue(updateCount++,
_outReg,
AqlValue(reinterpret_cast<TRI_df_marker_t
const*>(oldDocument.getDataPtr())));
AqlValue(reinterpret_cast<TRI_df_marker_t const*>(ptr->getDataPtr())));
}
}
if (ExecutionEngine::isDBServer() &&
errorCode == TRI_ERROR_ARANGO_DOCUMENT_NOT_FOUND) {
if (errorCode == TRI_ERROR_ARANGO_DOCUMENT_NOT_FOUND &&
ExecutionEngine::isDBServer()) {
auto* node = static_cast<UpdateNode const*>(getPlanNode());
if (node->getOptions().ignoreDocumentNotFound) {
// Ignore document not found on the DBserver:
@ -3962,11 +3970,10 @@ AqlItemBlock* ReplaceBlock::work (std::vector<AqlItemBlock*>& blocks) {
size_t count = 0;
for (auto it = blocks.begin(); it != blocks.end(); ++it) {
auto res = (*it);
count += res->size();
count += (*it)->size();
}
if (count > 0) {
result = new AqlItemBlock(count, // * _outReg,
result = new AqlItemBlock(count,
getPlanNode()->getRegisterPlan()->nrRegs[getPlanNode()->getDepth()]);
result->setDocumentCollection(_outReg, trxCollection->_collection->_collection);
}
@ -4007,7 +4014,7 @@ AqlItemBlock* ReplaceBlock::work (std::vector<AqlItemBlock*>& blocks) {
errorCode = TRI_ERROR_ARANGO_DOCUMENT_TYPE_INVALID;
}
if ((result != nullptr) && !ep->_returnNewValues) {
if (result != nullptr && ! ep->_returnNewValues) {
readErrorCode = _trx->readSingle(trxCollection, &nptr, key);
}
@ -4017,8 +4024,7 @@ AqlItemBlock* ReplaceBlock::work (std::vector<AqlItemBlock*>& blocks) {
// all exceptions are caught in _trx->update()
errorCode = _trx->update(trxCollection, key, 0, &mptr, json.json(), TRI_DOC_UPDATE_LAST_WRITE, 0, nullptr, ep->_options.waitForSync);
if (ExecutionEngine::isDBServer() &&
errorCode == TRI_ERROR_ARANGO_DOCUMENT_NOT_FOUND) {
if (errorCode == TRI_ERROR_ARANGO_DOCUMENT_NOT_FOUND && ExecutionEngine::isDBServer()) {
auto* node = static_cast<ReplaceNode const*>(getPlanNode());
if (node->getOptions().ignoreDocumentNotFound) {
errorCode = TRI_ERROR_NO_ERROR;
@ -4028,26 +4034,19 @@ AqlItemBlock* ReplaceBlock::work (std::vector<AqlItemBlock*>& blocks) {
}
}
if ((result != nullptr) &&
(errorCode == TRI_ERROR_NO_ERROR) &&
(readErrorCode == TRI_ERROR_NO_ERROR)) {
if (result != nullptr &&
errorCode == TRI_ERROR_NO_ERROR &&
readErrorCode == TRI_ERROR_NO_ERROR) {
if (ep->_returnNewValues) {
readErrorCode = _trx->readSingle(trxCollection, &nptr, key);
if (readErrorCode == TRI_ERROR_NO_ERROR) {
result->setValue(replaceCounter++,
_outReg,
AqlValue(reinterpret_cast<TRI_df_marker_t const*>(nptr.getDataPtr())));
}
}
else {
if (readErrorCode == TRI_ERROR_NO_ERROR) {
result->setValue(replaceCounter++,
_outReg,
AqlValue(reinterpret_cast<TRI_df_marker_t const*>(nptr.getDataPtr())));
}
}
}

View File

@ -2537,7 +2537,6 @@ ExecutionNode* UpdateNode::clone (ExecutionPlan* plan,
return static_cast<ExecutionNode*>(c);
}
// -----------------------------------------------------------------------------
// --SECTION-- methods of ReplaceNode
// -----------------------------------------------------------------------------

View File

@ -2559,7 +2559,7 @@ namespace triagens {
: ModificationNode(plan, id, vocbase, collection, options, outVariable),
_inDocVariable(inDocVariable),
_inKeyVariable(inKeyVariable),
_returnNewValues(returnNewValues){
_returnNewValues(returnNewValues) {
TRI_ASSERT(_inDocVariable != nullptr);
// _inKeyVariable might be a nullptr
@ -2675,7 +2675,8 @@ namespace triagens {
bool returnNewValues)
: ModificationNode(plan, id, vocbase, collection, options, outVariable),
_inDocVariable(inDocVariable),
_inKeyVariable(inKeyVariable) {
_inKeyVariable(inKeyVariable),
_returnNewValues(returnNewValues) {
TRI_ASSERT(_inDocVariable != nullptr);
// _inKeyVariable might be a nullptr

View File

@ -103,46 +103,43 @@ bool Parser::configureWriteQuery (QueryType type,
_type = type;
switch(_type) {
case AQL_QUERY_READ:
break;
case AQL_QUERY_REMOVE:
if (newOld != nullptr) {
if (!TRI_CaseEqualString(newOld, "OLD")) {
_query->registerError(TRI_ERROR_QUERY_PARSE, "OLD expected");
return false;
case AQL_QUERY_READ:
break;
case AQL_QUERY_REMOVE:
if (newOld != nullptr) {
if (! TRI_CaseEqualString(newOld, "OLD")) {
_query->registerError(TRI_ERROR_QUERY_PARSE, "OLD expected");
return false;
}
}
if (!TRI_CaseEqualString(varInto, varReturn)) {
_query->registerError(TRI_ERROR_QUERY_PARSE, "WITH thisVariable RETURN thisVariable expected.");
return false;
break;
case AQL_QUERY_INSERT:
if (newOld != nullptr) {
if (! TRI_CaseEqualString(newOld, "NEW")) {
_query->registerError(TRI_ERROR_QUERY_PARSE, "NEW expected");
return false;
}
}
break;
case AQL_QUERY_UPDATE:
case AQL_QUERY_REPLACE:
if (newOld != nullptr) {
if (! TRI_CaseEqualString(newOld, "OLD") && ! TRI_CaseEqualString(newOld, "NEW")) {
_query->registerError(TRI_ERROR_QUERY_PARSE, "NEW or OLD expected");
return false;
}
}
break;
}
if (varInto != nullptr && varReturn != nullptr) {
if (! TRI_CaseEqualString(varInto, varReturn)) {
_query->registerError(TRI_ERROR_QUERY_PARSE, "invalid variable used in data-modification operation");
return false;
}
break;
case AQL_QUERY_INSERT:
if (newOld != nullptr) {
if (!TRI_CaseEqualString(newOld, "NEW")) {
_query->registerError(TRI_ERROR_QUERY_PARSE, "NEW expected");
return false;
}
if (!TRI_CaseEqualString(varInto, varReturn)) {
_query->registerError(TRI_ERROR_QUERY_PARSE, "WITH thisVariable RETURN thisVariable expected.");
return false;
}
}
break;
case AQL_QUERY_UPDATE:
case AQL_QUERY_REPLACE:
if (newOld != nullptr) {
if (!TRI_CaseEqualString(newOld, "OLD") && !TRI_CaseEqualString(newOld, "NEW")) {
_query->registerError(TRI_ERROR_QUERY_PARSE, "NEW|OLD expected");
return false;
}
if (!TRI_CaseEqualString(varInto, varReturn)) {
_query->registerError(TRI_ERROR_QUERY_PARSE, "WITH thisVariable RETURN thisVariable expected.");
return false;
}
}
break;
}
return true;

View File

@ -110,7 +110,7 @@ extern int Aqldebug;
typedef union YYSTYPE YYSTYPE;
union YYSTYPE
{
#line 22 "arangod/Aql/grammar.y" /* yacc.c:1909 */
#line 21 "arangod/Aql/grammar.y" /* yacc.c:1909 */
triagens::aql::AstNode* node;
char* strval;

View File

@ -1,4 +1,3 @@
%define lr.type ielr
%define api.pure
%name-prefix "Aql"
%locations
@ -129,6 +128,8 @@ void Aqlerror (YYLTYPE* locp,
%left T_COMMA
%right T_QUESTION T_COLON
%right T_ASSIGN
%left T_WITH
%nonassoc T_INTO
%left T_OR
%left T_AND
%left T_EQ T_NE
@ -549,11 +550,11 @@ remove_statement:
parser->ast()->addOperation(node);
parser->ast()->scopes()->endNested();
}
| T_REMOVE expression in_or_into_collection query_options T_WITH T_STRING T_INTO variable_name T_RETURN variable_name {
if (! parser->configureWriteQuery(AQL_QUERY_REMOVE, $3, $4, $6, $8, $10)) {
| T_REMOVE expression in_or_into_collection query_options T_LET variable_name T_ASSIGN T_STRING T_RETURN variable_name {
if (! parser->configureWriteQuery(AQL_QUERY_REMOVE, $3, $4, $8, $6, $10)) {
YYABORT;
}
auto node = parser->ast()->createNodeRemove($2, $3, $4, $6, $8, $10);
auto node = parser->ast()->createNodeRemove($2, $3, $4, $8, $6, $10);
parser->ast()->addOperation(node);
parser->ast()->scopes()->endNested();
}
@ -568,15 +569,14 @@ insert_statement:
parser->ast()->addOperation(node);
parser->ast()->scopes()->endNested();
}
| T_INSERT expression in_or_into_collection query_options T_WITH T_STRING T_INTO variable_name T_RETURN variable_name {
if (! parser->configureWriteQuery(AQL_QUERY_INSERT, $3, $4, $6, $8, $10)) {
| T_INSERT expression in_or_into_collection query_options T_LET variable_name T_ASSIGN T_STRING T_RETURN variable_name {
if (! parser->configureWriteQuery(AQL_QUERY_INSERT, $3, $4, $8, $6, $10)) {
YYABORT;
}
auto node = parser->ast()->createNodeInsert($2, $3, $4, $6, $8, $10);
auto node = parser->ast()->createNodeInsert($2, $3, $4, $8, $6, $10);
parser->ast()->addOperation(node);
parser->ast()->scopes()->endNested();
}
;
update_statement:
@ -596,19 +596,19 @@ update_statement:
parser->ast()->addOperation(node);
parser->ast()->scopes()->endNested();
}
| T_UPDATE expression in_or_into_collection query_options T_WITH T_STRING T_INTO variable_name T_RETURN variable_name {
if (! parser->configureWriteQuery(AQL_QUERY_UPDATE, $3, $4, $6, $8, $10)) {
| T_UPDATE expression in_or_into_collection query_options T_LET variable_name T_ASSIGN T_STRING T_RETURN variable_name {
if (! parser->configureWriteQuery(AQL_QUERY_UPDATE, $3, $4, $8, $6, $10)) {
YYABORT;
}
auto node = parser->ast()->createNodeUpdate(nullptr, $2, $3, $4, $6, $8, $10);
auto node = parser->ast()->createNodeUpdate(nullptr, $2, $3, $4, $8, $6, $10);
parser->ast()->addOperation(node);
parser->ast()->scopes()->endNested();
}
| T_UPDATE expression T_WITH expression in_or_into_collection query_options T_WITH T_STRING T_INTO variable_name T_RETURN variable_name {
if (! parser->configureWriteQuery(AQL_QUERY_UPDATE, $5, $6, $8, $10, $12)) {
| T_UPDATE expression T_WITH expression in_or_into_collection query_options T_LET variable_name T_ASSIGN T_STRING T_RETURN variable_name {
if (! parser->configureWriteQuery(AQL_QUERY_UPDATE, $5, $6, $10, $8, $12)) {
YYABORT;
}
auto node = parser->ast()->createNodeUpdate($2, $4, $5, $6, $8, $10, $12);
auto node = parser->ast()->createNodeUpdate($2, $4, $5, $6, $10, $8, $12);
parser->ast()->addOperation(node);
parser->ast()->scopes()->endNested();
}
@ -631,19 +631,19 @@ replace_statement:
parser->ast()->addOperation(node);
parser->ast()->scopes()->endNested();
}
| T_REPLACE expression in_or_into_collection query_options T_WITH T_STRING T_INTO variable_name T_RETURN variable_name {
if (! parser->configureWriteQuery(AQL_QUERY_REPLACE, $3, $4)) {
| T_REPLACE expression in_or_into_collection query_options T_LET variable_name T_ASSIGN T_STRING T_RETURN variable_name {
if (! parser->configureWriteQuery(AQL_QUERY_REPLACE, $3, $4, $8, $6, $10)) {
YYABORT;
}
auto node = parser->ast()->createNodeReplace(nullptr, $2, $3, $4);
auto node = parser->ast()->createNodeReplace(nullptr, $2, $3, $4, $8, $6, $10);
parser->ast()->addOperation(node);
parser->ast()->scopes()->endNested();
}
| T_REPLACE expression T_WITH expression in_or_into_collection query_options T_WITH T_STRING T_INTO variable_name T_RETURN variable_name {
if (! parser->configureWriteQuery(AQL_QUERY_REPLACE, $5, $6, $8, $10, $12)) {
| T_REPLACE expression T_WITH expression in_or_into_collection query_options T_LET variable_name T_ASSIGN T_STRING T_RETURN variable_name {
if (! parser->configureWriteQuery(AQL_QUERY_REPLACE, $5, $6, $10, $8, $12)) {
YYABORT;
}
auto node = parser->ast()->createNodeReplace($2, $4, $5, $6, $8, $10, $12);
auto node = parser->ast()->createNodeReplace($2, $4, $5, $6, $10, $8, $12);
parser->ast()->addOperation(node);
parser->ast()->scopes()->endNested();
}

View File

@ -1,5 +1,5 @@
/*jshint strict: false, sub: true, maxlen: 500 */
/*global require, assertEqual, assertFalse, assertNull assertTrue */
/*global require, assertEqual, assertFalse, assertNull, assertTrue, fail */
////////////////////////////////////////////////////////////////////////////////
/// @brief tests for query language, bind parameters
@ -47,10 +47,10 @@ var sanitizeStats = function (stats) {
return stats;
};
////////////////////////////////////////////////////////////////////////////////
/// @brief
////////////////////////////////////////////////////////////////////////////////
var validateDocuments = function (documents, isEdgeCollection) {
var index;
for (index in documents) {
@ -66,10 +66,10 @@ var validateDocuments = function (documents, isEdgeCollection) {
}
};
////////////////////////////////////////////////////////////////////////////////
/// @brief check whether the documents inserted are equal on the db.
////////////////////////////////////////////////////////////////////////////////
var validateModifyResultInsert = function (collection, results) {
var index;
for (index in results) {
@ -82,6 +82,7 @@ var validateModifyResultInsert = function (collection, results) {
////////////////////////////////////////////////////////////////////////////////
/// @brief check whether the documents reported deleted are really gone
////////////////////////////////////////////////////////////////////////////////
var validateDeleteGone = function (collection, results) {
var index;
for (index in results) {
@ -102,6 +103,7 @@ var validateDeleteGone = function (collection, results) {
/// @brief convert flat document database to an associative array with the keys
/// as object
////////////////////////////////////////////////////////////////////////////////
var wrapToKeys = function (results) {
var keyArray = {};
var index;
@ -111,7 +113,7 @@ var wrapToKeys = function (results) {
}
}
return keyArray;
}
};
////////////////////////////////////////////////////////////////////////////////
/// @brief test suite
@ -231,33 +233,43 @@ function ahuacatlModifySuite () {
},
////////////////////////////////////////////////////////////////////////////////
/// @brief test remove
/// @brief test usage of OLD
////////////////////////////////////////////////////////////////////////////////
testInvalidNEW : function () {
assertQueryError(errors.ERROR_QUERY_PARSE.code, "REMOVE 'abc' IN @@cn WITH NEW INTO removed RETURN removed", { "@cn": cn1 });
testInvalidUsageOfNew : function () {
assertQueryError(errors.ERROR_QUERY_PARSE.code, "REMOVE 'abc' IN @@cn LET removed = NEW RETURN removed", { "@cn": cn1 });
},
////////////////////////////////////////////////////////////////////////////////
/// @brief test remove
/// @brief test usage of NEW
////////////////////////////////////////////////////////////////////////////////
testInvalidVariableNames : function () {
assertQueryError(errors.ERROR_QUERY_PARSE.code, "REMOVE 'abc' IN @@cn WITH OLD INTO removed1 RETURN removed2", { "@cn": cn1 });
testInvalidUsageOfOld : function () {
assertQueryError(errors.ERROR_QUERY_PARSE.code, "INSERT { } IN @@cn LET inserted = OLD RETURN inserted", { "@cn": cn1 });
},
////////////////////////////////////////////////////////////////////////////////
/// @brief test remove
/// @brief test variable names
////////////////////////////////////////////////////////////////////////////////
testInvalidIN : function () {
assertQueryError(errors.ERROR_QUERY_PARSE.code, "REMOVE 'abc' IN @@cn WITH OLD IN removed RETURN removed", { "@cn": cn1 });
testInvalidVariableNames1 : function () {
assertQueryError(errors.ERROR_QUERY_PARSE.code, "REMOVE 'abc' IN @@cn LET removed1 = OLD RETURN removed2", { "@cn": cn1 });
},
////////////////////////////////////////////////////////////////////////////////
/// @brief test variable names
////////////////////////////////////////////////////////////////////////////////
testInvalidVariableNames2 : function () {
assertQueryError(errors.ERROR_QUERY_PARSE.code, "UPDATE 'abc' WITH { } IN @@cn LET updated = NEW RETURN foo", { "@cn": cn1 });
}
};
}
////////////////////////////////////////////////////////////////////////////////
/// @brief test suite
////////////////////////////////////////////////////////////////////////////////
var PY = function (plan) { require("internal").print(require("js-yaml").safeDump(plan));};
function ahuacatlRemoveSuite () {
var errors = internal.errors;
@ -316,7 +328,7 @@ function ahuacatlRemoveSuite () {
testRemoveNothingWhat : function () {
var expected = { writesExecuted: 0, writesIgnored: 0 };
var actual = getModifyQueryResults("FOR d IN " + cn1 + " FILTER d.value1 < 0 REMOVE d IN " + cn1 + " WITH OLD INTO removed RETURN removed ", {});
var actual = getModifyQueryResults("FOR d IN " + cn1 + " FILTER d.value1 < 0 REMOVE d IN " + cn1 + " LET removed = OLD RETURN removed", {});
assertEqual(100, c1.count());
assertEqual(expected, sanitizeStats(actual));
@ -340,7 +352,7 @@ function ahuacatlRemoveSuite () {
testRemoveNothingBindWhat : function () {
var expected = { writesExecuted: 0, writesIgnored: 0 };
var actual = getModifyQueryResults("FOR d IN @@cn FILTER d.value1 < 0 REMOVE d IN @@cn WITH OLD INTO removed RETURN removed", { "@cn": cn1 });
var actual = getModifyQueryResults("FOR d IN @@cn FILTER d.value1 < 0 REMOVE d IN @@cn LET removed = OLD RETURN removed", { "@cn": cn1 });
assertEqual(100, c1.count());
assertEqual(expected, sanitizeStats(actual));
@ -360,7 +372,7 @@ function ahuacatlRemoveSuite () {
////////////////////////////////////////////////////////////////////////////////
testRemoveInvalid1What : function () {
assertQueryError(errors.ERROR_ARANGO_DOCUMENT_TYPE_INVALID.code, "FOR d IN @@cn REMOVE d.foobar IN @@cn WITH OLD INTO removed RETURN removed", { "@cn": cn1 });
assertQueryError(errors.ERROR_ARANGO_DOCUMENT_TYPE_INVALID.code, "FOR d IN @@cn REMOVE d.foobar IN @@cn LET removed = OLD RETURN removed", { "@cn": cn1 });
assertEqual(100, c1.count());
},
@ -415,7 +427,7 @@ function ahuacatlRemoveSuite () {
testRemoveIgnore1What : function () {
var expected = { writesExecuted: 0, writesIgnored: 100 };
var actual = getModifyQueryResults("FOR d IN @@cn REMOVE 'foo' IN @@cn OPTIONS { ignoreErrors: true } WITH OLD INTO removed RETURN removed", { "@cn": cn1 });
var actual = getModifyQueryResults("FOR d IN @@cn REMOVE 'foo' IN @@cn OPTIONS { ignoreErrors: true } LET removed = OLD RETURN removed", { "@cn": cn1 });
assertEqual(100, c1.count());
assertEqual(expected, sanitizeStats(actual));
@ -439,7 +451,7 @@ function ahuacatlRemoveSuite () {
testRemoveIgnore2What : function () {
var expected = { writesExecuted: 100, writesIgnored: 101 };
var actual = getModifyQueryResultsRaw("FOR i IN 0..200 REMOVE CONCAT('test', TO_STRING(i)) IN @@cn OPTIONS { ignoreErrors: true } WITH OLD INTO removed RETURN removed", { "@cn": cn1 });
var actual = getModifyQueryResultsRaw("FOR i IN 0..200 REMOVE CONCAT('test', TO_STRING(i)) IN @@cn OPTIONS { ignoreErrors: true } LET removed = OLD RETURN removed ", { "@cn": cn1 });
validateDocuments(actual.json, false);
validateDeleteGone(c1, actual.json);
@ -466,7 +478,7 @@ function ahuacatlRemoveSuite () {
testRemoveAll1What : function () {
var expected = { writesExecuted: 100, writesIgnored: 0 };
var actual = getModifyQueryResultsRaw("FOR d IN @@cn REMOVE d IN @@cn WITH OLD INTO removed RETURN removed", { "@cn": cn1 });
var actual = getModifyQueryResultsRaw("FOR d IN @@cn REMOVE d IN @@cn LET removed = OLD RETURN removed", { "@cn": cn1 });
validateDocuments(actual.json, false);
validateDeleteGone(c1, actual.json);
@ -493,7 +505,7 @@ function ahuacatlRemoveSuite () {
testRemoveAll2What : function () {
var expected = { writesExecuted: 100, writesIgnored: 0 };
var actual = getModifyQueryResultsRaw("FOR d IN @@cn REMOVE d._key IN @@cn WITH OLD INTO removed RETURN removed", { "@cn": cn1 });
var actual = getModifyQueryResultsRaw("FOR d IN @@cn REMOVE d._key IN @@cn LET removed = OLD RETURN removed", { "@cn": cn1 });
validateDocuments(actual.json, false);
validateDeleteGone(c1, actual.json);
@ -520,7 +532,7 @@ function ahuacatlRemoveSuite () {
testRemoveAll3What : function () {
var expected = { writesExecuted: 100, writesIgnored: 0 };
var actual = getModifyQueryResultsRaw("FOR d IN @@cn REMOVE { _key: d._key } IN @@cn WITH OLD INTO removed RETURN removed", { "@cn": cn1 });
var actual = getModifyQueryResultsRaw("FOR d IN @@cn REMOVE { _key: d._key } IN @@cn LET removed = OLD RETURN removed", { "@cn": cn1 });
validateDocuments(actual.json, false);
validateDeleteGone(c1, actual.json);
@ -547,7 +559,7 @@ function ahuacatlRemoveSuite () {
testRemoveAll4What : function () {
var expected = { writesExecuted: 100, writesIgnored: 0 };
var actual = getModifyQueryResultsRaw("FOR i IN 0..99 REMOVE { _key: CONCAT('test', TO_STRING(i)) } IN @@cn WITH OLD INTO removed RETURN removed", { "@cn": cn1 });
var actual = getModifyQueryResultsRaw("FOR i IN 0..99 REMOVE { _key: CONCAT('test', TO_STRING(i)) } IN @@cn LET removed = OLD RETURN removed", { "@cn": cn1 });
validateDocuments(actual.json, false);
validateDeleteGone(c1, actual.json);
@ -574,7 +586,7 @@ function ahuacatlRemoveSuite () {
testRemoveAll5What : function () {
var expected = { writesExecuted: 100, writesIgnored: 0 };
var actual = getModifyQueryResultsRaw("FOR d IN @@cn REMOVE d INTO @@cn WITH OLD INTO removed RETURN removed", { "@cn": cn1 });
var actual = getModifyQueryResultsRaw("FOR d IN @@cn REMOVE d INTO @@cn LET removed = OLD RETURN removed", { "@cn": cn1 });
validateDocuments(actual.json, false);
validateDeleteGone(c1, actual.json);
@ -601,7 +613,7 @@ function ahuacatlRemoveSuite () {
testRemoveHalfWhat : function () {
var expected = { writesExecuted: 50, writesIgnored: 0 };
var actual = getModifyQueryResultsRaw("FOR i IN 0..99 FILTER i % 2 == 0 REMOVE { _key: CONCAT('test', TO_STRING(i)) } IN @@cn WITH OLD INTO removed RETURN removed", { "@cn": cn1 });
var actual = getModifyQueryResultsRaw("FOR i IN 0..99 FILTER i % 2 == 0 REMOVE { _key: CONCAT('test', TO_STRING(i)) } IN @@cn LET removed = OLD RETURN removed", { "@cn": cn1 });
validateDocuments(actual.json, false);
validateDeleteGone(c1, actual.json);
@ -623,7 +635,7 @@ function ahuacatlRemoveSuite () {
////////////////////////////////////////////////////////////////////////////////
testSingleNotFoundWhat : function () {
assertQueryError(errors.ERROR_ARANGO_DOCUMENT_NOT_FOUND.code, "REMOVE 'foobar' IN @@cn WITH OLD INTO removed RETURN removed", { "@cn": cn1 });
assertQueryError(errors.ERROR_ARANGO_DOCUMENT_NOT_FOUND.code, "REMOVE 'foobar' IN @@cn LET removed = OLD RETURN removed", { "@cn": cn1 });
},
////////////////////////////////////////////////////////////////////////////////
@ -644,7 +656,7 @@ function ahuacatlRemoveSuite () {
testSingleWhat : function () {
var expected = { writesExecuted: 1, writesIgnored: 0 };
var actual = getModifyQueryResultsRaw("REMOVE 'test0' IN @@cn WITH OLD INTO removed RETURN removed", { "@cn": cn1 });
var actual = getModifyQueryResultsRaw("REMOVE 'test0' IN @@cn LET removed = OLD RETURN removed", { "@cn": cn1 });
validateDocuments(actual.json, false);
validateDeleteGone(c1, actual.json);
@ -669,7 +681,7 @@ function ahuacatlRemoveSuite () {
////////////////////////////////////////////////////////////////////////////////
testTwoCollectionsNotFoundWhat : function () {
assertQueryError(errors.ERROR_ARANGO_DOCUMENT_NOT_FOUND.code, "FOR d IN @@cn1 REMOVE { _key: d._key } IN @@cn2 WITH OLD INTO removed RETURN removed", { "@cn1": cn1, "@cn2": cn2 });
assertQueryError(errors.ERROR_ARANGO_DOCUMENT_NOT_FOUND.code, "FOR d IN @@cn1 REMOVE { _key: d._key } IN @@cn2 LET removed = OLD RETURN removed", { "@cn1": cn1, "@cn2": cn2 });
assertEqual(100, c1.count());
assertEqual(50, c2.count());
@ -694,7 +706,7 @@ function ahuacatlRemoveSuite () {
testTwoCollectionsJoin1What : function () {
var expected = { writesExecuted: 50, writesIgnored: 0 };
var actual = getModifyQueryResultsRaw("FOR d IN @@cn1 FILTER d.value1 < 50 REMOVE { _key: d._key } IN @@cn2 WITH OLD INTO removed RETURN removed", { "@cn1": cn1, "@cn2": cn2 });
var actual = getModifyQueryResultsRaw("FOR d IN @@cn1 FILTER d.value1 < 50 REMOVE { _key: d._key } IN @@cn2 LET removed = OLD RETURN removed", { "@cn1": cn1, "@cn2": cn2 });
validateDocuments(actual.json, false);
validateDeleteGone(c2, actual.json);
@ -723,7 +735,7 @@ function ahuacatlRemoveSuite () {
testTwoCollectionsJoin2What : function () {
var expected = { writesExecuted: 48, writesIgnored: 0 };
var actual = getModifyQueryResultsRaw("FOR d IN @@cn1 FILTER d.value1 >= 2 && d.value1 < 50 REMOVE { _key: d._key } IN @@cn2 WITH OLD INTO removed RETURN removed", { "@cn1": cn1, "@cn2": cn2 });
var actual = getModifyQueryResultsRaw("FOR d IN @@cn1 FILTER d.value1 >= 2 && d.value1 < 50 REMOVE { _key: d._key } IN @@cn2 LET removed = OLD RETURN removed", { "@cn1": cn1, "@cn2": cn2 });
validateDocuments(actual.json, false);
validateDeleteGone(c2, actual.json);
@ -752,7 +764,7 @@ function ahuacatlRemoveSuite () {
testTwoCollectionsIgnoreErrors1What : function () {
var expected = { writesExecuted: 50, writesIgnored: 50 };
var actual = getModifyQueryResultsRaw("FOR d IN @@cn1 REMOVE { _key: d._key } IN @@cn2 OPTIONS { ignoreErrors: true } WITH OLD INTO removed RETURN removed", { "@cn1": cn1, "@cn2": cn2 });
var actual = getModifyQueryResultsRaw("FOR d IN @@cn1 REMOVE { _key: d._key } IN @@cn2 OPTIONS { ignoreErrors: true } LET removed = OLD RETURN removed", { "@cn1": cn1, "@cn2": cn2 });
validateDocuments(actual.json, false);
validateDeleteGone(c2, actual.json);
@ -781,7 +793,7 @@ function ahuacatlRemoveSuite () {
testTwoCollectionsIgnoreErrors2What : function () {
var expected = { writesExecuted: 0, writesIgnored: 100 };
var actual = getModifyQueryResultsRaw("FOR d IN @@cn1 REMOVE { _key: CONCAT('foo', d._key) } IN @@cn2 OPTIONS { ignoreErrors: true } WITH OLD INTO removed RETURN removed", { "@cn1": cn1, "@cn2": cn2 });
var actual = getModifyQueryResultsRaw("FOR d IN @@cn1 REMOVE { _key: CONCAT('foo', d._key) } IN @@cn2 OPTIONS { ignoreErrors: true } LET removed = OLD RETURN removed", { "@cn1": cn1, "@cn2": cn2 });
assertEqual(0, actual.json.length);
assertEqual(100, c1.count());
@ -807,7 +819,7 @@ function ahuacatlRemoveSuite () {
testRemoveWaitForSyncWhat : function () {
var expected = { writesExecuted: 100, writesIgnored: 0 };
var actual = getModifyQueryResultsRaw("FOR d IN @@cn REMOVE d IN @@cn OPTIONS { waitForSync: true } WITH OLD INTO removed RETURN removed", { "@cn": cn1 });
var actual = getModifyQueryResultsRaw("FOR d IN @@cn REMOVE d IN @@cn OPTIONS { waitForSync: true } LET removed = OLD RETURN removed", { "@cn": cn1 });
validateDocuments(actual.json, false);
validateDeleteGone(c1, actual.json);
@ -848,7 +860,7 @@ function ahuacatlRemoveSuite () {
edge.save("UnitTestsAhuacatlRemove1/foo" + i, "UnitTestsAhuacatlRemove2/bar", { what: i, _key: "test" + i });
}
var expected = { writesExecuted: 10, writesIgnored: 0 };
var actual = getModifyQueryResultsRaw("FOR i IN 0..9 REMOVE CONCAT('test', TO_STRING(i)) IN @@cn WITH OLD INTO removed RETURN removed", { "@cn": edge.name() });
var actual = getModifyQueryResultsRaw("FOR i IN 0..9 REMOVE CONCAT('test', TO_STRING(i)) IN @@cn LET removed = OLD RETURN removed", { "@cn": edge.name() });
validateDocuments(actual.json, true);
validateDeleteGone(edge, actual.json);
@ -923,7 +935,7 @@ function ahuacatlInsertSuite () {
testInsertNothingWhat : function () {
var expected = { writesExecuted: 0, writesIgnored: 0 };
var actual = getModifyQueryResultsRaw("FOR d IN " + cn1 + " FILTER d.value1 < 0 INSERT { foxx: true } IN " + cn1 + " WITH NEW INTO inserted RETURN inserted", {});
var actual = getModifyQueryResultsRaw("FOR d IN " + cn1 + " FILTER d.value1 < 0 INSERT { foxx: true } IN " + cn1 + " LET inserted = NEW RETURN inserted", {});
assertEqual(0, actual.json.length);
assertEqual(100, c1.count());
@ -948,7 +960,7 @@ function ahuacatlInsertSuite () {
testInsertNothingBindWhat : function () {
var expected = { writesExecuted: 0, writesIgnored: 0 };
var actual = getModifyQueryResultsRaw("FOR d IN @@cn FILTER d.value1 < 0 INSERT { foxx: true } IN @@cn WITH NEW INTO inserted RETURN inserted", { "@cn": cn1 });
var actual = getModifyQueryResultsRaw("FOR d IN @@cn FILTER d.value1 < 0 INSERT { foxx: true } IN @@cn LET inserted = NEW RETURN inserted", { "@cn": cn1 });
assertEqual(0, actual.json.length);
assertEqual(100, c1.count());
@ -969,7 +981,7 @@ function ahuacatlInsertSuite () {
////////////////////////////////////////////////////////////////////////////////
testInsertInvalid1What : function () {
assertQueryError(errors.ERROR_ARANGO_DOCUMENT_TYPE_INVALID.code, "FOR d IN @@cn INSERT d.foobar IN @@cn WITH NEW INTO inserted RETURN inserted", { "@cn": cn1 });
assertQueryError(errors.ERROR_ARANGO_DOCUMENT_TYPE_INVALID.code, "FOR d IN @@cn INSERT d.foobar IN @@cn LET inserted = NEW RETURN inserted", { "@cn": cn1 });
assertEqual(100, c1.count());
},
@ -987,7 +999,7 @@ function ahuacatlInsertSuite () {
////////////////////////////////////////////////////////////////////////////////
testInsertInvalid2What : function () {
assertQueryError(errors.ERROR_ARANGO_DOCUMENT_TYPE_INVALID.code, "FOR d IN @@cn INSERT [ ] IN @@cn WITH NEW INTO inserted RETURN inserted", { "@cn": cn1 });
assertQueryError(errors.ERROR_ARANGO_DOCUMENT_TYPE_INVALID.code, "FOR d IN @@cn INSERT [ ] IN @@cn LET inserted = NEW RETURN inserted", { "@cn": cn1 });
assertEqual(100, c1.count());
},
@ -1005,7 +1017,7 @@ function ahuacatlInsertSuite () {
////////////////////////////////////////////////////////////////////////////////
testInsertInvalid3What : function () {
assertQueryError(errors.ERROR_ARANGO_DOCUMENT_TYPE_INVALID.code, "FOR d IN @@cn INSERT 'foo' IN @@cn WITH NEW INTO inserted RETURN inserted", { "@cn": cn1 });
assertQueryError(errors.ERROR_ARANGO_DOCUMENT_TYPE_INVALID.code, "FOR d IN @@cn INSERT 'foo' IN @@cn LET inserted = NEW RETURN inserted", { "@cn": cn1 });
assertEqual(100, c1.count());
},
@ -1023,7 +1035,7 @@ function ahuacatlInsertSuite () {
////////////////////////////////////////////////////////////////////////////////
testInsertUniqueConstraint1What : function () {
assertQueryError(errors.ERROR_ARANGO_UNIQUE_CONSTRAINT_VIOLATED.code, "FOR d IN @@cn INSERT d IN @@cn WITH NEW INTO inserted RETURN inserted", { "@cn": cn1 });
assertQueryError(errors.ERROR_ARANGO_UNIQUE_CONSTRAINT_VIOLATED.code, "FOR d IN @@cn INSERT d IN @@cn LET inserted = NEW RETURN inserted", { "@cn": cn1 });
assertEqual(100, c1.count());
},
@ -1041,7 +1053,7 @@ function ahuacatlInsertSuite () {
////////////////////////////////////////////////////////////////////////////////
testInsertUniqueConstraint2What : function () {
assertQueryError(errors.ERROR_ARANGO_UNIQUE_CONSTRAINT_VIOLATED.code, "FOR i IN 0..100 INSERT { _key: CONCAT('test', TO_STRING(i)) } IN @@cn WITH NEW INTO inserted RETURN inserted", { "@cn": cn2 });
assertQueryError(errors.ERROR_ARANGO_UNIQUE_CONSTRAINT_VIOLATED.code, "FOR i IN 0..100 INSERT { _key: CONCAT('test', TO_STRING(i)) } IN @@cn LET inserted = NEW RETURN inserted", { "@cn": cn2 });
assertEqual(50, c2.count());
},
@ -1059,7 +1071,7 @@ function ahuacatlInsertSuite () {
////////////////////////////////////////////////////////////////////////////////
testInsertUniqueConstraint3What : function () {
assertQueryError(errors.ERROR_ARANGO_UNIQUE_CONSTRAINT_VIOLATED.code, "FOR i IN 0..50 INSERT { _key: 'foo' } IN @@cn WITH NEW INTO inserted RETURN inserted", { "@cn": cn1 });
assertQueryError(errors.ERROR_ARANGO_UNIQUE_CONSTRAINT_VIOLATED.code, "FOR i IN 0..50 INSERT { _key: 'foo' } IN @@cn LET inserted = NEW RETURN inserted", { "@cn": cn1 });
assertEqual(100, c1.count());
},
@ -1081,7 +1093,7 @@ function ahuacatlInsertSuite () {
testInsertIgnore1What : function () {
var expected = { writesExecuted: 0, writesIgnored: 100 };
var actual = getModifyQueryResultsRaw("FOR d IN @@cn INSERT d IN @@cn OPTIONS { ignoreErrors: true } WITH NEW INTO inserted RETURN inserted", { "@cn": cn1 });
var actual = getModifyQueryResultsRaw("FOR d IN @@cn INSERT d IN @@cn OPTIONS { ignoreErrors: true } LET inserted = NEW RETURN inserted", { "@cn": cn1 });
assertEqual(0, actual.json.length);
assertEqual(100, c1.count());
@ -1106,7 +1118,7 @@ function ahuacatlInsertSuite () {
testInsertIgnore2What : function () {
var expected = { writesExecuted: 1, writesIgnored: 50 };
var actual = getModifyQueryResultsRaw("FOR i IN 50..100 INSERT { _key: CONCAT('test', TO_STRING(i)) } IN @@cn OPTIONS { ignoreErrors: true } WITH NEW INTO inserted RETURN inserted", { "@cn": cn1 });
var actual = getModifyQueryResultsRaw("FOR i IN 50..100 INSERT { _key: CONCAT('test', TO_STRING(i)) } IN @@cn OPTIONS { ignoreErrors: true } LET inserted = NEW RETURN inserted", { "@cn": cn1 });
assertEqual(1, actual.json.length);
validateModifyResultInsert(c1, actual.json);
@ -1134,7 +1146,7 @@ function ahuacatlInsertSuite () {
testInsertIgnore3What : function () {
var expected = { writesExecuted: 51, writesIgnored: 50 };
var actual = getModifyQueryResultsRaw("FOR i IN 0..100 INSERT { _key: CONCAT('test', TO_STRING(i)) } IN @@cn OPTIONS { ignoreErrors: true } WITH NEW INTO inserted RETURN inserted", { "@cn": cn2 });
var actual = getModifyQueryResultsRaw("FOR i IN 0..100 INSERT { _key: CONCAT('test', TO_STRING(i)) } IN @@cn OPTIONS { ignoreErrors: true } LET inserted = NEW RETURN inserted", { "@cn": cn2 });
validateModifyResultInsert(c2, actual.json);
validateDocuments(actual.json, false);
@ -1161,7 +1173,7 @@ function ahuacatlInsertSuite () {
testInsertIgnore4What : function () {
var expected = { writesExecuted: 0, writesIgnored: 100 };
var actual = getModifyQueryResultsRaw("FOR i IN 0..99 INSERT { _key: CONCAT('test', TO_STRING(i)) } IN @@cn OPTIONS { ignoreErrors: true } WITH NEW INTO inserted RETURN inserted", { "@cn": cn1 });
var actual = getModifyQueryResultsRaw("FOR i IN 0..99 INSERT { _key: CONCAT('test', TO_STRING(i)) } IN @@cn OPTIONS { ignoreErrors: true } LET inserted = NEW RETURN inserted", { "@cn": cn1 });
assertEqual(0, actual.json.length);
assertEqual(100, c1.count());
@ -1186,7 +1198,7 @@ function ahuacatlInsertSuite () {
testInsertIgnore5What : function () {
var expected = { writesExecuted: 50, writesIgnored: 50 };
var actual = getModifyQueryResultsRaw("FOR i IN 0..99 INSERT { _key: CONCAT('test', TO_STRING(i)) } IN @@cn OPTIONS { ignoreErrors: true } WITH NEW INTO inserted RETURN inserted", { "@cn": cn2 });
var actual = getModifyQueryResultsRaw("FOR i IN 0..99 INSERT { _key: CONCAT('test', TO_STRING(i)) } IN @@cn OPTIONS { ignoreErrors: true } LET inserted = NEW RETURN inserted", { "@cn": cn2 });
validateModifyResultInsert(c2, actual.json);
validateDocuments(actual.json, false);
@ -1213,7 +1225,7 @@ function ahuacatlInsertSuite () {
testInsertEmptyWhat : function () {
var expected = { writesExecuted: 100, writesIgnored: 0 };
var actual = getModifyQueryResultsRaw("FOR d IN @@cn INSERT { } IN @@cn WITH NEW INTO inserted RETURN inserted", { "@cn": cn1 });
var actual = getModifyQueryResultsRaw("FOR d IN @@cn INSERT { } IN @@cn LET inserted = NEW RETURN inserted", { "@cn": cn1 });
validateModifyResultInsert(c1, actual.json);
validateDocuments(actual.json, false);
@ -1241,7 +1253,7 @@ function ahuacatlInsertSuite () {
testInsertCopyWhat : function () {
var expected = { writesExecuted: 50, writesIgnored: 0 };
var actual = getModifyQueryResultsRaw("FOR i IN 50..99 INSERT { _key: CONCAT('test', TO_STRING(i)) } IN @@cn WITH NEW INTO inserted RETURN inserted", { "@cn": cn2 });
var actual = getModifyQueryResultsRaw("FOR i IN 50..99 INSERT { _key: CONCAT('test', TO_STRING(i)) } IN @@cn LET inserted = NEW RETURN inserted", { "@cn": cn2 });
validateModifyResultInsert(c2, actual.json);
validateDocuments(actual.json, false);
@ -1270,7 +1282,7 @@ function ahuacatlInsertSuite () {
testSingleWhat : function () {
var expected = { writesExecuted: 1, writesIgnored: 0 };
var actual = getModifyQueryResultsRaw("INSERT { value: 'foobar', _key: 'test' } IN @@cn WITH NEW INTO inserted RETURN inserted", { "@cn": cn1 });
var actual = getModifyQueryResultsRaw("INSERT { value: 'foobar', _key: 'test' } IN @@cn LET inserted = NEW RETURN inserted", { "@cn": cn1 });
validateModifyResultInsert(c1, actual.json);
validateDocuments(actual.json, false);
@ -1299,7 +1311,7 @@ function ahuacatlInsertSuite () {
testInsertWaitForSyncWhat : function () {
var expected = { writesExecuted: 50, writesIgnored: 0 };
var actual = getModifyQueryResultsRaw("FOR i IN 1..50 INSERT { value: i } INTO @@cn OPTIONS { waitForSync: true } WITH NEW INTO inserted RETURN inserted", { "@cn": cn2 });
var actual = getModifyQueryResultsRaw("FOR i IN 1..50 INSERT { value: i } INTO @@cn OPTIONS { waitForSync: true } LET inserted = NEW RETURN inserted", { "@cn": cn2 });
validateModifyResultInsert(c2, actual.json);
validateDocuments(actual.json, false);
@ -1331,7 +1343,7 @@ function ahuacatlInsertSuite () {
db._drop("UnitTestsAhuacatlEdge");
var edge = db._createEdgeCollection("UnitTestsAhuacatlEdge");
assertQueryError(errors.ERROR_ARANGO_DOCUMENT_HANDLE_BAD.code, "FOR i IN 1..50 INSERT { } INTO @@cn WITH NEW INTO inserted RETURN inserted", { "@cn": edge.name() });
assertQueryError(errors.ERROR_ARANGO_DOCUMENT_HANDLE_BAD.code, "FOR i IN 1..50 INSERT { } INTO @@cn LET inserted = NEW RETURN inserted", { "@cn": edge.name() });
assertEqual(0, edge.count());
db._drop("UnitTestsAhuacatlEdge");
@ -1359,7 +1371,7 @@ function ahuacatlInsertSuite () {
db._drop("UnitTestsAhuacatlEdge");
var edge = db._createEdgeCollection("UnitTestsAhuacatlEdge");
assertQueryError(errors.ERROR_ARANGO_DOCUMENT_HANDLE_BAD.code, "FOR i IN 1..50 INSERT { _to: CONCAT('UnitTestsAhuacatlInsert1/', TO_STRING(i)) } INTO @@cn WITH NEW INTO inserted RETURN inserted", { "@cn": edge.name() });
assertQueryError(errors.ERROR_ARANGO_DOCUMENT_HANDLE_BAD.code, "FOR i IN 1..50 INSERT { _to: CONCAT('UnitTestsAhuacatlInsert1/', TO_STRING(i)) } INTO @@cn LET inserted = NEW RETURN inserted", { "@cn": edge.name() });
assertEqual(0, edge.count());
db._drop("UnitTestsAhuacatlEdge");
@ -1387,7 +1399,7 @@ function ahuacatlInsertSuite () {
db._drop("UnitTestsAhuacatlEdge");
var edge = db._createEdgeCollection("UnitTestsAhuacatlEdge");
assertQueryError(errors.ERROR_ARANGO_DOCUMENT_HANDLE_BAD.code, "FOR i IN 1..50 INSERT { _from: CONCAT('UnitTestsAhuacatlInsert1/', TO_STRING(i)) } INTO @@cn WITH NEW INTO inserted RETURN inserted", { "@cn": edge.name() });
assertQueryError(errors.ERROR_ARANGO_DOCUMENT_HANDLE_BAD.code, "FOR i IN 1..50 INSERT { _from: CONCAT('UnitTestsAhuacatlInsert1/', TO_STRING(i)) } INTO @@cn LET inserted = NEW RETURN inserted", { "@cn": edge.name() });
assertEqual(0, edge.count());
db._drop("UnitTestsAhuacatlEdge");
@ -1426,7 +1438,7 @@ function ahuacatlInsertSuite () {
var edge = db._createEdgeCollection("UnitTestsAhuacatlEdge");
var expected = { writesExecuted: 50, writesIgnored: 0 };
var actual = getModifyQueryResultsRaw("FOR i IN 1..50 INSERT { _key: CONCAT('test', TO_STRING(i)), _from: CONCAT('UnitTestsAhuacatlInsert1/', TO_STRING(i)), _to: CONCAT('UnitTestsAhuacatlInsert2/', TO_STRING(i)), value: [ i ], sub: { foo: 'bar' } } INTO @@cn WITH NEW INTO inserted RETURN inserted", { "@cn": edge.name() });
var actual = getModifyQueryResultsRaw("FOR i IN 1..50 INSERT { _key: CONCAT('test', TO_STRING(i)), _from: CONCAT('UnitTestsAhuacatlInsert1/', TO_STRING(i)), _to: CONCAT('UnitTestsAhuacatlInsert2/', TO_STRING(i)), value: [ i ], sub: { foo: 'bar' } } INTO @@cn LET inserted = NEW RETURN inserted", { "@cn": edge.name() });
validateModifyResultInsert(edge, actual.json);
validateDocuments(actual.json, true);
@ -1493,7 +1505,7 @@ function ahuacatlUpdateSuite () {
////////////////////////////////////////////////////////////////////////////////
/// @brief test update
////////////////////////////////////////////////////////////////////////////////
/*
testUpdateNothing : function () {
var expected = { writesExecuted: 0, writesIgnored: 0 };
var actual = getModifyQueryResults("FOR d IN " + cn1 + " FILTER d.value1 < 0 UPDATE { foxx: true } IN " + cn1, {});
@ -1600,7 +1612,7 @@ function ahuacatlUpdateSuite () {
testUpdateEmpty1WhatNew : function () {
var expected = { writesExecuted: 100, writesIgnored: 0 };
var actual = getModifyQueryResultsRaw("FOR d IN @@cn UPDATE { _key: d._key } IN @@cn WITH NEW INTO updated RETURN updated", { "@cn": cn1 });
var actual = getModifyQueryResultsRaw("FOR d IN @@cn UPDATE { _key: d._key } IN @@cn LET updated = NEW RETURN updated", { "@cn": cn1 });
assertEqual(expected, sanitizeStats(actual.stats));
assertEqual(100, actual.json.length);
@ -1637,7 +1649,7 @@ function ahuacatlUpdateSuite () {
testUpdateEmpty2WhatNew : function () {
var expected = { writesExecuted: 100, writesIgnored: 0 };
var actual = getModifyQueryResultsRaw("FOR d IN @@cn UPDATE d IN @@cn WITH NEW INTO updated RETURN updated", { "@cn": cn1 });
var actual = getModifyQueryResultsRaw("FOR d IN @@cn UPDATE d IN @@cn LET updated = NEW RETURN updated", { "@cn": cn1 });
assertEqual(expected, sanitizeStats(actual.stats));
assertEqual(100, actual.json.length);
@ -1665,7 +1677,7 @@ function ahuacatlUpdateSuite () {
////////////////////////////////////////////////////////////////////////////////
testSingleNotFoundWhatNew : function () {
assertQueryError(errors.ERROR_ARANGO_DOCUMENT_NOT_FOUND.code, "UPDATE { _key: 'foobar' } WITH { value1: 1 } IN @@cn WITH NEW INTO updated RETURN updated", { "@cn": cn1 });
assertQueryError(errors.ERROR_ARANGO_DOCUMENT_NOT_FOUND.code, "UPDATE { _key: 'foobar' } WITH { value1: 1 } IN @@cn LET updated = NEW RETURN updated", { "@cn": cn1 });
},
////////////////////////////////////////////////////////////////////////////////
@ -1686,12 +1698,29 @@ function ahuacatlUpdateSuite () {
testSingleWhatNew : function () {
var expected = { writesExecuted: 1, writesIgnored: 0 };
var actual = getModifyQueryResultsRaw("UPDATE { value: 'foobar', _key: 'test17' } IN @@cn WITH NEW INTO updated RETURN updated", { "@cn": cn1 });
var actual = getModifyQueryResultsRaw("UPDATE { value: 'foobar', _key: 'test17' } IN @@cn LET updated = NEW RETURN updated", { "@cn": cn1 });
assertEqual("foobar", c1.document("test17").value);
assertEqual(expected, sanitizeStats(actual.stats));
},
////////////////////////////////////////////////////////////////////////////////
/// @brief test update
////////////////////////////////////////////////////////////////////////////////
testSingleWhatOld : function () {
var expected = { writesExecuted: 1, writesIgnored: 0 };
var actual = getModifyQueryResultsRaw("UPDATE { value: 'foobar', _key: 'test17' } IN @@cn LET old = OLD RETURN old", { "@cn": cn1 });
assertFalse(actual.json[0].hasOwnProperty('foobar'));
assertEqual("test17", actual.json[0]._key);
assertEqual(17, actual.json[0].value1);
assertEqual("foobar", c1.document("test17").value);
assertEqual(17, c1.document("test17").value1);
assertEqual(expected, sanitizeStats(actual.stats));
},
////////////////////////////////////////////////////////////////////////////////
/// @brief test update
////////////////////////////////////////////////////////////////////////////////
@ -1716,7 +1745,7 @@ function ahuacatlUpdateSuite () {
testUpdateOldValueWhatNew : function () {
var expected = { writesExecuted: 100, writesIgnored: 0 };
var actual = getModifyQueryResultsRaw("FOR d IN @@cn UPDATE { _key: d._key, value1: d.value2, value2: d.value1, value3: d.value1 + 5 } IN @@cn WITH NEW INTO updated RETURN updated", { "@cn": cn1 });
var actual = getModifyQueryResultsRaw("FOR d IN @@cn UPDATE { _key: d._key, value1: d.value2, value2: d.value1, value3: d.value1 + 5 } IN @@cn LET updated = NEW RETURN updated", { "@cn": cn1 });
assertEqual(expected, sanitizeStats(actual.stats));
assertEqual(100, actual.json.length);
@ -1735,6 +1764,31 @@ function ahuacatlUpdateSuite () {
}
},
////////////////////////////////////////////////////////////////////////////////
/// @brief test update
////////////////////////////////////////////////////////////////////////////////
testUpdateOldValueWhatOld : function () {
var expected = { writesExecuted: 100, writesIgnored: 0 };
var actual = getModifyQueryResultsRaw("FOR d IN @@cn UPDATE { _key: d._key, value1: d.value2, value2: d.value1, value3: d.value1 + 5 } IN @@cn LET old = OLD RETURN old", { "@cn": cn1 });
assertEqual(expected, sanitizeStats(actual.stats));
assertEqual(100, actual.json.length);
var keyArray = wrapToKeys(actual.json);
for (var i = 0; i < 100; ++i) {
var doc = c1.document("test" + i);
assertEqual("test" + i, doc.value1);
assertEqual(i, doc.value2);
assertEqual(i + 5, doc.value3);
assertTrue(keyArray.hasOwnProperty(doc._key));
assertEqual(i, keyArray[doc._key].value1);
assertEqual("test" + i, keyArray[doc._key].value2);
assertFalse(keyArray[doc._key].hasOwnProperty("value3"));
}
},
////////////////////////////////////////////////////////////////////////////////
/// @brief test update
////////////////////////////////////////////////////////////////////////////////
@ -1757,7 +1811,7 @@ function ahuacatlUpdateSuite () {
testUpdateWaitForSyncWhatNew : function () {
var expected = { writesExecuted: 50, writesIgnored: 0 };
var actual = getModifyQueryResultsRaw("FOR i IN 1..50 UPDATE { _key: CONCAT('test', TO_STRING(i)) } INTO @@cn OPTIONS { waitForSync: true } WITH NEW INTO updated RETURN updated", { "@cn": cn1 });
var actual = getModifyQueryResultsRaw("FOR i IN 1..50 UPDATE { _key: CONCAT('test', TO_STRING(i)) } INTO @@cn OPTIONS { waitForSync: true } LET updated = NEW RETURN updated", { "@cn": cn1 });
assertEqual(expected, sanitizeStats(actual.stats));
assertEqual(50, actual.json.length);
@ -1802,7 +1856,7 @@ function ahuacatlUpdateSuite () {
testUpdateKeepNullDefaultWhatNew : function () {
var expected = { writesExecuted: 100, writesIgnored: 0 };
var actual = getModifyQueryResultsRaw("FOR d IN @@cn UPDATE d._key WITH { value1: null, value3: 'foobar', value9: null } INTO @@cn WITH NEW INTO updated RETURN updated", { "@cn": cn1 });
var actual = getModifyQueryResultsRaw("FOR d IN @@cn UPDATE d._key WITH { value1: null, value3: 'foobar', value9: null } INTO @@cn LET updated = NEW RETURN updated", { "@cn": cn1 });
assertEqual(expected, sanitizeStats(actual.stats));
assertEqual(100, actual.json.length);
@ -1845,7 +1899,7 @@ function ahuacatlUpdateSuite () {
testUpdateKeepNullTrueWhatNew : function () {
var expected = { writesExecuted: 100, writesIgnored: 0 };
var actual = getModifyQueryResultsRaw("FOR d IN @@cn UPDATE d._key WITH { value1: null, value3: 'foobar', value9: null } INTO @@cn OPTIONS { keepNull: true } WITH NEW INTO updated RETURN updated", { "@cn": cn1 });
var actual = getModifyQueryResultsRaw("FOR d IN @@cn UPDATE d._key WITH { value1: null, value3: 'foobar', value9: null } INTO @@cn OPTIONS { keepNull: true } LET updated = NEW RETURN updated", { "@cn": cn1 });
assertEqual(expected, sanitizeStats(actual.stats));
assertEqual(100, actual.json.length);
@ -1889,7 +1943,7 @@ function ahuacatlUpdateSuite () {
testUpdateKeepNullFalseWhatNew : function () {
var expected = { writesExecuted: 100, writesIgnored: 0 };
var actual = getModifyQueryResultsRaw("FOR d IN @@cn UPDATE d._key WITH { value1: null, value3: 'foobar', value9: null } INTO @@cn OPTIONS { keepNull: false } WITH NEW INTO updated RETURN updated", { "@cn": cn1 });
var actual = getModifyQueryResultsRaw("FOR d IN @@cn UPDATE d._key WITH { value1: null, value3: 'foobar', value9: null } INTO @@cn OPTIONS { keepNull: false } LET updated = NEW RETURN updated", { "@cn": cn1 });
assertEqual(expected, sanitizeStats(actual.stats));
assertEqual(100, actual.json.length);
@ -1909,6 +1963,33 @@ function ahuacatlUpdateSuite () {
}
},
////////////////////////////////////////////////////////////////////////////////
/// @brief test update
////////////////////////////////////////////////////////////////////////////////
testUpdateKeepNullFalseWhatOld : function () {
var expected = { writesExecuted: 100, writesIgnored: 0 };
var actual = getModifyQueryResultsRaw("FOR d IN @@cn UPDATE d._key WITH { value1: null, value3: 'foobar', value9: null } INTO @@cn OPTIONS { keepNull: false } LET updated = OLD RETURN updated", { "@cn": cn1 });
assertEqual(expected, sanitizeStats(actual.stats));
assertEqual(100, actual.json.length);
var keyArray = wrapToKeys(actual.json);
for (var i = 0; i < 100; ++i) {
var doc = c1.document("test" + i);
assertFalse(doc.hasOwnProperty("value1"));
assertEqual("test" + i, doc.value2);
assertEqual("foobar", doc.value3);
assertFalse(doc.hasOwnProperty("value9"));
assertTrue(keyArray.hasOwnProperty(doc._key));
assertEqual(i, keyArray[doc._key].value1);
assertEqual("test" + i, keyArray[doc._key].value2);
assertFalse(keyArray[doc._key].hasOwnProperty('value3'));
assertFalse(keyArray[doc._key].hasOwnProperty('value9'));
}
},
////////////////////////////////////////////////////////////////////////////////
/// @brief test update mergeObjects
////////////////////////////////////////////////////////////////////////////////
@ -1930,7 +2011,7 @@ function ahuacatlUpdateSuite () {
testUpdateMergeObjectsDefaultWhatNew : function () {
c1.save({ _key: "something", values: { foo: 1, bar: 2, baz: 3 } });
var expected = { writesExecuted: 1, writesIgnored: 0 };
var actual = getModifyQueryResultsRaw("FOR d IN @@cn FILTER d._key == 'something' UPDATE d._key WITH { values: { bar: 42, bumm: 23 } } INTO @@cn WITH NEW INTO updated RETURN updated", { "@cn": cn1 });
var actual = getModifyQueryResultsRaw("FOR d IN @@cn FILTER d._key == 'something' UPDATE d._key WITH { values: { bar: 42, bumm: 23 } } INTO @@cn LET updated = NEW RETURN updated", { "@cn": cn1 });
assertEqual(expected, sanitizeStats(actual.stats));
assertEqual(1, actual.json.length);
@ -1961,7 +2042,7 @@ function ahuacatlUpdateSuite () {
testUpdateMergeObjectsTrueWhatNew : function () {
c1.save({ _key: "something", values: { foo: 1, bar: 2, baz: 3 } });
var expected = { writesExecuted: 1, writesIgnored: 0 };
var actual = getModifyQueryResultsRaw("FOR d IN @@cn FILTER d._key == 'something' UPDATE d._key WITH { values: { bar: 42, bumm: 23 } } INTO @@cn OPTIONS { mergeObjects: true } WITH NEW INTO updated RETURN updated", { "@cn": cn1 });
var actual = getModifyQueryResultsRaw("FOR d IN @@cn FILTER d._key == 'something' UPDATE d._key WITH { values: { bar: 42, bumm: 23 } } INTO @@cn OPTIONS { mergeObjects: true } LET updated = NEW RETURN updated", { "@cn": cn1 });
assertEqual(expected, sanitizeStats(actual.stats));
assertEqual(1, actual.json.length);
@ -1991,7 +2072,7 @@ function ahuacatlUpdateSuite () {
testUpdateMergeObjectsFalseWhatNew : function () {
c1.save({ _key: "something", values: { foo: 1, bar: 2, baz: 3 } });
var expected = { writesExecuted: 1, writesIgnored: 0 };
var actual = getModifyQueryResultsRaw("FOR d IN @@cn FILTER d._key == 'something' UPDATE d._key WITH { values: { bar: 42, bumm: 23 } } INTO @@cn OPTIONS { mergeObjects: false } WITH NEW INTO updated RETURN updated", { "@cn": cn1 });
var actual = getModifyQueryResultsRaw("FOR d IN @@cn FILTER d._key == 'something' UPDATE d._key WITH { values: { bar: 42, bumm: 23 } } INTO @@cn OPTIONS { mergeObjects: false } LET updated = NEW RETURN updated", { "@cn": cn1 });
assertEqual(expected, sanitizeStats(actual.stats));
assertEqual(1, actual.json.length);
@ -2026,7 +2107,7 @@ function ahuacatlUpdateSuite () {
testUpdateFilterWhatNew : function () {
var expected = { writesExecuted: 50, writesIgnored: 0 };
var actual = getModifyQueryResultsRaw("FOR d IN @@cn FILTER d.value1 % 2 == 0 UPDATE d._key WITH { value2: 100 } INTO @@cn WITH NEW INTO updated RETURN updated", { "@cn": cn1 });
var actual = getModifyQueryResultsRaw("FOR d IN @@cn FILTER d.value1 % 2 == 0 UPDATE d._key WITH { value2: 100 } INTO @@cn LET updated = NEW RETURN updated", { "@cn": cn1 });
assertEqual(expected, sanitizeStats(actual.stats));
assertEqual(50, actual.json.length);
@ -2043,13 +2124,35 @@ function ahuacatlUpdateSuite () {
}
if (keyArray.hasOwnProperty(doc._key)) {
count ++;
count++;
assertTrue(isEqual(doc, keyArray[doc._key]));
}
}
assertEqual(50, count);
},
////////////////////////////////////////////////////////////////////////////////
/// @brief test update
////////////////////////////////////////////////////////////////////////////////
testUpdateFilterWhatOld : function () {
var expected = { writesExecuted: 50, writesIgnored: 0 };
var actual = getModifyQueryResultsRaw("FOR d IN @@cn FILTER d.value1 % 2 == 0 UPDATE d._key WITH { value2: 100 } INTO @@cn LET updated = OLD RETURN updated", { "@cn": cn1 });
assertEqual(expected, sanitizeStats(actual.stats));
assertEqual(50, actual.json.length);
var keyArray = wrapToKeys(actual.json);
var count = 0;
for (var i = 0; i < 100; i += 2) {
var doc = c1.document("test" + i);
assertEqual(100, doc.value2);
count++;
assertEqual(i, keyArray[doc._key].value1);
}
assertEqual(50, count);
},
////////////////////////////////////////////////////////////////////////////////
/// @brief test update
////////////////////////////////////////////////////////////////////////////////
@ -2078,7 +2181,7 @@ function ahuacatlUpdateSuite () {
var actual=[];
for (j = 0; j < 5; ++j) {
actual[j] = getModifyQueryResultsRaw("FOR d IN @@cn UPDATE d._key WITH { counter: HAS(d, 'counter') ? d.counter + 1 : 1 } INTO @@cn WITH NEW INTO updated RETURN updated", { "@cn": cn1 });
actual[j] = getModifyQueryResultsRaw("FOR d IN @@cn UPDATE d._key WITH { counter: HAS(d, 'counter') ? d.counter + 1 : 1 } INTO @@cn LET updated = NEW RETURN updated", { "@cn": cn1 });
assertEqual(expected, sanitizeStats(actual[j].stats));
assertEqual(100, actual[j].json.length);
}
@ -2125,7 +2228,7 @@ function ahuacatlUpdateSuite () {
var expected = { writesExecuted: 100, writesIgnored: 0 };
var actual=[];
for (j = 0; j < 5; ++j) {
actual[j] = getModifyQueryResultsRaw("FOR d IN @@cn REPLACE d._key WITH { value4: 12 } INTO @@cn WITH NEW INTO replaced RETURN replaced", { "@cn": cn1 });
actual[j] = getModifyQueryResultsRaw("FOR d IN @@cn REPLACE d._key WITH { value4: 12 } INTO @@cn LET replaced = NEW RETURN replaced", { "@cn": cn1 });
assertEqual(expected, sanitizeStats(actual[j].stats));
assertEqual(100, actual[j].json.length);
}
@ -2145,7 +2248,7 @@ function ahuacatlUpdateSuite () {
assertEqual(12, actual[j].json[i].value4);
}
}
},
},
////////////////////////////////////////////////////////////////////////////////
/// @brief test replace
@ -2177,19 +2280,17 @@ function ahuacatlUpdateSuite () {
var expected = { writesExecuted: 100, writesIgnored: 0 };
var actual=[];
for (j = 0; j < 5; ++j) {
actual[j] = getModifyQueryResultsRaw("FOR d IN @@cn REPLACE { _key: d._key, value4: 13 } INTO @@cn WITH NEW INTO replaced RETURN replaced", { "@cn": cn1 });
PY(actual[j]);
actual[j] = getModifyQueryResultsRaw("FOR d IN @@cn REPLACE { _key: d._key, value4: " + j + " } INTO @@cn LET replaced = NEW RETURN replaced", { "@cn": cn1 });
assertEqual(expected, sanitizeStats(actual[j].stats));
assertEqual(100, actual[j].json.length);
}
for (i = 0; i < 100; ++i) {
var doc = c1.document("test" + i);
assertFalse(doc.hasOwnProperty("value1"));
assertFalse(doc.hasOwnProperty("value2"));
assertFalse(doc.hasOwnProperty("value3"));
assertEqual(13, doc.value4);
assertEqual(4, doc.value4);
}
for (j = 0; j < 5; ++j) {
@ -2197,12 +2298,11 @@ function ahuacatlUpdateSuite () {
assertFalse(actual[j].json[i].hasOwnProperty("value1"));
assertFalse(actual[j].json[i].hasOwnProperty("value2"));
assertFalse(actual[j].json[i].hasOwnProperty("value3"));
assertEqual(13, actual[j].json[i].value4);
assertEqual(j, actual[j].json[i].value4);
}
}
},
*/
/*
////////////////////////////////////////////////////////////////////////////////
/// @brief test replace
////////////////////////////////////////////////////////////////////////////////
@ -2230,7 +2330,7 @@ function ahuacatlUpdateSuite () {
var i;
var expected = { writesExecuted: 100, writesIgnored: 0 };
for (i = 0; i < 5; ++i) {
var actual = getModifyQueryResultsRaw("FOR d IN @@cn REPLACE d._key WITH { value1: d.value1 + 1 } INTO @@cn WITH NEW INTO replaced RETURN replaced", { "@cn": cn1 });
var actual = getModifyQueryResultsRaw("FOR d IN @@cn REPLACE d._key WITH { value1: d.value1 + 1 } INTO @@cn LET replaced = NEW RETURN replaced", { "@cn": cn1 });
assertEqual(expected, sanitizeStats(actual.stats));
}
@ -2240,7 +2340,7 @@ function ahuacatlUpdateSuite () {
assertFalse(doc.hasOwnProperty("value2"));
}
}
*/
};
}
@ -2248,9 +2348,9 @@ function ahuacatlUpdateSuite () {
/// @brief executes the test suites
////////////////////////////////////////////////////////////////////////////////
//jsunity.run(ahuacatlModifySuite);
//jsunity.run(ahuacatlRemoveSuite);
//jsunity.run(ahuacatlInsertSuite);
jsunity.run(ahuacatlModifySuite);
jsunity.run(ahuacatlRemoveSuite);
jsunity.run(ahuacatlInsertSuite);
jsunity.run(ahuacatlUpdateSuite);
return jsunity.done();

View File

@ -13,7 +13,7 @@ fi
## bison
#############################################################################
${BISON} -l -d -ra -S lalr1.cc -o ${OUTPUT} ${INPUT}
${BISON} -l -d -ra -S lalr1.cc --warnings="deprecated,other,error=conflicts-sr,error=conflicts-rr" -o ${OUTPUT} ${INPUT}
#############################################################################
## sanity checks

View File

@ -13,7 +13,7 @@ fi
## bison
#############################################################################
${BISON} -d -ra -o ${OUTPUT} ${INPUT}
${BISON} -d -ra --warnings="deprecated,other,error=conflicts-sr,error=conflicts-rr" -o ${OUTPUT} ${INPUT}
#############################################################################
## sanity checks