From b59bdf7af73a18d2e2b276cfa79a78a750876e93 Mon Sep 17 00:00:00 2001 From: Chris Kings-Lynne Date: Fri, 13 Sep 2013 14:09:08 +0800 Subject: [PATCH] FreeTDS doesn't seem to be returning the general error number any more, but the actual error number. This means that you get no useful error messages whatsoever. This change shows the message handler's string instead of the error string, whenever the severity > 0 --- ext/pdo_dblib/dblib_driver.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/pdo_dblib/dblib_driver.c b/ext/pdo_dblib/dblib_driver.c index b49ad2691f645..a79d847ba4f04 100644 --- a/ext/pdo_dblib/dblib_driver.c +++ b/ext/pdo_dblib/dblib_driver.c @@ -48,9 +48,9 @@ static int dblib_fetch_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *info TSRMLS einfo = &S->err; } - if (einfo->dberr == SYBESMSG && einfo->lastmsg) { + if (einfo->lastmsg) { msg = einfo->lastmsg; - } else if (einfo->dberr == SYBESMSG && DBLIB_G(err).lastmsg) { + } else if (DBLIB_G(err).lastmsg) { msg = DBLIB_G(err).lastmsg; DBLIB_G(err).lastmsg = NULL; } else {