Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public DBNode value(final QueryContext qc) throws QueryException {
try {
final MemBuilder builder = new MemBuilder(Parser.emptyParser(OPTIONS)).init();
builder.openDoc(Token.EMPTY);
parser.parse(input, new DBResultHandler(builder));
parser.parse(input, new DBResultHandler(builder), qc::checkStop);
builder.closeDoc();
return new DBNode(builder.finish());
} catch(final BlitzParseException ex) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2548,6 +2548,11 @@ public final class FnModuleTest extends SandboxTest {
// invalid input with fail option
error("let $parser := " + func.args("s: ~[\"x\"]*.", " { 'fail-on-error': true() }") + "\n"
+ "return $parser('x')", IXML_INP_X_X_X);

// GH-2763: xquery:eval timeout or memory limit must be able to stop an ambiguous parse
final String ambiguous = func.args("s: s, s | 'a'.").trim() + "('aaaaaaaaaaaaaaaaaaaa')";
error(_XQUERY_EVAL.args(ambiguous, " {}", " { 'timeout': .1 }"), XQUERY_TIMEOUT);
error(_XQUERY_EVAL.args(ambiguous, " {}", " { 'memory': 10 }"), XQUERY_MEMORY);
}

/** Test method. */
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@
<dependency>
<groupId>de.bottlecaps</groupId>
<artifactId>markup-blitz</artifactId>
<version>1.12</version>
<version>1.13</version>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
Expand Down
Loading