Skip to content
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

fn:generate-id must provide unique IDs for unique Nodes #4167

Merged

Conversation

adamretter
Copy link
Member

Closes #4150

@adamretter adamretter added the bug issue confirmed as bug label Jan 6, 2022
@adamretter adamretter added this to the eXist-5.4.0 milestone Jan 6, 2022
@adamretter adamretter requested a review from dizzzz January 6, 2022 16:29
@martin-honnen
Copy link

I am wondering, however, whether the new value containing colons, if I read the code right, returns a valid xs:ID value. The function's spec says "The returned identifier must consist of ASCII alphanumeric characters and must start with an alphabetic character.". Not quite sure whether a colon : is allowed there and whether I read the Java code generating the id correctly, but it seems to do nodeImplementationType + ":" + docId + ":" + nodeId, i.e. concatenate the three parts with colons.

@adamretter
Copy link
Member Author

adamretter commented Jan 6, 2022

@martin-honnen You are right of course! Somehow I missed that bit when reading the spec. I have now pushed a commit and tests which correct that.

Copy link
Member

@dizzzz dizzzz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a question, inline; not sure if I understand the tests, fully;
if I am... why the test results? are these reliable?

@adamretter
Copy link
Member Author

adamretter commented Jan 6, 2022

if I am... why the test results? are these reliable?

@dizzzz There was a mistake in the test, but the test still passed because the missing document evaluated to an empty-sequence, which was valid for all of the tests I made.

I have now fixed the missing document, and added a guard to ensure all documents are present.

@sonarcloud
Copy link

sonarcloud bot commented Jan 6, 2022

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 2 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug issue confirmed as bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] fn:generate-id not spec compliant
3 participants