]> granicus.if.org Git - php/commitdiff
Set auto-commit after establishing the connection, otherwise we have a crash.
authorIlia Alshanetsky <iliaa@php.net>
Sun, 13 Feb 2005 17:16:24 +0000 (17:16 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Sun, 13 Feb 2005 17:16:24 +0000 (17:16 +0000)
ext/pdo_mysql/mysql_driver.c

index fa41ec07e1cf6d9dc311c24d30bd989eb1a203de..c4c6539d4f73a8b6bdd6b99dee09633c59e9de3d 100755 (executable)
@@ -324,8 +324,6 @@ static int pdo_mysql_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_
                }
        }
        
-       mysql_handle_autocommit(dbh TSRMLS_CC);
-
        if (vars[2].optval && !strcmp("localhost", vars[2].optval)) {
                unix_socket = vars[4].optval;  
        } else {
@@ -337,6 +335,8 @@ static int pdo_mysql_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_
                goto cleanup;
        }
 
+       mysql_handle_autocommit(dbh TSRMLS_CC);
+
        H->attached = 1;
 
        dbh->alloc_own_columns = 1;