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 | fa67c860e0ef6bb2a1dd556c9c3e33ad105143bc (patch) | |
| tree | 1588686467c8507c518331a12e6ceae28b7c418d /ext/pdo_pgsql/pgsql_driver.c | |
| parent | e6f4503f29f3492a3b2c59886371936c066c37d3 (diff) | |
| download | php-git-fa67c860e0ef6bb2a1dd556c9c3e33ad105143bc.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 7ccbe09b3e..deeddb7951 100644 --- a/ext/pdo_pgsql/pgsql_driver.c +++ b/ext/pdo_pgsql/pgsql_driver.c @@ -232,7 +232,7 @@ static int pgsql_handle_preparer(pdo_dbh_t *dbh, const char *sql, long sql_len, if (S->cursor_name) { efree(S->cursor_name); } - spprintf(&S->cursor_name, 0, "pdo_crsr_%016lx", (unsigned long) stmt); + spprintf(&S->cursor_name, 0, "pdo_crsr_%08x", ++H->stmt_counter); #if HAVE_PQPREPARE emulate = 1; #endif @@ -262,7 +262,7 @@ static int pgsql_handle_preparer(pdo_dbh_t *dbh, const char *sql, long sql_len, return 0; } - spprintf(&S->stmt_name, 0, "pdo_stmt_%016lx", (unsigned long)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) { |
