From e6551f081d93e712eadcfee82c96e307cbb9ec25 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Tue, 25 May 2004 12:03:41 +0000 Subject: [PATCH] Throw exception during ctor --- ext/pdo_mysql/mysql_driver.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ext/pdo_mysql/mysql_driver.c b/ext/pdo_mysql/mysql_driver.c index 6cb2dde99c..037f6ffea3 100755 --- a/ext/pdo_mysql/mysql_driver.c +++ b/ext/pdo_mysql/mysql_driver.c @@ -116,6 +116,11 @@ int _pdo_mysql_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *file, int lin break; } + if (!dbh->methods) { + zend_throw_exception_ex(php_pdo_get_exception(), *pdo_err TSRMLS_CC, "[%d] %s", + einfo->errcode, einfo->errmsg); + } + return einfo->errcode; } /* }}} */ -- 2.50.1