SCF_USE_WIN32_MONOTONIC = (1 << 12),
SCF_AUTO_SCHEMAS = (1 << 13),
SCF_MINIMAL = (1 << 14),
- SCF_USE_NAT_MAPPING = (1 << 15)
+ SCF_USE_NAT_MAPPING = (1 << 15),
+ SCF_CLEAR_SQL = (1 << 16)
} switch_core_flag_enum_t;
typedef uint32_t switch_core_flag_t;
runtime.dummy_cng_frame.buflen = sizeof(runtime.dummy_data);
switch_set_flag((&runtime.dummy_cng_frame), SFF_CNG);
switch_set_flag((&runtime), SCF_AUTO_SCHEMAS);
+ switch_set_flag((&runtime), SCF_CLEAR_SQL);
switch_set_flag((&runtime), SCF_NO_NEW_SESSIONS);
runtime.hard_log_level = SWITCH_LOG_DEBUG;
} else {
switch_clear_flag((&runtime), SCF_AUTO_SCHEMAS);
}
+ } else if (!strcasecmp(var, "auto-clear-sql")) {
+ if (switch_true(val)) {
+ switch_set_flag((&runtime), SCF_CLEAR_SQL);
+ } else {
+ switch_clear_flag((&runtime), SCF_CLEAR_SQL);
+ }
} else if (!strcasecmp(var, "enable-early-hangup") && switch_true(val)) {
switch_set_flag((&runtime), SCF_EARLY_HANGUP);
} else if (!strcasecmp(var, "colorize-console") && switch_true(val)) {
{
char *errmsg;
+ if (!switch_test_flag((&runtime), SCF_CLEAR_SQL)) {
+ return;
+ }
+
if (!switch_test_flag((&runtime), SCF_AUTO_SCHEMAS)) {
switch_core_db_exec(db, test_sql, NULL, NULL, NULL);
return;
switch_bool_t r = SWITCH_TRUE;
switch_mutex_t *io_mutex = dbh->io_mutex;
+ if (!switch_test_flag((&runtime), SCF_CLEAR_SQL)) {
+ return SWITCH_TRUE;
+ }
+
if (!switch_test_flag((&runtime), SCF_AUTO_SCHEMAS)) {
switch_cache_db_execute_sql(dbh, (char *)test_sql, NULL);
return SWITCH_TRUE;
switch (dbh->type) {
case SCDB_TYPE_ODBC:
- {
+ if (switch_test_flag((&runtime), SCF_CLEAR_SQL)) {
char sql[512] = "";
char *tables[] = { "channels", "calls", "interfaces", "tasks", NULL };
int i;