summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorAdam Baratz <adambaratz@php.net>2016-09-13 16:43:33 -0400
committerAdam Baratz <adambaratz@php.net>2016-09-13 16:43:33 -0400
commit0de333bd6279249096be4f040838e658b009da47 (patch)
tree70e8ef55dded51c7f58d1c77329b03df681a09dd /ext
parent69eef8c361c930d406254db16d0479fa74075e92 (diff)
downloadphp-git-0de333bd6279249096be4f040838e658b009da47.tar.gz
Adjust error formatting so ext/pdo/tests/bug_43130.phpt passes with pdo_dblib
Diffstat (limited to 'ext')
-rw-r--r--ext/pdo_dblib/dblib_driver.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/ext/pdo_dblib/dblib_driver.c b/ext/pdo_dblib/dblib_driver.c
index 66e7d79fbd..3e0529fa1d 100644
--- a/ext/pdo_dblib/dblib_driver.c
+++ b/ext/pdo_dblib/dblib_driver.c
@@ -57,6 +57,11 @@ static int dblib_fetch_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *info)
msg = einfo->dberrstr;
}
+ /* don't return anything if there's nothing to return */
+ if (msg == NULL && einfo->dberr == 0 && einfo->oserr == 0 && einfo->severity == 0) {
+ return 0;
+ }
+
spprintf(&message, 0, "%s [%d] (severity %d) [%s]",
msg, einfo->dberr, einfo->severity, stmt ? stmt->active_query_string : "");