From: Jeff Lenk Date: Mon, 8 Nov 2010 14:05:23 +0000 (-0600) Subject: FS-2825 add additional info when fail X-Git-Tag: v1.2-rc1~265^2~11^2~46 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4bbd9a4c0fd9ad4c23921197dc92a63c75656f21;p=thirdparty%2Ffreeswitch.git FS-2825 add additional info when fail --- diff --git a/src/switch_core_sqldb.c b/src/switch_core_sqldb.c index 9551e5dea2..509d989581 100644 --- a/src/switch_core_sqldb.c +++ b/src/switch_core_sqldb.c @@ -702,8 +702,11 @@ SWITCH_DECLARE(switch_status_t) switch_cache_db_persistant_execute_trans(switch_ if (runtime.odbc_dbtype == DBTYPE_DEFAULT) { switch_cache_db_execute_sql_real(dbh, "BEGIN", &errmsg); } else { - if (switch_odbc_SQLSetAutoCommitAttr(dbh->native_handle.odbc_dbh, 0) != SWITCH_ODBC_SUCCESS) { - errmsg = strdup("Unable to Set AutoCommit Off.");; + switch_odbc_status_t result; + if ((result = switch_odbc_SQLSetAutoCommitAttr(dbh->native_handle.odbc_dbh, 0)) != SWITCH_ODBC_SUCCESS) { + char tmp[100]; + switch_snprintf(tmp, sizeof(tmp), "%s-%i", "Unable to Set AutoCommit Off", result); + errmsg = strdup(tmp); } }