<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    Hi Anita,<br>
    <br>
    I can imagine it is related to sending huge request like "fid=1 or
    fid=2 or fid=3 or fid=4..." and spatialite does not like it... I
    will try if changing it to "fid in (1,2,3,4...)" makes it any
    better.<br>
    <br>
    Anyway, please open a ticket for it, this definitely looks like a
    bug.<br>
    <br>
    Best,<br>
    Matthias<br>
    <br>
    <div class="moz-cite-prefix">On 08/11/2015 09:51 PM, Anita Graser
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAFFV8FjaUTk4Ab05S7H5BTOTEAkya=-eBgq62R5tk+B-67eRpw@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div class="gmail_default">Hi, </div>
        <div class="gmail_default"><br>
        </div>
        <div class="gmail_default">This issue just appeared on
          gis.stackexchange: <a moz-do-not-send="true"
href="http://gis.stackexchange.com/questions/157846/qgis-2-8-how-can-layer-selectedfeatures-return-an-empty-list-while-layer-sel">http://gis.stackexchange.com/questions/157846/qgis-2-8-how-can-layer-selectedfeatures-return-an-empty-list-while-layer-sel</a> </div>
        <div class="gmail_default"><br>
        </div>
        <div class="gmail_default">selectedFeatures() returns an empty
          list if lots of features are selected.</div>
        <div class="gmail_default"><span class="comment-copy"
style="font-size:13px;line-height:16.8999996185303px;margin:0px;padding:0px;border:0px;background-color:rgba(248,248,248,0.6)"><br>
          </span></div>
        <div class="gmail_default"><span class="comment-copy"
style="font-size:13px;line-height:16.8999996185303px;margin:0px;padding:0px;border:0px;background-color:rgba(248,248,248,0.6)">I
            tested with a Spatialite layer and QGIS shows "SQLite error:
            Expression tree is too large (maximum depth 1000)" in the
            Spatialite log panel but there is no other indication (i.e.
            error thrown) of anything going wrong.</span><br>
        </div>
        <div class="gmail_default"><span
style="font-size:13px;line-height:16.8999996185303px;background-color:rgba(248,248,248,0.6)"><br>
          </span></div>
        <div class="gmail_default"><span
style="font-size:13px;line-height:16.8999996185303px;background-color:rgba(248,248,248,0.6)">Code
            to reproduce:</span></div>
        <div class="gmail_default"><br>
          <pre class="lang-py prettyprint prettyprinted" style="font-size:13px;margin-top:0px;padding:5px;border:0px;overflow:auto;width:auto;max-height:600px;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,sans-serif;color:rgb(57,51,24);word-wrap:normal;background-color:rgb(238,238,238)"><code style="margin:0px;padding:0px;border:0px;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,sans-serif;white-space:inherit"><span class="pln" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">layer </span><span class="pun" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">=</span><span class="pln" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> qgis</span><span class="pun" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">.</span><span class="pln" style="margin:0px;padding:0px;bor
der:0px;color:rgb(0,0,0)">utils</span><span class="pun" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">.</span><span class="pln" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">iface</span><span class="pun" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">.</span><span class="pln" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">activeLayer</span><span class="pun" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">()</span><span class="pln" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">
nbrSelected</span><span class="pun" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">=</span><span class="pln" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">layer</span><span class="pun" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">.</span><span class="pln" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">selectedFeatureCount</span><span class="pun" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">()</span><span class="pln" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">
selection01 </span><span class="pun" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">=</span><span class="pln" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> layer</span><span class="pun" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">.</span><span class="pln" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">selectedFeatures</span><span class="pun" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">()</span></code></pre>
          <p style="font-size:15px;margin:0px 0px
            1em;padding:0px;border:0px;clear:both;font-family:'Helvetica
Neue',Helvetica,Arial,sans-serif;line-height:19.5px;background-color:rgba(248,248,248,0.6)">What
            I've noticed is that if I select <strong
              style="margin:0px;padding:0px;border:0px">more than 999
              features</strong>, nbrSelected still returns the correct
            number of points, but</p>
          <blockquote style="font-size:15px;margin:0px 0px
            10px;padding:10px;border-width:0px;border-left-style:solid;border-left-color:transparent;quotes:none;font-family:'Helvetica
Neue',Helvetica,Arial,sans-serif;line-height:19.5px;background-color:rgb(238,238,238)">
            <p style="margin:0px;padding:0px;border:0px;clear:both">len(selection01)</p>
          </blockquote>
          <p style="font-size:15px;margin:0px 0px
            1em;padding:0px;border:0px;clear:both;font-family:'Helvetica
Neue',Helvetica,Arial,sans-serif;line-height:19.5px;background-color:rgba(248,248,248,0.6)">returns
            0... the list is empty.</p>
          <font face="Helvetica Neue, Helvetica, Arial, sans-serif"><span
style="line-height:17.5499992370605px;background-color:rgba(248,248,248,0.6)">Should
              I open a ticket? Or is there something I'm missing?</span></font></div>
        <div class="gmail_default"><font face="Helvetica Neue,
            Helvetica, Arial, sans-serif"><span
style="line-height:17.5499992370605px;background-color:rgba(248,248,248,0.6)"><br>
            </span></font></div>
        <div class="gmail_default"><font face="Helvetica Neue,
            Helvetica, Arial, sans-serif"><span
style="line-height:17.5499992370605px;background-color:rgba(248,248,248,0.6)">Thanks
              and best wishes,</span></font></div>
        <div class="gmail_default"><font face="Helvetica Neue,
            Helvetica, Arial, sans-serif"><span
style="line-height:17.5499992370605px;background-color:rgba(248,248,248,0.6)">Anita</span></font></div>
        <div class="gmail_default"><font face="Helvetica Neue,
            Helvetica, Arial, sans-serif"><span
style="line-height:17.5499992370605px;background-color:rgba(248,248,248,0.6)"><br>
            </span></font></div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Qgis-developer mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Qgis-developer@lists.osgeo.org">Qgis-developer@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/qgis-developer">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a></pre>
    </blockquote>
    <br>
  </body>
</html>