<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    I updated the wiki page putting backticks around column names.<br>
    <br>
    Mysql keep adding to the list of reserved keywords, so using
    backticks is the safest in the long term, as current named columns
    can become keywords in the future -- e.g., partition was not
    reserved before v5.6<br>
    <br>
    Cheers,<br>
    Daniel<br>
    <br>
    <div class="moz-cite-prefix">On 20/07/15 19:32, José Seabra wrote:<br>
    </div>
    <blockquote
cite="mid:CAEVZRWtovt6QCuK_mTtsdJ9V1cL10OQQCmRk=UMJRrAPjSCzeA@mail.gmail.com"
      type="cite">
      <div dir="ltr">I found the root cause of this issue, as i copied
        the mysql commands from this link <a moz-do-not-send="true"
          href="http://www.kamailio.org/wiki/install/upgrade/4.2.x-to-4.3.0">http://www.kamailio.org/wiki/install/upgrade/4.2.x-to-4.3.0</a>
        and pasted it in mysql client, apparently that was my issue,
        what i did to fix this issue was drop the column and add it
        again but with this mysql command:  
        <div><br>
        </div>
        <div>ALTER TABLE location ADD COLUMN `partition` INT(11) DEFAULT
          0 NOT NULL;</div>
        <div><br>
        </div>
        <div>The difference between  this  mysql command  is that I'm
          using quotes in column name and the mysql commands that are in
          the link specified above doesn't have the quotes in column
          names.<br>
          <br>
          I shouldn't have copy these commands without fix it.<br>
        </div>
        <div><br>
        </div>
        <div>Thank you for your help.</div>
        <div><br>
          BR<br>
          José Seabra<br>
          <div><br>
          </div>
          <div><br>
          </div>
        </div>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">2015-07-20 17:46 GMT+01:00 José Seabra
          <span dir="ltr"><<a moz-do-not-send="true"
              href="mailto:joseseabra4@gmail.com" target="_blank">joseseabra4@gmail.com</a>></span>:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div dir="ltr">I changed the column name in the database
              table from partition to partitionusrloc, and i added a new
              modparam (<span style="font-size:12.8000001907349px">partition_col</span>)
              in <span style="font-size:12.8000001907349px">modules/usrloc/ul_mod.c  file:</span><span
                class="">
                <div style="font-size:12.8000001907349px"><br>
                </div>
                <div style="font-size:12.8000001907349px">{"partition_col",
                        PARAM_STR, &partition_col},<br>
                </div>
                <div><br>
                </div>
                <div><br>
                </div>
              </span>
              <div>in order to be able to configure the name of this
                column from partition to partitionusrloc in kamailio
                module configuration section, with following
                configuration:</div>
              <span class="">
                <div><br>
                </div>
                <div><span style="font-size:12.8000001907349px">modparam("usrloc",
                    "partition_col", "partitionusrloc")</span><br>
                </div>
                <div><br>
                </div>
              </span>
              <div>I will enable the mysql log then collect the query
                log, and reply back to you with this information.</div>
              <div><br>
              </div>
              <div>BR</div>
              <div>Thank you.</div>
              <div class="gmail_extra">
                <div>
                  <div class="h5"><br>
                    <div class="gmail_quote">2015-07-20 17:24 GMT+01:00
                      Daniel-Constantin Mierla <span dir="ltr"><<a
                          moz-do-not-send="true"
                          href="mailto:miconda@gmail.com"
                          target="_blank">miconda@gmail.com</a>></span>:<br>
                      <blockquote class="gmail_quote" style="margin:0 0
                        0 .8ex;border-left:1px #ccc
                        solid;padding-left:1ex">
                        <div bgcolor="#FFFFFF" text="#000000"> Hello,<br>
                          <br>
                          the backticks should be added for columns in
                          where condition. Can you enable logging the
                          query in mysql server logs and send it over to
                          see how it looks?<br>
                          <br>
                          Or maybe I didn't understand your problem
                          properly and you changed the name in the
                          database table for column partition, but there
                          was no way to change that to usrloc module?<br>
                          <br>
                          Cheers,<br>
                          Daniel
                          <div>
                            <div><br>
                              <br>
                              <div>On 20/07/15 18:04, José Seabra wrote:<br>
                              </div>
                            </div>
                          </div>
                          <blockquote type="cite">
                            <div>
                              <div>
                                <div dir="ltr">Hello Daniel,
                                  <div><br>
                                  </div>
                                  <div>Result of command kamailio -v</div>
                                  <div><br>
                                  </div>
                                  <div>version: kamailio 4.3.1
                                    (x86_64/linux) f38e67-dirty<br>
                                  </div>
                                  <div>
                                    <div>flags: STATS: Off, USE_TCP,
                                      USE_TLS, USE_SCTP, TLS_HOOKS,
                                      USE_RAW_SOCKS, DISABLE_NAGLE,
                                      USE_MCAST, DNS_IP_HACK, SHM_MEM,
                                      SHM_MMAP, PKG_MALLOC, F_MALLOC,
                                      DBG_F_MALLOC, USE_FUTEX,
                                      FAST_LOCK-ADAPTIVE_WAIT,
                                      USE_DNS_CACHE, USE_DNS_FAILOVER,
                                      USE_NAPTR, USE_DST_BLACKLIST,
                                      HAVE_RESOLV_RES</div>
                                    <div>ADAPTIVE_WAIT_LOOPS=1024,
                                      MAX_RECV_BUFFER_SIZE 262144,
                                      MAX_LISTEN 16, MAX_URI_SIZE 1024,
                                      BUF_SIZE 65535, DEFAULT PKG_SIZE
                                      8MB</div>
                                    <div>poll method support: poll,
                                      epoll_lt, epoll_et, sigio_rt,
                                      select.</div>
                                    <div>id: f38e67 -dirty</div>
                                    <div>compiled on 15:56:29 Jul 20
                                      2015 with gcc 4.4.7</div>
                                  </div>
                                  <div><br>
                                  </div>
                                  <div>Thank you for your support</div>
                                  <div><br>
                                  </div>
                                  <div>BR</div>
                                  <div>José Seabra</div>
                                </div>
                              </div>
                            </div>
                            <div class="gmail_extra"><br>
                              <div class="gmail_quote">
                                <div>
                                  <div>2015-07-20 16:58 GMT+01:00
                                    Daniel-Constantin Mierla <span
                                      dir="ltr"><<a
                                        moz-do-not-send="true"
                                        href="mailto:miconda@gmail.com"
                                        target="_blank">miconda@gmail.com</a>></span>:<br>
                                  </div>
                                </div>
                                <blockquote class="gmail_quote"
                                  style="margin:0 0 0
                                  .8ex;border-left:1px #ccc
                                  solid;padding-left:1ex">
                                  <div>
                                    <div>Hello,<br>
                                      <br>
                                      the names of columns should be
                                      quoted in order to be safe against<br>
                                      reserved keywords.<br>
                                      <br>
                                      What is the exact version you are
                                      using (kamailio -v)?<br>
                                      <br>
                                      Cheers,<br>
                                      Daniel<br>
                                      <span><br>
                                        On 20/07/15 17:37, José Seabra
                                        wrote:<br>
                                        > Hello Daniel,<br>
                                        ><br>
                                        > After update my kamailio to
                                        version 4.3 and change the table
                                        location<br>
                                        > as required in migration
                                        process, kamailio start giving
                                        some errors:<br>
                                        ><br>
                                        > [root@ccp1 kamailio]#
                                        35(7637) ERROR: db_mysql
                                        [km_dbase.c:121]:<br>
                                        > db_mysql_submit_query():
                                        driver error on query: Unknown
                                        column<br>
                                        > 'partition' in 'where
                                        clause'<br>
                                        > 35(7637) ERROR:
                                        <core> [db_query.c:132]:
                                        db_do_query_internal(): error<br>
                                        > while submitting query<br>
                                        ><br>
                                        > that's is because the
                                        column name "partition" is
                                        reserved word<br>
                                      </span>> (<a
                                        moz-do-not-send="true"
                                        href="http://dev.mysql.com/doc/refman/5.6/en/keywords.html"
                                        rel="noreferrer" target="_blank">http://dev.mysql.com/doc/refman/5.6/en/keywords.html</a>)
                                      in mysql<br>
                                      <div>
                                        <div>> ndbcluster engine, so
                                          what i did to fix this issue
                                          was add a new<br>
                                          > modparam in<br>
                                          > modules/usrloc/ul_mod.c
                                          file:<br>
                                          ><br>
                                          > {"partition_col",     
                                           PARAM_STR,
                                          &partition_col},<br>
                                          ><br>
                                          ><br>
                                          > with this i can configure
                                          what name i want for this
                                          column in kamailio<br>
                                          > module configuration and
                                          configure a diferent column
                                          name in  table<br>
                                          > location(ex:
                                          modparam("usrloc",
                                          "partition_col",
                                          "partitionusrloc") ),<br>
                                          >  Can you please check out
                                          if what i did is the correct
                                          way to fix it,<br>
                                          > in order to avoid damage
                                          something else.<br>
                                          ><br>
                                          > Best regards<br>
                                          > --<br>
                                          > Cumprimentos<br>
                                          > José Seabra<br>
                                          <br>
                                        </div>
                                      </div>
                                    </div>
                                  </div>
                                  <span><font color="#888888">--<br>
                                      Daniel-Constantin Mierla<br>
                                      <a moz-do-not-send="true"
                                        href="http://twitter.com/#%21/miconda"
                                        rel="noreferrer" target="_blank">http://twitter.com/#!/miconda</a>
                                      - <a moz-do-not-send="true"
                                        href="http://www.linkedin.com/in/miconda"
                                        rel="noreferrer" target="_blank">http://www.linkedin.com/in/miconda</a><span><br>
                                        Book: SIP Routing With Kamailio
                                        - <a moz-do-not-send="true"
                                          href="http://www.asipto.com"
                                          rel="noreferrer"
                                          target="_blank">http://www.asipto.com</a><br>
                                        <br>
                                      </span></font></span></blockquote>
                              </div>
                              <br>
                              <br clear="all">
                              <span><font color="#888888">
                                  <div><br>
                                  </div>
                                  -- <br>
                                  <div>Cumprimentos
                                    <div>José Seabra</div>
                                  </div>
                                </font></span></div>
                          </blockquote>
                          <span> <br>
                            <pre cols="72">-- 
Daniel-Constantin Mierla
<a moz-do-not-send="true" href="http://twitter.com/#%21/miconda" target="_blank">http://twitter.com/#!/miconda</a> - <a moz-do-not-send="true" href="http://www.linkedin.com/in/miconda" target="_blank">http://www.linkedin.com/in/miconda</a>
Book: SIP Routing With Kamailio - <a moz-do-not-send="true" href="http://www.asipto.com" target="_blank">http://www.asipto.com</a></pre>
                          </span></div>
                      </blockquote>
                    </div>
                    <br>
                    <br clear="all">
                    <div><br>
                    </div>
                  </div>
                </div>
                <span class="HOEnZb"><font color="#888888">-- <br>
                    <div>Cumprimentos
                      <div>José Seabra</div>
                    </div>
                  </font></span></div>
            </div>
          </blockquote>
        </div>
        <br>
        <br clear="all">
        <div><br>
        </div>
        -- <br>
        <div class="gmail_signature">Cumprimentos
          <div>José Seabra</div>
        </div>
      </div>
    </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>
Book: SIP Routing With Kamailio - <a class="moz-txt-link-freetext" href="http://www.asipto.com">http://www.asipto.com</a></pre>
  </body>
</html>