[freetds] Problem with message handler

Chris Kings-Lynne Chris.Kings-Lynne at navitas.com
Fri Sep 13 02:51:53 EDT 2013

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:


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:




More information about the FreeTDS mailing list