summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Kings-Lynne <chris.kingslynne@gmail.com>2013-09-13 14:09:08 +0800
committerAdam Baratz <adambaratz@php.net>2016-09-26 17:07:46 -0400
commit48b5a1f9b9f473a86c02c6461c3eb0930c9c8aa9 (patch)
tree46795216d3fce73c37480ef84b84e646d8ef5304
parent3a058e3817fab41f9986fb353f337d32283a32b3 (diff)
downloadphp-git-48b5a1f9b9f473a86c02c6461c3eb0930c9c8aa9.tar.gz
Ignore potentially misleading dberr values
FreeTDS had a buggy behavior where it would pass invalid values: https://sourceforge.net/p/freetds/bugs/59/ The fix for this issue -- bc22b2ef817fb5d102bd758111ff3634b39a1319 on their repo -- was to always use SYBESMSG for dberr. This makes it so the existing pdo_dblib code would work as is. But by ignoring the dberr value in this function, it will behave correctly, even with older versions of FreeTDS.
-rw-r--r--ext/pdo_dblib/dblib_driver.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/pdo_dblib/dblib_driver.c b/ext/pdo_dblib/dblib_driver.c
index b8ec4fb48e..70d1a1cf60 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)
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 {