mirror of
https://github.com/php/php-src.git
synced 2025-01-24 04:33:39 +08:00
autocommit setting done right
This commit is contained in:
parent
5d4fb518ae
commit
486370dc7c
@ -196,7 +196,11 @@ static int mysql_handle_rollback(pdo_dbh_t *dbh TSRMLS_DC)
|
||||
|
||||
static int mysql_handle_autocommit(pdo_dbh_t *dbh TSRMLS_DC)
|
||||
{
|
||||
return 0 <= mysql_handle_doer(dbh, ZEND_STRL("SET SESSION AUTOCOMMIT=0") TSRMLS_CC);
|
||||
if (dbh->auto_commit) {
|
||||
return 0 <= mysql_handle_doer(dbh, ZEND_STRL("SET SESSION AUTOCOMMIT=1") TSRMLS_CC);
|
||||
} else {
|
||||
return 0 <= mysql_handle_doer(dbh, ZEND_STRL("SET SESSION AUTOCOMMIT=0") TSRMLS_CC);
|
||||
}
|
||||
}
|
||||
|
||||
static int pdo_mysql_set_attribute(pdo_dbh_t *dbh, long attr, zval *val TSRMLS_DC)
|
||||
|
Loading…
Reference in New Issue
Block a user