<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
    <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="https://reviewboard.asterisk.org/r/1269/">https://reviewboard.asterisk.org/r/1269/</a>
     </td>
    </tr>
   </table>
   <br />








<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
 <p style="margin-top: 0;">On July 6th, 2011, 1:08 p.m., <b>Russell Bryant</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  



<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
 <thead>
  <tr>
   <th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
    <a href="https://reviewboard.asterisk.org/r/1269/diff/4/?file=16953#file16953line50" style="color: black; font-weight: bold; text-decoration: underline;">/utils/astdb2sqlite3.c</a>
    <span style="font-weight: normal;">

     (Diff revision 4)

    </span>
   </th>
  </tr>
 </thead>

 <tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
  <tr>

   <td colspan="2"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
   <td colspan="2"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">DEFINE_SQL_STATEMENT(put_stmt, &quot;INSERT OR REPLACE INTO astdb (key, value) VALUES (?, ?)&quot;)</pre></td>

  </tr>
 </tbody>




 
 



 <tbody>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
    <th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">50</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">DEFINE_SQL_STATEMENT(create_astdb_stmt, &quot;CREATE TABLE IF NOT EXISTS astdb(key VARCHAR(256), value VARCHAR(256), PRIMARY KEY(key))&quot;)</pre></td>
  </tr>

 </tbody>

</table>

  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">I see a bunch of places in the code where 256 is the limit on key length.  However, I&#39;m afraid if 256 is a hard limit on the value, that will be seen as a regression.  It&#39;s much higher than that for most uses I think.  It&#39;s whatever the buffer sizes are that get passed into the func_db code, I guess.</pre>
 </blockquote>





</blockquote>
<pre style="margin-left: 1em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">I was wrong.  Nevermind.</pre>
<br />




<p>- Russell</p>


<br />
<p>On June 15th, 2011, 11:55 p.m., Terry Wilson wrote:</p>






