diff options
| author | Hiroshi Inoue | 2020-05-20 10:57:20 +0000 |
|---|---|---|
| committer | Hiroshi Inoue | 2020-05-22 11:00:39 +0000 |
| commit | acdedf66f4f5dfe39996854985eb211133736b64 (patch) | |
| tree | 16ec6edfbcc4e8a12b13ef167208dbf787406a1e /statement.c | |
| parent | 1393e7c2280ec25736c9cc83a79aeb84462ff6df (diff) | |
Add a new option IgnoreTimeout.
Some tools issue issue SQLSetStmtAttr(.., SQL_ATTR_QUERY_TIMEOUT,,) internally and sometimes it's difficult for users to change the timeout value. You can disable the timeout by turning on this option.
Diffstat (limited to 'statement.c')
| -rw-r--r-- | statement.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/statement.c b/statement.c index c1c07fe..93964fb 100644 --- a/statement.c +++ b/statement.c @@ -1854,6 +1854,7 @@ SC_execute(StatementClass *self) BOOL useCursor, isSelectType; int errnum_sav = STMT_OK, errnum; char *errmsg_sav = NULL; + SQLULEN stmt_timeout; conn = SC_get_conn(self); ci = &(conn->connInfo); @@ -1938,15 +1939,16 @@ SC_execute(StatementClass *self) * If the session query timeout setting differs from the statement one, * change it. */ - if (conn->stmt_timeout_in_effect != self->options.stmt_timeout) + stmt_timeout = conn->connInfo.ignore_timeout ? 0 : self->options.stmt_timeout; + if (conn->stmt_timeout_in_effect != stmt_timeout) { char query[64]; SPRINTF_FIXED(query, "SET statement_timeout = %d", - (int) self->options.stmt_timeout * 1000); + (int) stmt_timeout * 1000); res = CC_send_query(conn, query, NULL, 0, NULL); if (QR_command_maybe_successful(res)) - conn->stmt_timeout_in_effect = self->options.stmt_timeout; + conn->stmt_timeout_in_effect = stmt_timeout; QR_Destructor(res); } |
