<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hello,<br>
    <br>
    maybe this can be introduced as a module parameter option for
    db_mysql. It will allow fixing quickly via config if similar
    situation arises. If it proves to become a common case, then it can
    turned on by default.<br>
    <br>
    Cheers,<br>
    Daniel<br>
    <br>
    <div class="moz-cite-prefix">On 08/08/14 16:12, Jason Penton wrote:<br>
    </div>
    <blockquote
cite="mid:CALoGXNXnHiaQTLkhu2Or65aKbYOH0k=G4aJ+qSoAeQ6xsvUZUg@mail.gmail.com"
      type="cite">
      <div dir="ltr">Hi Alex,
        <div><br>
        </div>
        <div>I didn't check the table schemas for usrloc but I'm sure
          there may be other cases where the affected_rows function has
          been 'misunderstood'. In the code I picked this bug up
          (ims_pcscf_usrloc), I did exactly that, change the schema.
          Just wanted to discuss in case it was decided to change the
          connect flags to mitigate any future probs.</div>
        <div><br>
        </div>
        <div>Also, if you merely change the the schema, some code would
          think the update had "failed" and do some other adverse
          failure code so not sure that would be an ideal final fix...</div>
        <div><br>
        </div>
        <div>Cheers</div>
        <div>Jason</div>
      </div>
      <div class="gmail_extra"><br>
        <br>
        <div class="gmail_quote">On Fri, Aug 8, 2014 at 4:06 PM, Alex
          Hermann <span dir="ltr"><<a moz-do-not-send="true"
              href="mailto:alex@speakup.nl" target="_blank">alex@speakup.nl</a>></span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div class="">On Friday 08 August 2014, Jason Penton wrote:<br>
              > I have noticed that in some instances if you update a
              row in mysql via the<br>
              > mysql_db module and the actual row data does not
              change - affected_rows<br>
              > will return 0. This is the default behaviour for the
              mysql API as per -<br>
              > <a moz-do-not-send="true"
                href="http://dev.mysql.com/doc/refman/5.0/en/mysql-real-connect.html"
                target="_blank">http://dev.mysql.com/doc/refman/5.0/en/mysql-real-connect.html</a><br>
              ><br>
              > There is a flag (CLIENT_FOUND_ROWS) that can be used
              in the<br>
              > mysql_real_connect function that will cause
              affected_rows to return the<br>
              > number of rows that were "matched" - ie in the WHERE
              clause, as opposed to<br>
              > whether or not any data was changed.<br>
              ><br>
              > If we don't it could be a problem for modules like
              usrloc where an update<br>
              > is done and if no row are "affected" and new row is
              added which would cause<br>
              > a duplicate.<br>
              <br>
            </div>
            If that happens, the table definition is wrong. It should
            have (a) unique<br>
            key(s) to prevent double records. We'd better fix that.<br>
            <span class="HOEnZb"><font color="#888888"><br>
                <br>
                --<br>
                Greetings,<br>
                <br>
                Alex Hermann<br>
              </font></span>
            <div class="HOEnZb">
              <div class="h5"><br>
                <br>
                _______________________________________________<br>
                sr-dev mailing list<br>
                <a moz-do-not-send="true"
                  href="mailto:sr-dev@lists.sip-router.org">sr-dev@lists.sip-router.org</a><br>
                <a moz-do-not-send="true"
                  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>
              </div>
            </div>
          </blockquote>
        </div>
        <br>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
sr-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:sr-dev@lists.sip-router.org">sr-dev@lists.sip-router.org</a>
<a class="moz-txt-link-freetext" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev</a>
</pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla
<a class="moz-txt-link-freetext" href="http://twitter.com/#!/miconda">http://twitter.com/#!/miconda</a> - <a class="moz-txt-link-freetext" href="http://www.linkedin.com/in/miconda">http://www.linkedin.com/in/miconda</a>
Next Kamailio Advanced Trainings 2014 - <a class="moz-txt-link-freetext" href="http://www.asipto.com">http://www.asipto.com</a>
Sep 22-25, Berlin, Germany ::: Oct 15-17, San Francisco, USA</pre>
  </body>
</html>