<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>6994</bug_id>
          
          <creation_ts>2009-06-03 13:54:00 +0000</creation_ts>
          <short_desc>distinct-duration-equal-2 presumes a certain order</short_desc>
          <delta_ts>2009-10-14 12:37:50 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>XML Query Test Suite</product>
          <component>XML Query Test Suite</component>
          <version>1.0.2</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Bogdan Butnaru">bogdanb+w3c+bugzilla</reporter>
          <assigned_to name="Frans Englich">frans.englich</assigned_to>
          
          
          <qa_contact name="Mailing list for public feedback on specs from XSL and XML Query WGs">public-qt-comments</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>25444</commentid>
    <comment_count>0</comment_count>
    <who name="Bogdan Butnaru">bogdanb+w3c+bugzilla</who>
    <bug_when>2009-06-03 13:54:00 +0000</bug_when>
    <thetext>Hello! 

Test distinct-duration-equal-2 runs the query 
“fn:distinct-values((xs:yearMonthDuration(&apos;P1Y&apos;), xs:dayTimeDuration(&apos;P365D&apos;)))” and expects the result “&lt;doc&gt;P1Y P365D&lt;/doc&gt;”. 

However, http://www.w3.org/TR/2007/REC-xpath-functions-20070123/#func-distinct-values says that “[t]he order in which the sequence of values is returned is ·implementation dependent·.” 

Unless I&apos;m missing something, this means that “&lt;doc&gt;P365D P1Y&lt;/doc&gt;” is also a valid result, and should be added to the expected results list.

Similar considerations apply to K-SeqDistinctValuesFunc-6, which expects that 
  “deep-equal(
	distinct-values(
		(&quot;1&quot;, 1, 2, 1, 1, 3, 1, 1, 3, 
		 xs:anyURI(&quot;example.com/&quot;), xs:anyURI(&quot;example.com/&quot;)
		)
	), (&quot;1&quot;, 1, 2, 3, xs:anyURI(&quot;example.com/&quot;))
   )” should return true, even though distinct-values may reorder elements.

Also, I think ns-queries-results-q1 also has this problem, but I&apos;m not that far in implementation to be sure.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>25447</commentid>
    <comment_count>1</comment_count>
    <who name="Andrew Eisenberg">andrew.eisenberg</who>
    <bug_when>2009-06-03 21:29:36 +0000</bug_when>
    <thetext>I agree with the issue that you have raised, and have added the additional expected result that you suggested for distinct-duration-equal-2.

Frans, I believe that K-SeqDistinctValuesFunc-6 should be changed as well.

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>28336</commentid>
    <comment_count>2</comment_count>
    <who name="Frans Englich">frans.englich</who>
    <bug_when>2009-10-14 12:37:50 +0000</bug_when>
    <thetext>Fixed in CVS.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>