<div dir="ltr">In my test case I was doing an INSERT query... <div>yet db_cassandra would complain there was no result... ( both the log message and return code )</div><div><br></div><div>This is the reason I provided the patch.</div>

<div><br></div><div>after a little more testing I have found that I get this log message :</div><div><br></div><div>0(23827) ERROR: <core> [db_res.c:130]: db_free_result(): invalid parameter<br></div><div><br></div>

<div>So far in my testing everything has performed flawlessly, just with a few less log lines :)</div><div><br></div><div>in essence this patch simply makes db_cassandra act the same when there is no result set as it does when there are now rows.</div>

<div>( previously it would act like no result set was a big deal )</div><div><br></div><div>Jay</div><div><br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 12 March 2014 18:49, Daniel-Constantin Mierla <span dir="ltr"><<a href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    What would be the situation when the query is like SELECT but there
    is no result. Is the behaviour as expected with the new patch?<br>
    <br>
    Anyone here using cassandra having comments? From my point of view
    is no problem to push the patch, but I am not using cassandra, so
    cannot do a proper review.<br>
    <br>
    Cheers,<br>
    Daniel<div><div class="h5"><br>
    <br>
    <div>On 12/03/14 08:53, jay binks wrote:<br>
    </div>
    </div></div><blockquote type="cite"><div><div class="h5">
      <div dir="ltr">If doing a query that returns no results ( Insert
        etc )
        <div><span style="line-height:17.000099182128906px;font-size:13.333333969116211px;font-family:Arial,FreeSans,Helvetica,sans-serif">db_cassa_raw_query
            would cause these ERRORS to be logged</span>
          <div>
            <span style="line-height:17.000099182128906px;font-size:13px;font-family:Arial,FreeSans,Helvetica,sans-serif"><br>
            </span></div>
          <div><span style="line-height:17.000099182128906px;font-size:13px;font-family:Arial,FreeSans,Helvetica,sans-serif">0(22283)
              ERROR: db_cassandra </span><span style="line-height:17.000099182128906px;font-size:13px;font-family:Arial,FreeSans,Helvetica,sans-serif">[dbcassa_base.cpp:739]</span><span style="line-height:17.000099182128906px;font-size:13px;font-family:Arial,FreeSans,Helvetica,sans-serif">:
              db_cassa_raw_query(): The resultype rows was not set, no
              point trying to parse result.</span><br style="line-height:17.000099182128906px;font-size:13px;font-family:Arial,FreeSans,Helvetica,sans-serif">
            <span style="line-height:17.000099182128906px;font-size:13px;font-family:Arial,FreeSans,Helvetica,sans-serif">0(22283)
              ERROR: avpops </span><span style="line-height:17.000099182128906px;font-size:13px;font-family:Arial,FreeSans,Helvetica,sans-serif">[avpops_db.c:333]</span><span style="line-height:17.000099182128906px;font-size:13px;font-family:Arial,FreeSans,Helvetica,sans-serif">:
              db_query_avp(): cannot do the query</span><br>
          </div>
          <div><span style="line-height:17.000099182128906px;font-size:13px;font-family:Arial,FreeSans,Helvetica,sans-serif"><br>
            </span></div>
          <div><span style="line-height:17.000099182128906px;font-size:13.333333969116211px;font-family:Arial,FreeSans,Helvetica,sans-serif">db_cassa_raw_query
              would also return -1 as a failure code which caused
              avpops_db to log the query failure.</span><br>
          </div>
          <div><span style="line-height:17.000099182128906px;font-size:13.333333969116211px;font-family:Arial,FreeSans,Helvetica,sans-serif"><br>
            </span></div>
          <div><span style="line-height:17.000099182128906px;font-size:13.333333969116211px;font-family:Arial,FreeSans,Helvetica,sans-serif">my
              patch changes the </span><span style="line-height:17.000099182128906px;font-size:13.333333969116211px;font-family:Arial,FreeSans,Helvetica,sans-serif">db_cassa_raw_query
              log message to debug level, and returns success from the
              function.</span></div>
          <div><span style="line-height:17.000099182128906px;font-size:13.333333969116211px;font-family:Arial,FreeSans,Helvetica,sans-serif"><br>
            </span></div>
          <div><font color="#000000" face="Arial, FreeSans, Helvetica,
              sans-serif"><span style="line-height:17.000099182128906px">I
                had a quick look to see if there was an elegant way to
                determine if we should expect results, so we can vary
                the response code based on query type, but I was unable
                to find anything other than doing string comparisons on
                the query, so I opted to not bother with this as it
                would be erroneous.</span></font></div>
          <div><span style="line-height:17.000099182128906px;font-size:13.333333969116211px;font-family:Arial,FreeSans,Helvetica,sans-serif"><br>
            </span></div>
          <div><span style="line-height:17.000099182128906px;font-size:13.333333969116211px;font-family:Arial,FreeSans,Helvetica,sans-serif">Please
              find attached patch.</span></div>
          <div><span style="line-height:17.000099182128906px;font-size:13px;font-family:Arial,FreeSans,Helvetica,sans-serif"><br>
            </span></div>
          -- <br>
          Sincerely<br>
          <br>
          Jay
        </div>
      </div>
      <br>
      <fieldset></fieldset>
      <br>
      </div></div><pre>_______________________________________________
sr-dev mailing list
<a href="mailto:sr-dev@lists.sip-router.org" target="_blank">sr-dev@lists.sip-router.org</a>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev</a><span class="HOEnZb"><font color="#888888">
</font></span></pre><span class="HOEnZb"><font color="#888888">
    </font></span></blockquote><span class="HOEnZb"><font color="#888888">
    <br>
    <pre cols="72">-- 
Daniel-Constantin Mierla - <a href="http://www.asipto.com" target="_blank">http://www.asipto.com</a>
<a href="http://twitter.com/#!/miconda" target="_blank">http://twitter.com/#!/miconda</a> - <a href="http://www.linkedin.com/in/miconda" target="_blank">http://www.linkedin.com/in/miconda</a>
Kamailio World Conference - April 2-4, 2014, Berlin, Germany
<a href="http://www.kamailioworld.com" target="_blank">http://www.kamailioworld.com</a></pre>
  </font></span></div>

<br>_______________________________________________<br>
sr-dev mailing list<br>
<a href="mailto:sr-dev@lists.sip-router.org">sr-dev@lists.sip-router.org</a><br>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br>Sincerely<br><br>Jay
</div>