diff options
author | Andrey Hristov <andrey@php.net> | 2008-07-15 13:12:27 +0000 |
---|---|---|
committer | Andrey Hristov <andrey@php.net> | 2008-07-15 13:12:27 +0000 |
commit | 73dfa53ca8c9903e5db86baec417a39c133fc001 (patch) | |
tree | 00ff7ddcbaca5a0e7d95ed050e9f5708519c867e /ext/mysqlnd/mysqlnd.c | |
parent | 6cf169b16ca9f7ebd819b3ff50dc92a0c0ef1473 (diff) | |
download | php-git-73dfa53ca8c9903e5db86baec417a39c133fc001.tar.gz |
Sync with bzr
Diffstat (limited to 'ext/mysqlnd/mysqlnd.c')
-rw-r--r-- | ext/mysqlnd/mysqlnd.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/ext/mysqlnd/mysqlnd.c b/ext/mysqlnd/mysqlnd.c index cd21ebed56..fb57ca70f5 100644 --- a/ext/mysqlnd/mysqlnd.c +++ b/ext/mysqlnd/mysqlnd.c @@ -451,7 +451,11 @@ PHPAPI void _mysqlnd_restart_psession(MYSQLND *conn, MYSQLND_THD_ZVAL_PCACHE *ca mnd_pefree(conn->last_message, conn->persistent); conn->last_message = NULL; } - conn->zval_cache = cache; + /* + The thd zval cache is always freed on request shutdown, so this has happened already. + Don't touch the old value! Get new reference + */ + conn->zval_cache = mysqlnd_palloc_get_thd_cache_reference(cache); DBG_VOID_RETURN; } /* }}} */ @@ -461,16 +465,8 @@ PHPAPI void _mysqlnd_restart_psession(MYSQLND *conn, MYSQLND_THD_ZVAL_PCACHE *ca PHPAPI void _mysqlnd_end_psession(MYSQLND *conn TSRMLS_DC) { DBG_ENTER("_mysqlnd_end_psession"); - /* - BEWARE!!!! This will have a problem with a query cache. - We need to move the data out of the zval cache before we end the psession. - Or we will use nirvana pointers!! - */ - if (conn->zval_cache) { - DBG_INF("Freeing zval cache reference"); - mysqlnd_palloc_free_thd_cache_reference(&conn->zval_cache); - conn->zval_cache = NULL; - } + /* The thd zval cache is always freed on request shutdown, so this has happened already */ + mysqlnd_palloc_free_thd_cache_reference(&conn->zval_cache); DBG_VOID_RETURN; } /* }}} */ |