<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hello,<br>
    <br>
    Have you found the way to run SELECT COUNT(*) ? <br>
    I use kamailio 3.2.4 with sqlite 3.7.5-1 and it crashes on such
    queries too.<br>
    <br>
    As a workaround I use $dbr(res=&gt;rows) with "SELECT some_field
    FROM table" query, but the bug is really exists.<br>
    <br>
    <blockquote
cite="mid:OFE3F8CCA8.66B65F86-ONC1257A99.0028DD61-C1257A99.002942DF@amper.es"
      type="cite"><font face="sans-serif" size="2">Hello Timo,</font>
      <br>
      <br>
      <font face="sans-serif" size="2">We've done a basic test and it
        seems
        to solve the memory leak problem. We'll do exhaustive tests in a
        few days.</font>
      <br>
      <br>
      <font face="sans-serif" size="2">We'll keep you informed.</font>
      <br>
      <br>
      <font face="sans-serif" size="2">Thanks a lot,</font>
      <br>
      <font face="sans-serif" size="2">Pedro<br>
      </font>
      <br>
      <br>
      <br>
      <br>
      <font color="#5f5f5f" face="sans-serif" size="1">De: &nbsp; &nbsp; &nbsp;
        &nbsp;</font><font face="sans-serif" size="1">Timo Teras
        <a class="moz-txt-link-rfc2396E" href="mailto:timo.teras@iki.fi">&lt;timo.teras@iki.fi&gt;</a></font>
      <br>
      <font color="#5f5f5f" face="sans-serif" size="1">Para: &nbsp; &nbsp; &nbsp;
        &nbsp;</font><font face="sans-serif" size="1">"SIP Router -
        Kamailio \(OpenSER\) and SIP Express Router \(SER\) - Users
        Mailing List"
        <a class="moz-txt-link-rfc2396E" href="mailto:sr-users@lists.sip-router.org">&lt;sr-users@lists.sip-router.org&gt;</a></font>
      <br>
      <font color="#5f5f5f" face="sans-serif" size="1">cc: &nbsp; &nbsp; &nbsp;
        &nbsp;</font><font face="sans-serif" size="1"><a class="moz-txt-link-abbreviated" href="mailto:pvsolano@amper.es">pvsolano@amper.es</a></font>
      <br>
      <font color="#5f5f5f" face="sans-serif" size="1">Fecha: &nbsp; &nbsp; &nbsp;
        &nbsp;</font><font face="sans-serif" size="1">15/10/2012 16:13</font>
      <br>
      <font color="#5f5f5f" face="sans-serif" size="1">Asunto: &nbsp; &nbsp;
        &nbsp; &nbsp;</font><font face="sans-serif" size="1">Re: [SR-Users]
        db_sqlite bugs</font>
      <br>
      <font color="#5f5f5f" face="sans-serif" size="1">Enviado por: &nbsp; &nbsp;
        &nbsp; &nbsp;</font><font face="sans-serif" size="1">Timo Ter&auml;s
        <a class="moz-txt-link-rfc2396E" href="mailto:timo.teras@gmail.com">&lt;timo.teras@gmail.com&gt;</a></font>
      <br>
      <hr noshade="noshade">
      <br>
      <br>
      <br>
      <tt><font size="2">On Thu, 11 Oct 2012 12:37:23 +0200 Pedro
          Antonio Vico
          Solano<br>
          <a class="moz-txt-link-rfc2396E" href="mailto:pvsolano@amper.es">&lt;pvsolano@amper.es&gt;</a> wrote:<br>
          <br>
          &gt; Hello everyone,<br>
          &gt; <br>
          &gt; We are developing a solution based on the SQLite module
          for Kamailio<br>
          &gt; and we've found some bugs/errors regarding it. We use
          kamailio 3.2.4<br>
          &gt; and SQLite 3.7.14.1. The errors are about this:<br>
          &gt; <br>
          &gt; - Memory leaks on querys via sqlops. Kamailio main
          process leaks 4kB<br>
          &gt; each 3 queries (aprox.) and that memory is never freed.
          [Attached<br>
          &gt; basic example]<br>
          &gt; - Segmentation fault when doing a SELECT COUNT(*) via
          sqlops.<br>
          &gt; [Attached basic example 2]<br>
          &gt; <br>
          &gt; Can you help us?<br>
          <br>
          Does this help for the memory leak?<br>
          <br>
          diff --git a/modules_k/db_sqlite/dbase.c
          b/modules_k/db_sqlite/dbase.c<br>
          index 0b32e07..c1d3b71 100644<br>
          --- a/modules_k/db_sqlite/dbase.c<br>
          +++ b/modules_k/db_sqlite/dbase.c<br>
          @@ -543,7 +543,12 @@ int db_sqlite_update(const db1_con_t* _h,
          const db_key_t*
          _k, const db_op_t* _o,<br>
          <br>
          int db_sqlite_raw_query(const db1_con_t* _h, const str* _s,
          db1_res_t**
          _r)<br>
          {<br>
          - &nbsp; &nbsp; &nbsp; return db_do_raw_query(_h, _s, _r,<br>
          + &nbsp; &nbsp; &nbsp; int rc;<br>
          +<br>
          + &nbsp; &nbsp; &nbsp; rc = db_do_raw_query(_h, _s, _r,<br>
          &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
          &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; db_sqlite_submit_query,<br>
          &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
          &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; db_sqlite_store_result);<br>
          + &nbsp; &nbsp; &nbsp; db_sqlite_cleanup_query(_h);<br>
          +<br>
          + &nbsp; &nbsp; &nbsp; return rc;<br>
          }<br>
          <br>
          Seems that all other database driver postpone the resource
          release to<br>
          free_results - but there's no reason why we couldn't do this
          right away<br>
          in sqlite. Since in sqlite free_results we just free cached
          result set.<br>
          <br>
          Will take a look at the other bug later when I get the time to<br>
          reproduce it.<br>
          <br>
          -Timo<br>
        </font></tt>
      <br>
      <font color="#008000" face="sans-serif" size="1"><br>
        ADVERTENCIA </font><font face="sans-serif" size="2"><br>
      </font><font color="#008000" face="sans-serif" size="1"><br>
        Este mensaje y/o sus anexos, pueden contener informaci&oacute;n
        personal y confidencial
        cuyo uso, reproducci&oacute;n o distribuci&oacute;n no autorizados est&aacute;n
        legalmente prohibidos.
        Por lo tanto, si Vd. no fuera su destinatario y, err&oacute;neamente,
        lo hubiera
        recibido, le rogamos que informe al remitente y lo borre de
        inmediato.<br>
        <br>
        En cumplimiento de la Ley Org&aacute;nica 15/1999, de Protecci&oacute;n de
        Datos de Car&aacute;cter
        Personal le informamos de que su direcci&oacute;n de correo
        electr&oacute;nico, as&iacute; como
        sus datos personales y de empresa pasar&aacute;n a formar parte de
        nuestro fichero
        de Gesti&oacute;n, y ser&aacute;n tratados con la &uacute;nica finalidad de
        mantenimiento de
        la relaci&oacute;n adquirida con usted. Los datos personales que
        existen en nuestro
        poder est&aacute;n protegidos por nuestra Pol&iacute;tica de Seguridad, y no
        ser&aacute;n compartidos
        con ninguna otra empresa. Usted puede ejercitar los derechos de
        acceso,
        rectificaci&oacute;n, cancelaci&oacute;n y oposici&oacute;n dirigi&eacute;ndose por escrito
        a la direcci&oacute;n
        arriba indicada.<br>
        <br>
        This e-mail and its attachments may include confidential
        personal information
        which may be protected by any legal rules and cannot be used,
        copied, distributed
        or disclosed to any person without authorisation. If you are not
        the intended
        recipient and have received this e-mail by mistake, please
        advise the sender
        and erase it.<br>
        <br>
        In compliance with the Spanish Organic Act 15/1999 on Personal
        Data Protection,
        we hereby inform you that your email address, as well as your
        personal
        and business information, will be included in our Management
        files and
        used solely for purposes corresponding to our commercial
        relationship.
        All personal data in our possession is protected by our Data
        Safety Policy
        and thus shall not be released to any other third party
        whatsoever. You
        may exercise your right to access, rectify, cancel and contest
        by writing
        to the address provided above. </font>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>
<a class="moz-txt-link-freetext" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>