From 01bc818d465ab168288e260745a045ff2794648d Mon Sep 17 00:00:00 2001 From: Nathan Guse Date: Mon, 30 Jul 2012 18:44:40 -0500 Subject: [ticket/10875] Fix SQL Caching The sql_save function cannot take arguments by reference since it is called by call_user_func_array() Replace use of isset($cache->sql_rowset[$query_id]) with $cache->sql_exists Replace $cache->cache_dir with $cache->get_driver()->cache_dir PHPBB3-10875 --- phpBB/includes/db/postgres.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'phpBB/includes/db/postgres.php') diff --git a/phpBB/includes/db/postgres.php b/phpBB/includes/db/postgres.php index 41838d2613..c35199e917 100644 --- a/phpBB/includes/db/postgres.php +++ b/phpBB/includes/db/postgres.php @@ -285,7 +285,7 @@ class dbal_postgres extends dbal $query_id = $this->query_result; } - if (isset($cache->sql_rowset[$query_id])) + if ($cache->sql_exists($query_id)) { return $cache->sql_fetchrow($query_id); } @@ -306,7 +306,7 @@ class dbal_postgres extends dbal $query_id = $this->query_result; } - if (isset($cache->sql_rowset[$query_id])) + if ($cache->sql_exists($query_id)) { return $cache->sql_rowseek($rownum, $query_id); } @@ -355,7 +355,7 @@ class dbal_postgres extends dbal $query_id = $this->query_result; } - if (isset($cache->sql_rowset[$query_id])) + if ($cache->sql_exists($query_id)) { return $cache->sql_freeresult($query_id); } -- cgit v1.2.1 From dcefa16318f6dc1058595a7ba221b75ed6a2504b Mon Sep 17 00:00:00 2001 From: Nathan Guse Date: Mon, 6 Aug 2012 16:26:55 -0500 Subject: [ticket/10875] Return $query_id from sql_save Have to return the $query_id from sql_save so that the results can be pulled Updated cache test to do some basic sql cache testing. PHPBB3-10875 --- phpBB/includes/db/postgres.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/includes/db/postgres.php') diff --git a/phpBB/includes/db/postgres.php b/phpBB/includes/db/postgres.php index c35199e917..f0a4a7a7a2 100644 --- a/phpBB/includes/db/postgres.php +++ b/phpBB/includes/db/postgres.php @@ -218,7 +218,7 @@ class dbal_postgres extends dbal if ($cache_ttl) { $this->open_queries[(int) $this->query_result] = $this->query_result; - $cache->sql_save($query, $this->query_result, $cache_ttl); + $this->query_result = $cache->sql_save($query, $this->query_result, $cache_ttl); } else if (strpos($query, 'SELECT') === 0 && $this->query_result) { -- cgit v1.2.1