From: Mike Jerris Date: Tue, 17 Nov 2020 00:08:43 +0000 (-0700) Subject: [core] improve logging on oversized fields in odbc X-Git-Tag: v1.10.6^2~40 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7539921ecae86df78b7c198e31103d817c4ad307;p=thirdparty%2Ffreeswitch.git [core] improve logging on oversized fields in odbc --- diff --git a/src/switch_odbc.c b/src/switch_odbc.c index 9ea062d997..4445eb4c1f 100644 --- a/src/switch_odbc.c +++ b/src/switch_odbc.c @@ -644,25 +644,25 @@ SWITCH_DECLARE(switch_odbc_status_t) switch_odbc_handle_callback_exec_detailed(c } if (truncated) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "sql data truncated - %s\n",SqlState); if (StrLen_or_IndPtr && StrLen_or_IndPtr <= 268435456) { ColumnSize = StrLen_or_IndPtr + 1; vals[y] = malloc(ColumnSize); switch_assert(vals[y]); memset(vals[y], 0, ColumnSize); SQLGetData(stmt, x, SQL_C_CHAR, (SQLCHAR *) vals[y], ColumnSize, NULL); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "SQLGetData large column [%lu]\n", (unsigned long)ColumnSize); } else { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "SQLGetData failed"); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "sql data truncated - %s\n",SqlState); vals[y] = NULL; } } else { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "SQLGetData failed"); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "SQLGetData failed\n"); vals[y] = NULL; } } else if (rc == SQL_SUCCESS){ vals[y] = strdup((char *)val); } else { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "SQLGetData failed"); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "SQLGetData failed\n"); vals[y] = NULL; } } else {