diff options
Diffstat (limited to 'ext/pdo_dblib/pdo_dblib.c')
| -rw-r--r-- | ext/pdo_dblib/pdo_dblib.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/ext/pdo_dblib/pdo_dblib.c b/ext/pdo_dblib/pdo_dblib.c index 5bacec148c..87ae0bdb48 100644 --- a/ext/pdo_dblib/pdo_dblib.c +++ b/ext/pdo_dblib/pdo_dblib.c @@ -114,14 +114,18 @@ int msg_handler(DBPROCESS *dbproc, DBINT msgno, int msgstate, pdo_dblib_err *einfo; TSRMLS_FETCH(); - einfo = (pdo_dblib_err*)dbgetuserdata(dbproc); - if (!einfo) einfo = &DBLIB_G(err); + if (severity) { + einfo = (pdo_dblib_err*)dbgetuserdata(dbproc); + if (!einfo) { + einfo = &DBLIB_G(err); + } - if (einfo->lastmsg) { - efree(einfo->lastmsg); - } + if (einfo->lastmsg) { + efree(einfo->lastmsg); + } - einfo->lastmsg = estrdup(msgtext); + einfo->lastmsg = estrdup(msgtext); + } #if 0 php_error_docref(NULL TSRMLS_CC, E_WARNING, "dblib message: %s (severity %d)", msgtext, severity); |
