From 37ea5fbeb5101b16b6af28ae8aea2169bfb65a96 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Mon, 17 Jan 2005 23:59:16 +0000 Subject: [PATCH] Tidy up driver specific method handling --- ext/pdo/pdo_dbh.c | 4 +++- ext/pdo/pdo_stmt.c | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ext/pdo/pdo_dbh.c b/ext/pdo/pdo_dbh.c index 09c19191d15..4af32a57791 100755 --- a/ext/pdo/pdo_dbh.c +++ b/ext/pdo/pdo_dbh.c @@ -839,7 +839,9 @@ static union _zend_function *dbh_method_get( /* not a pre-defined method, nor a user-defined method; check * the driver specific methods */ if (!dbh->cls_methods[PDO_DBH_DRIVER_METHOD_KIND_DBH]) { - if (!pdo_hash_methods(dbh, PDO_DBH_DRIVER_METHOD_KIND_DBH TSRMLS_CC)) { + if (!pdo_hash_methods(dbh, + PDO_DBH_DRIVER_METHOD_KIND_DBH TSRMLS_CC) + || !dbh->cls_methods[PDO_DBH_DRIVER_METHOD_KIND_DBH]) { goto out; } } diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c index 63c64fb5e13..ae8e4172aa3 100755 --- a/ext/pdo/pdo_stmt.c +++ b/ext/pdo/pdo_stmt.c @@ -1060,12 +1060,14 @@ static union _zend_function *dbstmt_method_get( /* not a pre-defined method, nor a user-defined method; check * the driver specific methods */ if (!stmt->dbh->cls_methods[PDO_DBH_DRIVER_METHOD_KIND_STMT]) { - if (!pdo_hash_methods(stmt->dbh, PDO_DBH_DRIVER_METHOD_KIND_STMT TSRMLS_CC)) { + if (!pdo_hash_methods(stmt->dbh, + PDO_DBH_DRIVER_METHOD_KIND_STMT TSRMLS_CC) + || !stmt->dbh->cls_methods[PDO_DBH_DRIVER_METHOD_KIND_STMT]) { goto out; } } - if (zend_hash_find(stmt->dbh->cls_methods[PDO_DBH_DRIVER_METHOD_KIND_DBH], + if (zend_hash_find(stmt->dbh->cls_methods[PDO_DBH_DRIVER_METHOD_KIND_STMT], lc_method_name, method_len+1, (void**)&fbc) == FAILURE) { fbc = NULL; goto out;