};
static QResultClass *libpq_bind_and_exec(StatementClass *stmt);
-static void SC_set_errorinfo(StatementClass *self, QResultClass *res);
+static void SC_set_errorinfo(StatementClass *self, QResultClass *res, int errkind);
static void SC_set_error_if_not_set(StatementClass *self, int errornumber, const char *errmsg, const char *func);
(self->currTuple)++; /* all is well */
else
{
- SC_set_errorinfo(self, res);
+ SC_set_errorinfo(self, res, 1);
return SQL_ERROR;
}
}
else if (was_nonfatal)
SC_set_errornumber(self, STMT_INFO_ONLY);
else
- SC_set_errorinfo(self, res);
+ SC_set_errorinfo(self, res, 0);
/* set cursor before the first tuple in the list */
self->currTuple = -1;
SC_set_current_col(self, -1);
}
static void
-SC_set_errorinfo(StatementClass *self, QResultClass *res)
+SC_set_errorinfo(StatementClass *self, QResultClass *res, int errkind)
{
ConnectionClass *conn = SC_get_conn(self);
SC_set_error_if_not_set(self, STMT_INTERNAL_ERROR, "Internal error fetching next row", __FUNCTION__);
break;
default:
- SC_set_error_if_not_set(self, STMT_EXEC_ERROR, "Error fetching next row", __FUNCTION__);
+ switch (errkind)
+ {
+ case 1:
+ SC_set_error_if_not_set(self, STMT_EXEC_ERROR, "Error while fetching the next result", __FUNCTION__);
+ break;
+ default:
+ SC_set_error_if_not_set(self, STMT_EXEC_ERROR, "Error while executing the query", __FUNCTION__);
+ break;
+ }
break;
}
}
42601=xxxxxxx
42601
killing connection...
-No error information
+57P01=FATAL: terminating connection due to administrator command;
+The connection has been lost
SQLGetDiagRec on connection says:
-No error information
+57P01=FATAL: terminating connection due to administrator command
SQLGetDiagRec called again:
-No error information
+57P01=FATAL: terminating connection due to administrator command
42601
killing connection...
57P01=FATAL: terminating connection due to administrator command;
-Error while executing the query
+The connection has been lost
SQLGetDiagRec on connection says:
-57P01=FATAL: terminating connection due to administrator command
+No error information
SQLGetDiagRec called again:
-57P01=FATAL: terminating connection due to administrator command
+No error information