<?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>29259</bug_id>
          
          <creation_ts>2015-11-03 18:37:36 +0000</creation_ts>
          <short_desc>[QT3TS] subarray() errorcode for test d1e76078</short_desc>
          <delta_ts>2015-12-03 17:29:46 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>XPath / XQuery / XSLT</product>
          <component>Functions and Operators 3.1</component>
          <version>Working drafts</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>CLOSED</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="Debbie Lockett">debbie</reporter>
          <assigned_to name="Michael Kay">mike</assigned_to>
          <cc>andrew_coleman</cc>
    
    <cc>debbie</cc>
          
          <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>124064</commentid>
    <comment_count>0</comment_count>
    <who name="Debbie Lockett">debbie</who>
    <bug_when>2015-11-03 18:37:36 +0000</bug_when>
    <thetext>The expected error code for the test d1e76078 in test set app-Walmsley has been modified. The test is:
declare variable $array1 := [&quot;abc&quot;,&quot;def&quot;,&quot;ghi&quot;,&quot;jkl&quot;];
 array:subarray($array1,6)

And now expects FOAY0001, rather than FOAY0002. From a strict reading of the spec, I disagree with the change. 

The spec currently says &quot;raise [err:FOAY0001] if $start is less than one&quot;; but it does not say raise this error if $start is greater than array:size($array) (perhaps this is a spec bug??). It says &quot;The two-argument version of the function returns the same result (or the same error) as the three-argument version when called with $length equal to the value of array:size($array) - $start + 1.&quot; So in this case, $length is calculated to be -1, and then we get &quot;raise [err:FOAY0002] if $length is less than zero.&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>124327</commentid>
    <comment_count>1</comment_count>
    <who name="Andrew Coleman">andrew_coleman</who>
    <bug_when>2015-12-01 16:35:15 +0000</bug_when>
    <thetext>The WG decided to treat this as a bug against F&amp;O spec</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>124342</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2015-12-02 16:11:28 +0000</bug_when>
    <thetext>The WG made some disapproving noises about the fact that the test had been changed without consultation.

The WG decided to change the specification of array:subarray() so that FOAY0001 is raised in this case, as expected by the revised test.

The specification has been changed accordingly, and the test results stand.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>124357</commentid>
    <comment_count>3</comment_count>
    <who name="Debbie Lockett">debbie</who>
    <bug_when>2015-12-03 17:20:23 +0000</bug_when>
    <thetext>Typo in the spec change. In the amended line:
A dynamic error is raised [err:FOAY0001] if $start is less than one or greater than array:size($array) + 1.

The final &quot;+ 1&quot; is incorrect, it should just be &quot;...or greater than array:size($array).&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>124358</commentid>
    <comment_count>4</comment_count>
    <who name="Debbie Lockett">debbie</who>
    <bug_when>2015-12-03 17:25:55 +0000</bug_when>
    <thetext>Sorry, ignore my last comment; the change is correct. $start is allowed to be array:size($array) + 1 to return an empty array.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>