From: Wez Furlong Date: Sun, 6 Feb 2005 17:25:09 +0000 (+0000) Subject: handle some generic attributes here X-Git-Tag: RELEASE_0_2~61 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9ba84360e3b6c7ba4b3bd712497aa89a6ad0867f;p=php handle some generic attributes here --- diff --git a/ext/pdo/pdo_dbh.c b/ext/pdo/pdo_dbh.c index e61d76ab19..d77211b1c4 100755 --- a/ext/pdo/pdo_dbh.c +++ b/ext/pdo/pdo_dbh.c @@ -515,12 +515,25 @@ static PHP_METHOD(PDO, getAttribute) RETURN_FALSE; } + PDO_DBH_CLEAR_ERR(); + + /* handle generic PDO-level atributes */ + switch (attr) { + case PDO_ATTR_PERSISTENT: + RETURN_BOOL(dbh->is_persistent); + + case PDO_ATTR_CASE: + RETURN_LONG(dbh->desired_case); + + case PDO_ATTR_ORACLE_NULLS: + RETURN_BOOL(dbh->oracle_nulls); + } + if (!dbh->methods->get_attribute) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "This driver doesn't support fetching attributes"); RETURN_FALSE; } - PDO_DBH_CLEAR_ERR(); switch (dbh->methods->get_attribute(dbh, attr, return_value TSRMLS_CC)) { case -1: PDO_HANDLE_DBH_ERR();