diff options
author | George Peter Banyard <girgias@php.net> | 2021-03-15 16:26:04 +0000 |
---|---|---|
committer | George Peter Banyard <girgias@php.net> | 2021-03-17 00:58:01 +0000 |
commit | ebaeb93c3f9f23aa9b2e5ccc1f8bf17ec3700bf2 (patch) | |
tree | b719eb118b40cb31fb2abc543c2e55afea3d9ca1 /ext/pdo_oci/oci_driver.c | |
parent | c465462e912eae73d1e0407f2d2cb815f40f1c13 (diff) | |
download | php-git-ebaeb93c3f9f23aa9b2e5ccc1f8bf17ec3700bf2.tar.gz |
Add API to fetch bool value for PDO attribute values
Closes GH-6766
Diffstat (limited to 'ext/pdo_oci/oci_driver.c')
-rw-r--r-- | ext/pdo_oci/oci_driver.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ext/pdo_oci/oci_driver.c b/ext/pdo_oci/oci_driver.c index 524820b910..36f6654a35 100644 --- a/ext/pdo_oci/oci_driver.c +++ b/ext/pdo_oci/oci_driver.c @@ -431,7 +431,8 @@ static bool oci_handle_set_attribute(pdo_dbh_t *dbh, zend_long attr, zval *val) switch (attr) { case PDO_ATTR_AUTOCOMMIT: { - if (pdo_get_long_param(&lval, val) == false) { + bool bval; + if (!pdo_get_bool_param(&bval, val)) { return false; } @@ -446,7 +447,7 @@ static bool oci_handle_set_attribute(pdo_dbh_t *dbh, zend_long attr, zval *val) dbh->in_txn = false; } - dbh->auto_commit = (unsigned int)lval? 1 : 0; + dbh->auto_commit = (unsigned int) bval; return true; } case PDO_ATTR_PREFETCH: |