diff options
author | Matteo Beccati <mbeccati@php.net> | 2009-11-04 19:32:27 +0000 |
---|---|---|
committer | Matteo Beccati <mbeccati@php.net> | 2009-11-04 19:32:27 +0000 |
commit | 2a481b01fb1af7ee30f7a6e4c36defee94fbcaf8 (patch) | |
tree | 9e20d9724b40dd4207dbf737b703bf9030f5430e /ext/pdo_pgsql/pgsql_driver.c | |
parent | c4bee3fa965bab9590613838ac41f0507119cecd (diff) | |
download | php-git-2a481b01fb1af7ee30f7a6e4c36defee94fbcaf8.tar.gz |
- Properly fixed bug #49985 (pdo_pgsql prepare() re-use previous aborted transaction).
# Removed usage of the memory address when generating prepared statemend names
# as uniqueness can't be enforced. Used a statment counter instead.
Diffstat (limited to 'ext/pdo_pgsql/pgsql_driver.c')
-rw-r--r-- | ext/pdo_pgsql/pgsql_driver.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/pdo_pgsql/pgsql_driver.c b/ext/pdo_pgsql/pgsql_driver.c index 28d59a19fb..97e58006d2 100644 --- a/ext/pdo_pgsql/pgsql_driver.c +++ b/ext/pdo_pgsql/pgsql_driver.c @@ -233,7 +233,7 @@ static int pgsql_handle_preparer(pdo_dbh_t *dbh, const char *sql, long sql_len, efree(S->cursor_name); } /* TODO: check how scrollable cursors related to prepared statements */ - spprintf(&S->cursor_name, 0, "pdo_pgsql_cursor_%08x", (unsigned int) stmt); + spprintf(&S->cursor_name, 0, "pdo_crsr_%08x", ++H->stmt_counter); } #if HAVE_PQPREPARE @@ -261,7 +261,7 @@ static int pgsql_handle_preparer(pdo_dbh_t *dbh, const char *sql, long sql_len, return 0; } - spprintf(&S->stmt_name, 0, "pdo_pgsql_stmt_%08x", (unsigned int)stmt); + spprintf(&S->stmt_name, 0, "pdo_stmt_%08x", ++H->stmt_counter); /* that's all for now; we'll defer the actual prepare until the first execute call */ if (nsql) { |