Replace Berkeley DB with SQLite 3

There were some bugs in the very ancient version of Berkeley DB that Asterisk
used. Instead of spending the time tracking down the bugs in the Berkeley code
we move to the much better documented SQLite 3.

Conversion of the old astdb happens at runtime by running the included
astdb2sqlite3 utility. The ast_db API with SQLite 3 backend should behave
identically to the old Berkeley backend, but in the future we could offer a
much more robust interface.

We do not include the SQLite 3 library in the source tree, but instead rely
upon the distribution-provided libraries. SQLite is so ubiquitous that this
should not place undue burden on administrators.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@326589 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Terry Wilson
2011-07-06 20:58:12 +00:00
parent a7c6f0445e
commit efd040cd11
60 changed files with 1150 additions and 802 deletions

View File

@@ -205,10 +205,37 @@ AST_TEST_DEFINE(gettree_deltree)
return res;
}
AST_TEST_DEFINE(perftest)
{
int res = AST_TEST_PASS;
size_t x;
char buf[10];
switch (cmd) {
case TEST_INIT:
info->name = "perftest";
info->category = "/main/astdb/";
info->summary = "astdb performance unit test";
info->description =
"Measure astdb performance";
return AST_TEST_NOT_RUN;
case TEST_EXECUTE:
break;
}
for (x = 0; x < 100000; x++) {
sprintf(buf, "%zu", x);
ast_db_put("astdbtest", buf, buf);
}
ast_db_deltree("astdbtest", NULL);
return res;
}
static int unload_module(void)
{
AST_TEST_UNREGISTER(put_get_del);
AST_TEST_UNREGISTER(gettree_deltree);
AST_TEST_UNREGISTER(perftest);
return 0;
}
@@ -216,6 +243,7 @@ static int load_module(void)
{
AST_TEST_REGISTER(put_get_del);
AST_TEST_REGISTER(gettree_deltree);
AST_TEST_REGISTER(perftest);
return AST_MODULE_LOAD_SUCCESS;
}