Project

Profile

Help

Bug #6421

closed

XQuery "group by" - result data duplication

Added by Taras Chervinka 7 months ago. Updated 7 months ago.

Status:
Duplicate
Priority:
Normal
Assignee:
Category:
Internals
Sprint/Milestone:
-
Start date:
2024-05-13
Due date:
% Done:

0%

Estimated time:
Legacy ID:
Applies to branch:
10, 11, 12
Fix Committed on Branch:
Fixed in Maintenance Release:
Platforms:
.NET, Java

Description

let $a := <root>
<user id="1">A</user>
<user id="2">B</user>
<user id="1">C</user>
<user id="1">D</user>
<user id="1">E</user>
</root>

return string-join(
	for $usr in $a/user
    let $id := data($usr/@id)
    where $id = '1'
    group by $id
    return
    	for $u in $a/user
        where $u/@id = $usr/@id
        return $u/text(), ", ")

we got a case from a customer and simplified it. The expression produces different results in 9.5, 10 and 11 9.5 - A, C, D, E 10,11 - A, A, A, A, C, C, C, C, D, D, D, D, E, E, E, E


Related issues

Is duplicate of Saxon - Bug #6207: Filter expression not working properlyResolved2023-09-22

Actions
Actions #1

Updated by Taras Chervinka 7 months ago

  • 9.5 - A, C, D, E
  • 10.8, 11.5 - A, A, A, A, C, C, C, C, D, D, D, D, E, E, E, E
Actions #2

Updated by Michael Kay 7 months ago

  • Subject changed from result data duplication to XQuery "group by" - result data duplication

Thanks for reporting it. Initial inquiries show:

As far as I can see, the problem (that is, the duplicated output) occurs only in EE (which means it is probably an optimization error): and it occurs in releases up to 12.3, but not in 12.4. However, I can't immediately find a known bug that was cleared in 12.4 with similar symptoms. The Git change log also shows no significant changes in the "group by" code.

The -explain output from 12.3 and 12.4 appears identical -- which goes against the theory of an optimization bug.

Actions #3

Updated by Michael Kay 7 months ago

Found it, it looks like bug #6207.

Actions #4

Updated by Taras Chervinka 7 months ago

Correct, it is EE version, I have tested the same with 11.6 and it behaves the same but I see #6207 fix is committed to 11 branch. Any ETA when it can be released with 11? We have not migrated yet to 12

Actions #5

Updated by Taras Chervinka 7 months ago

Is that possible to release the fix for version 10?

Actions #6

Updated by Michael Kay 7 months ago

Our immediate priority is to get a 12.5 maintenance release out, then turn our attentions to SaxonJS. There may be a final maintenance release on the 11 branch some time, but it's not a priority (each maintenance release typically ties up the whole team for a week, sometimes longer if it's been a long time since the previous one).

Actions #7

Updated by Michael Kay 7 months ago

  • Category set to Internals
  • Status changed from New to Duplicate
  • Assignee set to Michael Kay
  • Priority changed from Low to Normal
  • Applies to branch 10, 11, 12 added
  • Platforms .NET, Java added

Duplicate of #6207

Actions #8

Updated by Michael Kay 7 months ago

  • Is duplicate of Bug #6207: Filter expression not working properly added

Please register to edit this issue

Also available in: Atom PDF