<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 />


<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('https://reviewboard.asterisk.orgrb/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 2011-06-15 23:55:23.757205</i></p>



<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Changes</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;">Bug fixes and improvements

1) Better logs for conversion failures
2) Add &quot;database query&quot; CLI command to execute arbitrary SQL statements on
   the astdb. Of course this is highly dangerous since a &quot;drop table astdb&quot;
   would be particularly bad. This may or may not stick around, but is 
   certainly useful for debugging right now.
3) Fix a bug with ast_db_put that crept in when changing things around for
   handling conversion via an external tool.
4) Register an atexit function to sync the database and close it.
5) Move astdb_init up in order of initialization. It is fairly self contained
   and provides an API for other parts of Asterisk. One wouldn&#39;t want someone
   to call ast_db_put before we had initialized the database.
6) Fix two bugs with the conersion utility--don&#39;t put the trailing null in the 
   key and be sure and close the database.
</pre>
  </td>
 </tr>
</table>


<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> (updated)</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>