fix logic err

This commit is contained in:
Anthony Minessale 2012-10-29 13:46:17 -05:00
parent 3812ebb958
commit d86f2c724a
1 changed files with 9 additions and 1 deletions

View File

@ -2617,7 +2617,15 @@ SWITCH_DECLARE(int) switch_core_recovery_recover(const char *technology, const c
SWITCH_DECLARE(switch_cache_db_handle_type_t) switch_core_dbtype(void)
{
return sql_manager.qm ? sql_manager.qm->event_db->type : SCDB_TYPE_CORE_DB;
switch_cache_db_handle_type_t type = SCDB_TYPE_CORE_DB;
switch_mutex_lock(sql_manager.ctl_mutex);
if (sql_manager.qm && sql_manager.qm->event_db) {
type = sql_manager.qm->event_db->type;
}
switch_mutex_unlock(sql_manager.ctl_mutex);
return type;
}
SWITCH_DECLARE(void) switch_core_sql_exec(const char *sql)