Skip to content

fn:function-lookup: find functions from all modules of the executing query#2644

Merged
ChristianGruen merged 1 commit intoBaseXdb:mainfrom
GuntherRademacher:#2641
Apr 21, 2026
Merged

fn:function-lookup: find functions from all modules of the executing query#2644
ChristianGruen merged 1 commit intoBaseXdb:mainfrom
GuntherRademacher:#2641

Conversation

@GuntherRademacher
Copy link
Copy Markdown
Member

Before #2554, fn:function-lookup could find any user-defined function declared in the executing query. That PR reorganized static functions by declaring module and introduced a visibility check based on sc.imports, which restricted fn:function-lookup to only functions statically visible at the call site.

The spec requires functions to be accessible if they are statically visible at the point where fn:function-lookup is called, but it also allows access to functions that are present in the dynamic context, where the actual set of those functions is implementation-defined.

The changes here restore the pre-#2554 behavior by passing a useDynamicContext flag through StaticFuncs.get() which causes the sc.imports check to be skipped, so any non-private user-defined function in the executing query is reachable via
fn:function-lookup, regardless of which module issues the call.

@GuntherRademacher GuntherRademacher changed the title 'fn:function-lookup`: find functions from all modules of the executing query fn:function-lookup: find functions from all modules of the executing query Apr 21, 2026
@ChristianGruen ChristianGruen merged commit dc0b21c into BaseXdb:main Apr 21, 2026
1 check passed
@ChristianGruen ChristianGruen deleted the #2641 branch April 21, 2026 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants