Skip to Content.
Sympa Menu

freetds - RE: mssql_query not updating mssql_get_last_message on php4.1.2 and freetds 0.53

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Tom Sillence" <tom.sillence AT enformatica.com>
  • To: "TDS Development Group" <freetds AT franklin.metalab.unc.edu>
  • Subject: RE: mssql_query not updating mssql_get_last_message on php4.1.2 and freetds 0.53
  • Date: Thu, 30 May 2002 01:55:21 +0100


Thanks for a friendly welcome to the list.

The bug I identified is indeed fixed in the latest CVS version. I should
have checked but I am forced by my sysadmins to use the stable 0.53.
However, for those who are interested, the patch at the bottom of this email
(it is extremely short and simple) can be applied to php. It makes php keep
track of the last error message from the database. In the future, I would
like to see php track the last several errors, but this patch at least gives
equivalent functionality to that of the windows drivers. It is taken
relative to php4.2.1 but the code in question hasn't changed at least since
4.1. The patch should be applied to php_sybase_db.c in ./ext/sybase/
The values returned from this function and its message handling counterpart
are not used by freeTDS's dblib. I am not sure, therefore, what the
INT_CANCEL return value signified. For all I know it may be more appropriate
than returning 0 (I have made this change to keep parity with
php_sybase_message_handler), but it won't have any effect in the current
implementation anyway.

I hope I can be of more relevant help to freeTDS in the future.

[context patch follows]

*** php_sybase_db.c Wed Mar 6 15:59:42 2002
--- ../../../php-4.2.1-patched/ext/sybase/php_sybase_db.c Wed May 29
18:42:59 2002
***************
*** 146,152 ****
if (severity >= php_sybase_module.min_error_severity) {
php_error(E_WARNING,"Sybase error: %s (severity
%d)",dberrstr,severity);
}
! return INT_CANCEL;
}

/* message handler */
--- 146,158 ----
if (severity >= php_sybase_module.min_error_severity) {
php_error(E_WARNING,"Sybase error: %s (severity
%d)",dberrstr,severity);
}
!
!
! STR_FREE(php_sybase_module.server_message);
! php_sybase_module.server_message = estrdup(dberrstr);
! return 0;
!
! // return INT_CANCEL;
}

/* message handler */







Archive powered by MHonArc 2.6.24.

Top of Page