diff options
-rw-r--r-- | ext/pdo/pdo_dbh.c | 5 | ||||
-rw-r--r-- | ext/pdo/php_pdo_driver.h | 6 |
2 files changed, 8 insertions, 3 deletions
diff --git a/ext/pdo/pdo_dbh.c b/ext/pdo/pdo_dbh.c index 08bb61fc0f..8f840060e5 100644 --- a/ext/pdo/pdo_dbh.c +++ b/ext/pdo/pdo_dbh.c @@ -600,8 +600,7 @@ PHP_METHOD(PDO, beginTransaction) } if (!dbh->methods->begin) { - /* TODO: this should be an exception; see the auto-commit mode - * comments below */ + /* Throw an exception when the driver does not support transactions */ zend_throw_exception_ex(php_pdo_get_exception(), 0, "This driver doesn't support transactions"); RETURN_THROWS(); } @@ -904,6 +903,8 @@ PHP_METHOD(PDO, getAttribute) RETURN_FALSE; default: + /* No error state, just return as the return_value has been assigned + * by the get_attribute handler */ return; } } diff --git a/ext/pdo/php_pdo_driver.h b/ext/pdo/php_pdo_driver.h index ea78eb187d..8345d7f81e 100644 --- a/ext/pdo/php_pdo_driver.h +++ b/ext/pdo/php_pdo_driver.h @@ -255,7 +255,11 @@ typedef char *(*pdo_dbh_last_id_func)(pdo_dbh_t *dbh, const char *name, size_t * * specific data ... */ typedef int (*pdo_dbh_fetch_error_func)(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *info); -/* fetching of attributes */ +/* fetching of attributes + * There are 3 return states: + * * -1 for errors while retrieving a valid attribute + * * 0 for attempting to retrieve an attribute which is not supported by the driver + * * any other value for success, *val must be set to the attribute value */ typedef int (*pdo_dbh_get_attr_func)(pdo_dbh_t *dbh, zend_long attr, zval *val); /* checking/pinging persistent connections; return SUCCESS if the connection |