Problem with message handler
Chris Kings-Lynne <[email protected]>
| Newsgroups | gmane.comp.db.tds.freetds |
|---|---|
| Message-ID | <3e6d2752f3c24bd3b57f1401bb72de64@HKXPR02MB007.apcprd02.prod.outlook.com> |
Hi Guys, I'm trying to fix the PHP pdo_dblib driver. The issue is it never returns the actual database error message. It always says "Check SQL server messages". I've identified the problem in the message handler code here: https://github.com/php/php-src/blob/master/ext/pdo_dblib/pdo_dblib.c#L140 The problem is that the msgno always comes through as the correct underlying sql error number (eg. 208), instead of the magic one that's being expected (20018). (As seen here http://gitorious.org/freetds/freetds/source/39af613d554743ef79a4eff64e9a517f0d3db20d:include/sybdb.h#L845) So what's changed in FreeTDS because the way PHP is handling this message, it looks like it must have been returning 20018 at some stage? Ie. See how they are processing here: https://github.com/php/php-src/blob/master/ext/pdo_dblib/dblib_driver.c#L51 Cheers, Chris