core_trunks_list() is one function where this manifests itself as soon as you start having multiple trunks in sqlite3. The issue is that sqlite3 treats "_" as a wildcard and has a special syntax to create an escape character. The following two queries are problematic but all of the code base needs to be searched as there are others:
$sqlstr = "SELECT variable, value FROM globals WHERE variable LIKE 'OUT_%'";
$my_unique_trunks = sql($sqlstr,"getAll",DB_FETCHMODE_ASSOC);
$sqlstr = "SELECT variable, value FROM globals WHERE variable LIKE 'OUTDISABLE_%'";
$disable_states = sql($sqlstr,"getAll",DB_FETCHMODE_ASSOC);
and the following syntax fixed them:
$sqlstr = "SELECT variable, value FROM globals WHERE variable LIKE 'OUT\_%' ESCAPE '\'";
$my_unique_trunks = sql($sqlstr,"getAll",DB_FETCHMODE_ASSOC);
$sqlstr = "SELECT variable, value FROM globals WHERE variable LIKE 'OUTDISABLE\_%' ESCAPE '\'";
$disable_states = sql($sqlstr,"getAll",DB_FETCHMODE_ASSOC);