From: Michael Jerris Date: Wed, 5 Jan 2011 17:30:40 +0000 (-0500) Subject: set maximum query run time to 30 seconds at least on drivers that support SQL_ATTR_QU... X-Git-Tag: v1.2-rc1~221^2~9^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5bb525e1eaf65a9784e97e9929b98ac846703e4d;p=thirdparty%2Ffreeswitch.git set maximum query run time to 30 seconds at least on drivers that support SQL_ATTR_QUERY_TIMEOUT --- diff --git a/src/switch_odbc.c b/src/switch_odbc.c index 932d72e580..31fd8f5cf7 100644 --- a/src/switch_odbc.c +++ b/src/switch_odbc.c @@ -165,6 +165,8 @@ static int db_is_up(switch_odbc_handle_t *handle) goto error; } + SQLSetStmtAttr(stmt, SQL_ATTR_QUERY_TIMEOUT, (SQLPOINTER)30, 0); + if (SQLPrepare(stmt, sql, SQL_NTS) != SQL_SUCCESS) { code = __LINE__; goto error;