set maximum query run time to 30 seconds at least on drivers that support SQL_ATTR_QUERY_TIMEOUT

This commit is contained in:
Michael Jerris 2011-01-05 12:30:40 -05:00
parent 2c595a6ce0
commit 5bb525e1ea
1 changed files with 2 additions and 0 deletions

View File

@ -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;