]> granicus.if.org Git - php/commitdiff
- Fix shutdown problems
authorMarcus Boerger <helly@php.net>
Wed, 28 Jul 2004 00:40:01 +0000 (00:40 +0000)
committerMarcus Boerger <helly@php.net>
Wed, 28 Jul 2004 00:40:01 +0000 (00:40 +0000)
ext/pdo_mysql/mysql_driver.c
ext/pdo_pgsql/pgsql_driver.c

index 700543ab5b710a39d523d263416ce81edfd14aae..876f1767feafa48017103423af4e6f0560623562 100755 (executable)
@@ -153,7 +153,7 @@ static int mysql_handle_closer(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */
                        H->einfo.errmsg = NULL;
                }
                efree(H);
-               H = NULL;
+               dbh->driver_data = NULL;
        }
        return 0;
 }
index 70eae1ca65ec2e106c70913d8aa330a8553f5a8b..3bb1fe0435cd253503fd720eeedf302c73ab0bd0 100644 (file)
@@ -31,6 +31,7 @@
 #include "pg_config.h" /* needed for PG_VERSION */
 #include "php_pdo_pgsql.h"
 #include "php_pdo_pgsql_int.h"
+#include "zend_exceptions.h"
 
 int _pdo_pgsql_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, int errcode, const char *file, int line TSRMLS_DC) /* {{{ */
 {
@@ -62,6 +63,11 @@ int _pdo_pgsql_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, int errcode, const char *
                einfo->errmsg = estrdup(errmsg);
        }
 
+       if (!dbh->methods) {
+               zend_throw_exception_ex(php_pdo_get_exception(), *pdo_err TSRMLS_CC, "[%d] %s",
+                               einfo->errcode, einfo->errmsg);
+       }
+       
        return errcode;
 }
 /* }}} */
@@ -93,7 +99,7 @@ static int pgsql_handle_closer(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */
                        H->einfo.errmsg = NULL;
                }
                pefree(H, dbh->is_persistent);
-               H = NULL;
+               dbh->driver_data = NULL;
        }
        return 0;
 }