Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
7ac9e33
[feature] Add expression infrastructure for W3C XQuery Update Facilit…
joewiz Mar 6, 2026
c7c6427
[feature] Implement W3C XQUF grammar, PUL, expression classes, and in…
joewiz Mar 7, 2026
48ce345
[feature] Add compile-time mutual exclusion for legacy and XQUF syntax
joewiz Mar 7, 2026
55b3578
[test] Add XQUF JUnit tests and XQUF bindingConflict tests
joewiz Mar 7, 2026
84cf3b8
[test] Add XQUF and legacy update performance benchmarks
joewiz Mar 7, 2026
19b8241
[refactor] Fix Codacy FQN warnings in XQueryContext and XQUFBasicTest
joewiz Mar 7, 2026
ef20b6a
[bugfix] Fix 6 remaining non-schema XQUF XQTS failures
joewiz Mar 12, 2026
968948e
[feature] Add LockTargetCollector and XQueryContext preclaiming infra…
joewiz Mar 7, 2026
92add84
[feature] Hook preclaiming locks into XQuery.execute()
joewiz Mar 7, 2026
7e7b0c8
[test] Add concurrency benchmark for preclaiming locks
joewiz Mar 7, 2026
03d8167
[bugfix] Fix rename+replace attribute interaction in PUL Phase 3
joewiz Mar 12, 2026
b61e34c
[ci] Add forked process timeout to prevent CI hangs
joewiz Mar 17, 2026
b0f92f8
[ci] Reduce forked process timeout from 600s to 180s
joewiz Mar 17, 2026
433e6a6
[ci] Exclude hanging integration tests from failsafe
joewiz Mar 17, 2026
5d7c1f2
[ci] Increase forked process timeout from 180s to 300s
joewiz Mar 20, 2026
675a7fb
[ci] Restore forked process timeout to 600s
joewiz Mar 20, 2026
0dc294f
[refactor] Address Codacy findings in memtree DOM mutation code
joewiz May 10, 2026
3940c10
[refactor] Address Codacy findings in xquf package
joewiz May 10, 2026
a581a85
[refactor] Address Codacy findings in lock package
joewiz May 10, 2026
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
11 changes: 11 additions & 0 deletions exist-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1203,6 +1203,8 @@ The BaseX Team. The original license statement is also included below.]]></pream
<log4j.configurationFile>${project.build.testOutputDirectory}/log4j2.xml</log4j.configurationFile>
</systemPropertyVariables>

<forkedProcessTimeoutInSeconds>600</forkedProcessTimeoutInSeconds>

<excludes>

<!-- NOTE: these can still exhibit deadlocks
Expand All @@ -1221,7 +1223,16 @@ The BaseX Team. The original license statement is also included below.]]></pream
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<forkedProcessTimeoutInSeconds>600</forkedProcessTimeoutInSeconds>
<argLine>@{jacocoArgLine} --add-modules jdk.incubator.vector --enable-native-access=ALL-UNNAMED -Dfile.encoding=${project.build.sourceEncoding} -Dexist.recovery.progressbar.hide=true</argLine>
<excludes>

