Project

Profile

Help

Bug #3280

closed

Regression on XQuery streaming

Added by Gunther Rademacher over 7 years ago. Updated over 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Streaming
Sprint/Milestone:
-
Start date:
2017-06-14
Due date:
% Done:

100%

Estimated time:
Legacy ID:
Applies to branch:
9.8
Fix Committed on Branch:
9.8
Fixed in Maintenance Release:
Platforms:

Description

One of my XQuery streaming tests showed a regression with Saxon-EE 9.8.0.1:

for $x in saxon:stream(doc('uriresolver:resolve')/*/*)/*
return $x

The attached TestNG test demonstrates this.


Files

TestStreamingQueries.java (2.92 KB) TestStreamingQueries.java Gunther Rademacher, 2017-06-14 10:15
Actions #1

Updated by Michael Kay over 7 years ago

  • Status changed from New to In Progress

It seems the simpler formulation

saxon:stream(doc('uri')/*/*)/*

is working, but the equivalent verbose form

for $x in saxon:stream(doc('uri')/*/*)/* return $x

is not. The query compiles into

docOrder((("uri" ! (StreamInstr(., snapshot(child::element()/child::element())))) treat as node())/child::element())

which is not streamable because it contains a sort into document order. By contrast the simpler expression compiles to

(("uri" ! (StreamInstr(., snapshot(child::element()/child::element())))) treat as node())/child::element()
Actions #2

Updated by Michael Kay over 7 years ago

  • Category set to Streaming
  • Status changed from In Progress to Resolved
  • Assignee set to Michael Kay
  • Priority changed from Low to Normal
  • Fix Committed on Branch 9.8 added

I have solved the problem by persuading DocumentSorter.optimize() to try a little harder to get rid of the sort into document order. Specifically, it recomputes the special properties of the operand expression if necessary to see whether it really does require sorting.

Actions #3

Updated by O'Neil Delpratt over 7 years ago

  • Status changed from Resolved to Closed
  • % Done changed from 0 to 100
  • Fixed in Maintenance Release 9.8.0.2 added

Patch applied in the Saxon 9.8.0.2 maintenance release

Please register to edit this issue

Also available in: Atom PDF