com php-src: Adjust error formatting so ext/pdo/tests/bug_4 3130.phpt passes with pdo_dblib: ext/pdo _dblib/dblib_driver.c
| From: | Adam Baratz | Date: | Tue, 13 Sep 2016 20:43:33 +0000 |
| Subject: | com php-src: Adjust error formatting so ext/pdo/tests/bug_4 3130.phpt passes with pdo_dblib: ext/pdo _dblib/dblib_driver.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-94502@lists.php.net to get a copy of this message | ||
Commit: 0de333bd6279249096be4f040838e658b009da47
Author: Adam Baratz <adambaratz@php.net> Tue, 13 Sep 2016 16:43:33 -0400
Parents: 69eef8c361c930d406254db16d0479fa74075e92
Branches: PHP-7.0
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=0de333bd6279249096be4f040838e658b009da47
Log:
Adjust error formatting so ext/pdo/tests/bug_43130.phpt passes with pdo_dblib
Changed paths:
M ext/pdo_dblib/dblib_driver.c
Diff:
diff --git a/ext/pdo_dblib/dblib_driver.c b/ext/pdo_dblib/dblib_driver.c
index 66e7d79..3e0529f 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 : "");