diff options
| author | Hiroshi Inoue | 2017-03-04 11:17:09 +0000 |
|---|---|---|
| committer | Hiroshi Inoue | 2017-03-04 11:26:58 +0000 |
| commit | 057744cb806533ee19ef87df5b20fb12e965b7f5 (patch) | |
| tree | ae7e1a4229a7e29e51da0ec0577c3567c59387e0 /statement.c | |
| parent | b97eb19895a43814f65fce464475d1988bc27d6a (diff) | |
The failure of libpq_bind_exec() which returns NULL doesn't mean a FATAL error. Also make a check for disconnected connections.
Diffstat (limited to 'statement.c')
| -rw-r--r-- | statement.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/statement.c b/statement.c index 616c9ea..6d66a75 100644 --- a/statement.c +++ b/statement.c @@ -765,6 +765,11 @@ BOOL SC_opencheck(StatementClass *self, const char *func) return TRUE; } } + if (CC_not_connected((ConnectionClass *) SC_get_conn(self))) + { + SC_set_error(self, STMT_SEQUENCE_ERROR, "the connection is closed", func); + return TRUE; + } return FALSE; } @@ -1887,8 +1892,10 @@ SC_execute(StatementClass *self) if (!res) { if (SC_get_errornumber(self) <= 0) + { SC_set_error(self, STMT_NO_RESPONSE, "Could not receive the response, communication down ??", func); - CC_on_abort(conn, CONN_DEAD); + CC_on_abort(conn, CONN_DEAD); + } goto cleanup; } } |
