Author: shawkins
Date: 2011-08-26 11:46:08 -0400 (Fri, 26 Aug 2011)
New Revision: 3426
Modified:
branches/7.4.x/engine/src/main/java/org/teiid/query/xquery/saxon/SaxonXQueryExpression.java
branches/7.4.x/engine/src/test/java/org/teiid/query/processor/TestSQLXMLProcessing.java
Log:
TEIID-1729 fix for xml processing
Modified:
branches/7.4.x/engine/src/main/java/org/teiid/query/xquery/saxon/SaxonXQueryExpression.java
===================================================================
---
branches/7.4.x/engine/src/main/java/org/teiid/query/xquery/saxon/SaxonXQueryExpression.java 2011-08-26
15:17:29 UTC (rev 3425)
+++
branches/7.4.x/engine/src/main/java/org/teiid/query/xquery/saxon/SaxonXQueryExpression.java 2011-08-26
15:46:08 UTC (rev 3426)
@@ -171,7 +171,7 @@
throws QueryResolverException {
config.setErrorListener(ERROR_LISTENER);
this.xQueryString = xQueryString;
- StaticQueryContext context = new StaticQueryContext(config);
+ StaticQueryContext context = config.newStaticQueryContext();
IndependentContext ic = new IndependentContext(config);
namespaceMap.put(EMPTY_STRING, EMPTY_STRING);
if (namespaces != null) {
@@ -242,7 +242,13 @@
}
}
this.contextRoot = null;
- PathMap map = this.xQuery.getPathMap();
+ //we'll use a new pathmap, since we don't want to modify the one associated
with the xquery.
+ PathMap map = null;
+ if (columns == null) {
+ map = this.xQuery.getPathMap();
+ } else {
+ map = new PathMap(this.xQuery.getExpression());
+ }
PathMapRoot parentRoot;
try {
parentRoot = map.getContextRoot();
Modified:
branches/7.4.x/engine/src/test/java/org/teiid/query/processor/TestSQLXMLProcessing.java
===================================================================
---
branches/7.4.x/engine/src/test/java/org/teiid/query/processor/TestSQLXMLProcessing.java 2011-08-26
15:17:29 UTC (rev 3425)
+++
branches/7.4.x/engine/src/test/java/org/teiid/query/processor/TestSQLXMLProcessing.java 2011-08-26
15:46:08 UTC (rev 3426)
@@ -216,7 +216,11 @@
ProcessorPlan plan = helpGetPlan(helpParse(sql), metadata, new
DefaultCapabilitiesFinder(), createCommandContext());
- helpProcess(plan, createCommandContext(), dataManager, expected);
+ helpProcess(plan, createCommandContext(), dataManager, expected);
+
+ plan = helpGetPlan(helpParse(sql), metadata, new DefaultCapabilitiesFinder(),
createCommandContext());
+
+ doProcess(plan, dataManager, expected, createCommandContext());
}
@Test public void testXmlTableDefaultAndParent() throws Exception {