Skip to content

Commit

Permalink
[MIN] XQuery Update: improved error message
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristianGruen committed Mar 2, 2015
1 parent 5c8c9f1 commit 9123cae
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion basex-core/src/main/java/org/basex/query/QueryError.java
Original file line number Diff line number Diff line change
Expand Up @@ -1176,7 +1176,7 @@ public enum QueryError {
/** XUDY0016. */
UPMULTREPL_X(XUDY, 16, "Node can only be replaced once: %."),
/** XUDY0016. */
UPMULTDOC_X(XUDY, 16, "Document can only be replaced once: %."),
UPMULTDOC_X_X(XUDY, 16, "Document can only be replaced once: %/%."),
/** XUDY0017. */
UPMULTREPV_X(XUDY, 17, "Node can only be replaced once: %"),
/** XUDY0021. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public Item item(final QueryContext qc, final InputInfo ii) throws QueryExceptio
final NewInput input = checkInput(item, token(path));
if(docs.isEmpty() || docs.get(0) == 0) {
// no replacement of first document (because of TableDiskAccess#insert, used > 0, pre = 0)
// open issue: UPMULTDOC_X_X not raised when adding documents
updates.add(new DBAdd(data, input, opts, qc, info), qc);
} else {
updates.add(new ReplaceDoc(docs.get(0), data, input, opts, qc, info), qc);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public void prepare(final MemData tmp) throws QueryException {

@Override
public void merge(final Update update) throws QueryException {
throw UPMULTDOC_X.get(info, replace.inputs.get(0).path);
throw UPMULTDOC_X_X.get(info, data.meta.name, replace.inputs.get(0).path);
}

@Override
Expand Down

0 comments on commit 9123cae

Please sign in to comment.