<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 />
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Update the CHANGES and Upgrade.txt files, as well</pre>
<br />
<div>
<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=16950#file16950line202" style="color: black; font-weight: bold; text-decoration: underline;">/main/db.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="4"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">ASTERISK_FILE_VERSION(__FILE__, "$Revision$")</pre></td>
</tr>
</tbody>
<tbody>
<tr>
<th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">173</font></th>
<td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">        ast_mutex_lock(&dblock);</pre></td>
<th bgcolor="#e9eaa8" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">191</font></th>
<td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">        if (!(dbname = alloca(strlen(ast_config_AST_DB) + sizeof(".sqlite3")))) {</pre></td>
</tr>
</tbody>
<tbody>
<tr>
<th bgcolor="#ebb1ba" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">174</font></th>
<td bgcolor="#ffc5ce" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">        if (dbinit()) {</pre></td>
<th bgcolor="#ebb1ba" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
<td bgcolor="#ffc5ce" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
</tr>
<tr>
<th bgcolor="#ebb1ba" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">175</font></th>
<td bgcolor="#ffc5ce" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">                ast_mutex_unlock(&dblock);</pre></td>
<th bgcolor="#ebb1ba" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
<td bgcolor="#ffc5ce" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
</tr>
</tbody>
<tbody>
<tr>
<th bgcolor="#f0f0f0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">176</font></th>
<td bgcolor="#ffffff" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">                return -1;</pre></td>
<th bgcolor="#f0f0f0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">192</font></th>
<td bgcolor="#ffffff" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">                return -1;</pre></td>
</tr>
<tr>
<th bgcolor="#f0f0f0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">177</font></th>
<td bgcolor="#ffffff" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">        }</pre></td>
<th bgcolor="#f0f0f0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">193</font></th>
<td bgcolor="#ffffff" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">        }</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">194</font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">        strcpy(dbname, ast_config_AST_DB);</pre></td>
</tr>
<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">195</font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">        strcat(dbname, ".sqlite3");</pre></td>
</tr>
</tbody>
</table>
<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">You can use ast_str on the stack here</pre>
</div>
<br />
<div>
<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, "INSERT OR REPLACE INTO astdb (key, value) VALUES (?, ?)")</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, "CREATE TABLE IF NOT EXISTS astdb(key VARCHAR(256), value VARCHAR(256), PRIMARY KEY(key))")</pre></td>
</tr>
</tbody>
</table>
<pre style="margin-left: 2em; 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'm afraid if 256 is a hard limit on the value, that will be seen as a regression. It's much higher than that for most uses I think. It's whatever the buffer sizes are that get passed into the func_db code, I guess.</pre>
</div>
<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'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>