patch for sqlstate (bug 1000495)
am 21.12.2005 13:55:28 von Ludek Finstrle--tKW2IUtsqtDRztdT
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Hello,
one man report bug in bug tracker. I resolve it. The problem has been
added in 8.01.0103 or 0104 (in one of my pathces - I think it was
cancel_abort one). Here is the patch.
Please review and comment
Luf
--tKW2IUtsqtDRztdT
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="psqlodbc-sqlstate.diff"
diff -c psqlodbc.orig\connection.c psqlodbc\connection.c
*** psqlodbc.orig\connection.c Sat Dec 10 08:39:31 2005
--- psqlodbc\connection.c Wed Dec 21 14:31:25 2005
***************
*** 1504,1516 ****
used_passed_result_object = TRUE;
if (!used_passed_result_object)
{
! if ((res->status == PGRES_EMPTY_QUERY) || (res->status == PGRES_FATAL_ERROR) ||
! (res->status == PGRES_BAD_RESPONSE))
{
! mylog("send_query: sended query failed -> abort\n");
QR_set_aborted(res, TRUE);
QR_Destructor(res);
! res = NULL;
goto cleanup;
}
if (create_keyset)
--- 1504,1521 ----
used_passed_result_object = TRUE;
if (!used_passed_result_object)
{
! if ((res->status == PGRES_EMPTY_QUERY) || (res->status == PGRES_BAD_RESPONSE))
{
! mylog("send_query: sending query failed -> abort\n");
QR_set_aborted(res, TRUE);
QR_Destructor(res);
! res = NULL;
+ goto cleanup;
+ }
+ else if (res->status == PGRES_FATAL_ERROR)
+ {
+ mylog("send_query: sended query failed -> abort\n");
+ QR_set_aborted(res, TRUE);
goto cleanup;
}
if (create_keyset)
--tKW2IUtsqtDRztdT
Content-Type: text/plain
Content-Disposition: inline
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend
--tKW2IUtsqtDRztdT--