1
0
Fork 0

Merge branch 'devel' of github.com:arangodb/arangodb into devel

This commit is contained in:
Michael Hackstein 2015-12-03 16:52:42 +01:00
commit 869509d63a
2 changed files with 65 additions and 15 deletions

View File

@ -575,9 +575,11 @@ single server, the document removal is executed transactionally in an
all-or-nothing fashion. For sharded collections, the entire remove operation
is not transactional.
Only a single *REMOVE* statement is allowed per AQL query, and it cannot be combined
with other data-modification or retrieval operations. A remove operation is
restricted to a single collection, and the [collection name](../Glossary/README.md#collection-name) must not be dynamic.
Each *REMOVE* operation is restricted to a single collection, and the
[collection name](../Glossary/README.md#collection-name) must not be dynamic.
Only a single *REMOVE* statement per collection is allowed per AQL query, and
it cannot be followed by read operations that access the same collection, by
traversal operations, or AQL functions that can read documents.
The syntax for a remove operation is:
@ -669,9 +671,11 @@ The *UPDATE* keyword can be used to partially update documents in a collection.
single server, updates are executed transactionally in an all-or-nothing fashion.
For sharded collections, the entire update operation is not transactional.
Only a single *UPDATE* statement is allowed per AQL query, and it cannot be combined
with other data-modification or retrieval operations. An update operation is
restricted to a single collection, and the collection name must not be dynamic.
Each *UPDATE* operation is restricted to a single collection, and the
[collection name](../Glossary/README.md#collection-name) must not be dynamic.
Only a single *UPDATE* statement per collection is allowed per AQL query, and
it cannot be followed by read operations that access the same collection, by
traversal operations, or AQL functions that can read documents.
The system attributes of documents (*_key*, *_id*, *_from*, *_to*, *_rev*) cannot be
updated.
@ -845,9 +849,11 @@ The *REPLACE* keyword can be used to completely replace documents in a collectio
single server, the replace operation is executed transactionally in an all-or-nothing
fashion. For sharded collections, the entire replace operation is not transactional.
Only a single *REPLACE* statement is allowed per AQL query, and it cannot be combined
with other data-modification or retrieval operations. A replace operation is
restricted to a single collection, and the collection name must not be dynamic.
Each *REPLACE* operation is restricted to a single collection, and the
[collection name](../Glossary/README.md#collection-name) must not be dynamic.
Only a single *REPLACE* statement per collection is allowed per AQL query, and
it cannot be followed by read operations that access the same collection, by
traversal operations, or AQL functions that can read documents.
The system attributes of documents (*_key*, *_id*, *_from*, *_to*, *_rev*) cannot be
replaced.
@ -975,9 +981,11 @@ The *INSERT* keyword can be used to insert new documents into a collection. On a
single server, an insert operation is executed transactionally in an all-or-nothing
fashion. For sharded collections, the entire insert operation is not transactional.
Only a single *INSERT* statement is allowed per AQL query, and it cannot be combined
with other data-modification or retrieval operations. An insert operation is
restricted to a single collection, and the collection name must not be dynamic.
Each *INSERT* operation is restricted to a single collection, and the
[collection name](../Glossary/README.md#collection-name) must not be dynamic.
Only a single *INSERT* statement per collection is allowed per AQL query, and
it cannot be followed by read operations that access the same collection, by
traversal operations, or AQL functions that can read documents.
The syntax for an insert operation is:
@ -1059,9 +1067,11 @@ and to update them in case they exist, or create them in case they do not exist.
On a single server, upserts are executed transactionally in an all-or-nothing fashion.
For sharded collections, the entire update operation is not transactional.
Only a single *UPSERT* statement is allowed per AQL query, and it cannot be combined
with other data-modification or retrieval operations. An upsert operation is
restricted to a single collection, and the collection name must not be dynamic.
Each *UPSERT* operation is restricted to a single collection, and the
[collection name](../Glossary/README.md#collection-name) must not be dynamic.
Only a single *UPSERT* statement per collection is allowed per AQL query, and
it cannot be followed by read operations that access the same collection, by
traversal operations, or AQL functions that can read documents.
The syntax for an upsert operation is:

View File

@ -77,6 +77,46 @@ function ahuacatlMultiModifySuite () {
var q = "INSERT { _key: '1', foo: 'bar' } INTO @@cn FOR doc IN OUTBOUND 'v/1' @@e RETURN doc";
assertQueryError(errors.ERROR_QUERY_ACCESS_AFTER_MODIFICATION.code, q, { "@cn": cn1, "@e": cn3 });
},
testInsertAfterModification : function () {
var q = "INSERT { _key: '1', foo: 'bar' } INTO @@cn INSERT { _key: '2', foo: 'baz' } INTO @@cn";
assertQueryError(errors.ERROR_QUERY_ACCESS_AFTER_MODIFICATION.code, q, { "@cn": cn1 });
},
testUpdateAfterModification : function () {
var q = "INSERT { _key: '1', foo: 'bar' } INTO @@cn UPDATE '1' WITH { foo: 'baz' } INTO @@cn";
assertQueryError(errors.ERROR_QUERY_ACCESS_AFTER_MODIFICATION.code, q, { "@cn": cn1 });
},
testReplaceAfterModification : function () {
var q = "INSERT { _key: '1', foo: 'bar' } INTO @@cn REPLACE '1' WITH { foo: 'baz' } INTO @@cn";
assertQueryError(errors.ERROR_QUERY_ACCESS_AFTER_MODIFICATION.code, q, { "@cn": cn1 });
},
testRemoveAfterModification : function () {
var q = "INSERT { _key: '1', foo: 'bar' } INTO @@cn REMOVE '1' IN @@cn";
assertQueryError(errors.ERROR_QUERY_ACCESS_AFTER_MODIFICATION.code, q, { "@cn": cn1 });
},
testUpsertAfterModification : function () {
var q = "INSERT { _key: '1', foo: 'bar' } INTO @@cn UPSERT { foo: 'bar' } INSERT { foo: 'bar' } UPDATE { foo: 'baz' } IN @@cn";
assertQueryError(errors.ERROR_QUERY_ACCESS_AFTER_MODIFICATION.code, q, { "@cn": cn1 });
},
testDocumentAfterModification : function () {
var q = "INSERT { _key: '1', foo: 'bar' } INTO @@cn RETURN DOCUMENT(@@cn, '1')";
assertQueryError(errors.ERROR_QUERY_ACCESS_AFTER_MODIFICATION.code, q, { "@cn": cn1 });
},
testEdgeAfterModification : function () {
var q = "INSERT { _from: @from, _to: @to } INTO @@cn RETURN DOCUMENT(@@cn, NEW._key)";
assertQueryError(errors.ERROR_QUERY_ACCESS_AFTER_MODIFICATION.code, q, { "@cn": cn3, from: cn2 + "/1", to: cn2 + "/2" });
},
testEdgesAfterModification : function () {
var q = "INSERT { _from: @from, _to: @to } INTO @@cn RETURN EDGES(@@cn, @from, 'outbound')";
assertQueryError(errors.ERROR_QUERY_ACCESS_AFTER_MODIFICATION.code, q, { "@cn": cn3, from: cn2 + "/1", to: cn2 + "/2" });
},
testMultiInsertSameCollection : function () {
var q = "INSERT { value: 1 } INTO @@cn INSERT { value: 2 } INTO @@cn";