-
-
Notifications
You must be signed in to change notification settings - Fork 182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes to eXist-db regarding circular imports #4996
Fixes to eXist-db regarding circular imports #4996
Conversation
585cde5
to
bb5c674
Compare
e929dae
to
e731d3a
Compare
@adamretter To aid folks reviewing the PR, could you share your assessment of the CI failures and whether they are due to the problems in the PR or issues specific to the CI environment? |
fc46628
to
82a58b4
Compare
@joewiz All resolved now. |
@adamretter looks like the license header checker doesn't like one of the license headers
Could you please explain the effect of these changes to #4699, is it implementing switching off restxq by default and thereby introducing a breaking change? |
82a58b4
to
0d2a271
Compare
@duncdrum I have fixed that now.
PR #4699 was never the correct approach and is now redundant due to the fixes in this PR. This PR does not break any backwards compatibility. |
SonarCloud Quality Gate failed. 0 Bugs 75.7% Coverage Catch issues before they fail your Quality Gate with our IDE extension SonarLint |
@adamretter could you resolve the existing conflicts in order to merge your're PR? |
Needed for running jetty in the extensions project, in order to test RESTXQ. [test] webapp config
0d2a271
to
78c34d2
Compare
SonarCloud Quality Gate failed. 0 Bugs 75.7% Coverage Catch issues before they fail your Quality Gate with our IDE extension SonarLint |
These errors although mostly in eXist-db itself were easy to manifest through using RESTXQ.
Closes #3448
Closes #1010
Closes #4699
The first thing that this PR deals with is a Library Module that attempts to import itself. Whilst BaseX raises an error, and Saxon allows it. With this PR eXist-db now follows Saxon in basically skipping the superfluous import and continues. This is inline with the W3C XQuery 3.1 specification which states:
and:
The second thing that this PR deals with is cyclic imports of Library Modules. i.e.
M1 -> M2 -> M1
. Before this PR an XQuery executed on eXist-db with a cyclic set of imports in its library modules would crash with a JavaStackOverflowError
. The expected behaviour has changed here between XQuery 1.0 and XQuery 3.1. In XQuery 1.0 cyclic imports were prohibited:however, in XQuery 3.1 cyclic imports are allowed:
In this PR, the XQuery version is now checked. If the XQuery is 1.0 then XQST0093 is raised, if the XQuery is newer (i.e. 3.0 or 3.1) then the cyclic import is resolved and allowed without issue.
This open source contribution to the eXist-db project was commissioned by the Office of the Historian, U.S. Department of State, https://history.state.gov/.
Footnotes
https://www.w3.org/TR/xquery-31/#id-module-declaration ↩
https://www.w3.org/TR/xquery-31/#dt-module-import ↩
https://www.w3.org/TR/2010/REC-xquery-20101214/#id-module-import ↩
https://www.w3.org/TR/xquery-31/#id-module-handling-cycles ↩