Project

Profile

Help

Bug #2571

closed

XQuery group-by leads to "Local variable $x has not been allocated a stack frame slot"

Added by Michael Kay over 8 years ago. Updated almost 8 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
XQuery conformance
Sprint/Milestone:
Start date:
2016-01-05
Due date:
% Done:

100%

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

Description

Reported by Hans-Juergen Rennau in email to MHK. The query:

let $doc := doc('problem-input.xml')

let $targets :=

for $xincludeGroup in $doc//xi:include

group by $href := $xincludeGroup/@href

order by $href

return <target href="{$href}"/>

return

<targets>{$targets}</targets>

fails with:

java.lang.ArrayIndexOutOfBoundsException: Local variable $xincludeGroup has not been allocated a stack frame slot

at net.sf.saxon.expr.LocalVariableReference.evaluateVariable(LocalVariableReference.java:114)

at net.sf.saxon.expr.flwor.TupleExpression.evaluateItem(TupleExpression.java:122)

at net.sf.saxon.expr.flwor.OrderByClausePush.processTuple(OrderByClausePush.java:50)

at net.sf.saxon.expr.flwor.GroupByClausePush.close(GroupByClausePush.java:100)

at net.sf.saxon.expr.flwor.LetClausePush.close(LetClausePush.java:44)

at net.sf.saxon.expr.flwor.ForClausePush.close(ForClausePush.java:53)

The problem occurs in the latest 9.6 build but not in 9.7

Please register to edit this issue

Also available in: Atom PDF