FOTS driver: "declare option hof" in wrong place
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Zorba |
Fix Released
|
High
|
Sorin Marian Nasoi |
Bug Description
This happens at least with prod-SchemaImport / substitution-004, probably many others.
The computed query looks like this (edited) :
import module namespace xqxq = 'http://
.....
variable $queryID := xqxq:prepare-
xquery version ''3.0'';
declare namespace op = ''http://
declare namespace f = ''http://
declare option op:enable ''f:hof'';
import schema namespace s="http://
.....
The problem with this is that "declare option" must occur in the prolog AFTER all declare namespace and import statements. It works if the "declare option" is moved after the "import schema". (Actually the test still fails, but for unrelated reasons - looks like Xerces doesn't like that schema.)
Related branches
- Markos Zaharioudakis: Approve
-
Diff: 1671 lines (+568/-573)9 files modifiedsrc/compiler/expression/expr_clone.cpp (+14/-6)
src/compiler/expression/expr_manager.cpp (+10/-18)
src/compiler/expression/expr_manager.h (+2/-12)
src/compiler/expression/function_item_expr.cpp (+40/-31)
src/compiler/expression/function_item_expr.h (+2/-21)
src/compiler/translator/translator.cpp (+429/-470)
src/runtime/function_item/function_item.cpp (+1/-5)
src/runtime/function_item/function_item.h (+70/-8)
test/fots/CMakeLists.txt (+0/-2)
tags: | added: fots-driver |
Changed in zorba: | |
status: | Confirmed → In Progress |
Changed in zorba: | |
status: | Fix Committed → Fix Released |
As a note - the "declare option" and associated namespaces are actually not required in the test query at all, at least not in this case. They are needed in the outer query - the one that calls xqxq:prepare- main-module( ), but as far as I can tell they don't do anything useful for the test query compiled by XQXQ.
However, presumably in at least some tests (those that test HOF), the "declare option" will be required, so it will have to go after any schema/module imports.