From 5bb525e1eaf65a9784e97e9929b98ac846703e4d Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Wed, 5 Jan 2011 12:30:40 -0500 Subject: [PATCH] set maximum query run time to 30 seconds at least on drivers that support SQL_ATTR_QUERY_TIMEOUT --- src/switch_odbc.c | 2 ++ 1 file changed, 2 insertions(+) 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;