<!-- NOTE: these can still exhibit deadlocks during BrokerPool initialization
see https://github.com/eXist-db/exist/issues/4140
see https://github.com/eXist-db/exist/issues/3685 -->
<exclude>org.exist.storage.lock.DeadlockIT</exclude>
<exclude>org.exist.storage.RemoveCollectionIT</exclude>
</excludes>
<systemPropertyVariables>
<jetty.home>${project.basedir}/../exist-jetty-config/target/classes/org/exist/jetty</jetty.home>
<exist.configurationFile>${project.build.testOutputDirectory}/conf.xml</exist.configurationFile>
Expand Down
126 changes: 122 additions & 4 deletions exist-core/src/main/antlr/org/exist/xquery/parser/XQuery.g
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,9 @@ prolog throws XPathException
( "declare" "function" )
=> functionDeclUp { inSetters = false; }
|
( "declare" "updating" "function" )
=> updatingFunctionDeclUp { inSetters = false; }
|
( "declare" "variable" )
=> varDeclUp { inSetters = false; }
|
Expand Down Expand Up @@ -455,7 +458,7 @@ annotateDecl! throws XPathException
:
decl:"declare"! ann:annotations!
(
("function") => f:functionDecl[#ann] { #annotateDecl = #f; }
("function") => f:functionDecl[#ann, false] { #annotateDecl = #f; }
|
("variable") => v:varDecl[#decl, #ann] { #annotateDecl = #v; }
)
Expand Down Expand Up @@ -523,10 +526,15 @@ bracedUriLiteral returns [String uri]

functionDeclUp! throws XPathException
:
"declare"! f:functionDecl[null] { #functionDeclUp = #f; }
"declare"! f:functionDecl[null, false] { #functionDeclUp = #f; }
;

updatingFunctionDeclUp! throws XPathException
:
"declare"! "updating"! f:functionDecl[null, true] { #updatingFunctionDeclUp = #f; }
;

functionDecl [XQueryAST ann] throws XPathException
functionDecl [XQueryAST ann, boolean updating] throws XPathException
{ String name= null; }
:
"function"! name=eqName! lp:LPAREN! ( paramList )?
Expand All @@ -536,6 +544,9 @@ functionDecl [XQueryAST ann] throws XPathException
#functionDecl= #(#[FUNCTION_DECL, name, org.exist.xquery.parser.XQueryFunctionAST.class.getName()], #ann, #functionDecl);
#functionDecl.copyLexInfo(#lp);
#functionDecl.setDoc(getXQDoc());
if (updating) {
((XQueryFunctionAST) #functionDecl).setUpdating(true);
}
}
exception catch [RecognitionException e]
{
Expand Down Expand Up @@ -735,11 +746,20 @@ exprSingle throws XPathException
| ( "if" LPAREN ) => ifExpr
| ( "switch" LPAREN ) => switchExpr
| ( "typeswitch" LPAREN ) => typeswitchExpr
// === Legacy update (DEPRECATED - use W3C XQuery Update Facility 3.0 syntax instead) ===
| ( "update" ( "replace" | "value" | "insert" | "delete" | "rename" )) => updateExpr
// === W3C XQuery Update Facility 3.0 ===
| ( "insert" ( "node" | "nodes" ) ) => xqufInsertExpr
| ( "delete" ( "node" | "nodes" ) ) => xqufDeleteExpr
| ( "replace" ( "node" | "value" ) ) => xqufReplaceExpr
| ( "rename" "node" ) => xqufRenameExpr
| ( "copy" DOLLAR ) => xqufTransformExpr
| orExpr
;

// === Xupdate ===
// === Legacy update (DEPRECATED - use W3C XQuery Update Facility 3.0 syntax instead) ===
// To remove legacy update support, delete this section and the updateExpr
// alternative in exprSingle above.

updateExpr throws XPathException
:
Expand Down Expand Up @@ -779,6 +799,57 @@ renameExpr throws XPathException
"rename" exprSingle "as"! exprSingle
;

// === W3C XQuery Update Facility 3.0 ===

xqufInsertExpr throws XPathException
:
"insert"^ ( "node"! | "nodes"! ) exprSingle
(
( "as" "first" "into" ) => "as"! "first" "into"! exprSingle
| ( "as" "last" "into" ) => "as"! "last" "into"! exprSingle
| "into" exprSingle
| "before" exprSingle
| "after" exprSingle
)
;

xqufDeleteExpr throws XPathException
:
"delete"^ ( "node"! | "nodes"! ) exprSingle
;

xqufReplaceExpr throws XPathException
:
"replace"^
(
( "value" "of" "node" ) => "value" "of"! "node"! exprSingle "with"! exprSingle
| "node"! exprSingle "with"! exprSingle
)
;

xqufRenameExpr throws XPathException
:
"rename"^ "node"! exprSingle "as"! exprSingle
;

xqufTransformExpr throws XPathException
:
"copy"^
xqufCopyBinding ( COMMA! xqufCopyBinding )*
"modify"! exprSingle
"return"! exprSingle
;

xqufCopyBinding throws XPathException
{ String varName; }
:
DOLLAR! varName=v:varName! COLON! EQ! exprSingle
{
#xqufCopyBinding = #(#[VARIABLE_BINDING, varName], #xqufCopyBinding);
#xqufCopyBinding.copyLexInfo(#v);
}
;

// === try/catch ===
tryCatchExpr throws XPathException
:
Expand Down Expand Up @@ -2288,8 +2359,12 @@ reservedKeywords returns [String name]
|
"base-uri" { name = "base-uri"; }
|
// Legacy update keyword (DEPRECATED - only "update" is legacy-only;
// the others below are shared with W3C XQUF 3.0).
// To remove: delete "update" and keep the rest.
"update" { name = "update"; }
|
// Shared by legacy update and W3C XQUF 3.0
"replace" { name = "replace"; }
|
"delete" { name = "delete"; }
Expand Down Expand Up @@ -2367,6 +2442,49 @@ reservedKeywords returns [String name]
"next" { name = "next"; }
|
"when" { name = "when"; }
|
// W3C XQuery Update Facility 3.0 keywords
"copy" { name = "copy"; }
|
"modify" { name = "modify"; }
|
"nodes" { name = "nodes"; }
|
"before" { name = "before"; }
|
"after" { name = "after"; }
|
"first" { name = "first"; }
|
"last" { name = "last"; }
|
"updating" { name = "updating"; }
|
"ascending" { name = "ascending"; }
|
"descending" { name = "descending"; }
|
"greatest" { name = "greatest"; }
|
"least" { name = "least"; }
|
"satisfies" { name = "satisfies"; }
|
"schema-attribute" { name = "schema-attribute"; }
|
"revalidation" { name = "revalidation"; }
|
"skip" { name = "skip"; }
|
"strict" { name = "strict"; }
|
"lax" { name = "lax"; }
|
"castable" { name = "castable"; }
|
"idiv" { name = "idiv"; }
|
"processing-instruction" { name = "processing-instruction"; }
;


Expand Down
Loading
Loading