<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('https://reviewboard.asterisk.org/media/rb/images/review_request_box_top_bg.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
 <tr>
  <td>

<div>Review request for Asterisk Developers.</div>
<div>By Terry Wilson.</div>


<p style="color: grey;"><i>Updated June 15, 2011, 11:55 p.m.</i></p>




<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">There have been a couple of bugs reported lately against the Berkeley DB version that Asterisk uses for its internal database. These bugs have been tracked to the actual Berkeley code Asterisk uses, which is very very old and unmaintained. This patch replaces the Berkeley code with SQLite3 while maintaining exactly the same API. If there is no sqlite3 version of the database already and there is a Berkeley DB version, it automatically converts the old database to the new format.

If this goes in, I would then like to update Olle&#39;s patch for Realtime support for astdb as well and get that in.</pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">All astdb tests pass and I have tested converting several astdb databases.</pre>
  </td>
 </tr>
</table>




<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>/trunk/configure.ac <span style="color: grey">(323928)</span></li>

 <li>/trunk/main/Makefile <span style="color: grey">(323928)</span></li>

 <li>/trunk/main/asterisk.c <span style="color: grey">(323928)</span></li>

 <li>/trunk/main/db.c <span style="color: grey">(323928)</span></li>

 <li>/trunk/tests/test_db.c <span style="color: grey">(323928)</span></li>

 <li>/trunk/utils/Makefile <span style="color: grey">(323928)</span></li>

 <li>/trunk/utils/astdb2sqlite3.c <span style="color: grey">(PRE-CREATION)</span></li>

 <li>/trunk/utils/db1-ast/Makefile <span style="color: grey">(PRE-CREATION)</span></li>

 <li>/trunk/utils/db1-ast/btree/bt_close.c <span style="color: grey">(PRE-CREATION)</span></li>

 <li>/trunk/utils/db1-ast/btree/bt_conv.c <span style="color: grey">(PRE-CREATION)</span></li>

 <li>/trunk/utils/db1-ast/btree/bt_debug.c <span style="color: grey">(PRE-CREATION)</span></li>

 <li>/trunk/utils/db1-ast/btree/bt_delete.c <span style="color: grey">(PRE-CREATION)</span></li>

 <li>/trunk/utils/db1-ast/btree/bt_get.c <span style="color: grey">(PRE-CREATION)</span></li>

 <li>/trunk/utils/db1-ast/btree/bt_open.c <span style="color: grey">(PRE-CREATION)</span></li>

 <li>/trunk/utils/db1-ast/btree/bt_overflow.c <span style="color: grey">(PRE-CREATION)</span></li>

 <li>/trunk/utils/db1-ast/btree/bt_page.c <span style="color: grey">(PRE-CREATION)</span></li>

 <li>/trunk/utils/db1-ast/btree/bt_put.c <span style="color: grey">(PRE-CREATION)</span></li>

 <li>/trunk/utils/db1-ast/btree/bt_search.c <span style="color: grey">(PRE-CREATION)</span></li>

 <li>/trunk/utils/db1-ast/btree/bt_seq.c <span style="color: grey">(PRE-CREATION)</span></li>

 <li>/trunk/utils/db1-ast/btree/bt_split.c <span style="color: grey">(PRE-CREATION)</span></li>

 <li>/trunk/utils/db1-ast/btree/bt_utils.c <span style="color: grey">(PRE-CREATION)</span></li>

 <li>/trunk/utils/db1-ast/btree/btree.h <span style="color: grey">(PRE-CREATION)</span></li>

 <li>/trunk/utils/db1-ast/btree/extern.h <span style="color: grey">(PRE-CREATION)</span></li>

 <li>/trunk/utils/db1-ast/db/db.c <span style="color: grey">(PRE-CREATION)</span></li>

 <li>/trunk/utils/db1-ast/hash/README <span style="color: grey">(PRE-CREATION)</span></li>

 <li>/trunk/utils/db1-ast/hash/extern.h <span style="color: grey">(PRE-CREATION)</span></li>

 <li>/trunk/utils/db1-ast/hash/hash.h <span style="color: grey">(PRE-CREATION)</span></li>

 <li>/trunk/utils/db1-ast/hash/hash.c <span style="color: grey">(PRE-CREATION)</span></li>

 <li>/trunk/utils/db1-ast/hash/hash_bigkey.c <span style="color: grey">(PRE-CREATION)</span></li>

 <li>/trunk/utils/db1-ast/hash/hash_buf.c <span style="color: grey">(PRE-CREATION)</span></li>

 <li>/trunk/utils/db1-ast/hash/hash_func.c <span style="color: grey">(PRE-CREATION)</span></li>

 <li>/trunk/utils/db1-ast/hash/hash_log2.c <span style="color: grey">(PRE-CREATION)</span></li>

 <li>/trunk/utils/db1-ast/hash/hash_page.c <span style="color: grey">(PRE-CREATION)</span></li>

 <li>/trunk/utils/db1-ast/hash/hsearch.c <span style="color: grey">(PRE-CREATION)</span></li>

 <li>/trunk/utils/db1-ast/hash/ndbm.c <span style="color: grey">(PRE-CREATION)</span></li>

 <li>/trunk/utils/db1-ast/hash/page.h <span style="color: grey">(PRE-CREATION)</span></li>

 <li>/trunk/utils/db1-ast/hash/search.h <span style="color: grey">(PRE-CREATION)</span></li>

 <li>/trunk/utils/db1-ast/include/circ-queue.h <span style="color: grey">(PRE-CREATION)</span></li>

 <li>/trunk/utils/db1-ast/include/compat.h <span style="color: grey">(PRE-CREATION)</span></li>

 <li>/trunk/utils/db1-ast/include/db.h <span style="color: grey">(PRE-CREATION)</span></li>

 <li>/trunk/utils/db1-ast/include/mpool.h <span style="color: grey">(PRE-CREATION)</span></li>

 <li>/trunk/utils/db1-ast/include/ndbm.h <span style="color: grey">(PRE-CREATION)</span></li>

 <li>/trunk/utils/db1-ast/libdb.map <span style="color: grey">(PRE-CREATION)</span></li>

 <li>/trunk/utils/db1-ast/mpool/README <span style="color: grey">(PRE-CREATION)</span></li>

 <li>/trunk/utils/db1-ast/mpool/mpool.c <span style="color: grey">(PRE-CREATION)</span></li>

 <li>/trunk/utils/db1-ast/recno/extern.h <span style="color: grey">(PRE-CREATION)</span></li>

 <li>/trunk/utils/db1-ast/recno/rec_close.c <span style="color: grey">(PRE-CREATION)</span></li>

 <li>/trunk/utils/db1-ast/recno/rec_delete.c <span style="color: grey">(PRE-CREATION)</span></li>

 <li>/trunk/utils/db1-ast/recno/rec_get.c <span style="color: grey">(PRE-CREATION)</span></li>

 <li>/trunk/utils/db1-ast/recno/rec_open.c <span style="color: grey">(PRE-CREATION)</span></li>

 <li>/trunk/utils/db1-ast/recno/rec_put.c <span style="color: grey">(PRE-CREATION)</span></li>

 <li>/trunk/utils/db1-ast/recno/rec_search.c <span style="color: grey">(PRE-CREATION)</span></li>

 <li>/trunk/utils/db1-ast/recno/rec_seq.c <span style="color: grey">(PRE-CREATION)</span></li>

 <li>/trunk/utils/db1-ast/recno/rec_utils.c <span style="color: grey">(PRE-CREATION)</span></li>

 <li>/trunk/utils/db1-ast/recno/recno.h <span style="color: grey">(PRE-CREATION)</span></li>

 <li>/trunk/utils/utils.xml <span style="color: grey">(323928)</span></li>

</ul>

<p><a href="https://reviewboard.asterisk.org/r/1269/diff/" style="margin-left: 3em;">View Diff</a></p>




  </td>
 </tr>
</table>








  </div>
 </body>
</html>