summaryrefslogtreecommitdiffstats
path: root/system/database/drivers/postgre
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-07-05 15:31:12 +0200
committerAndrey Andreev <narf@bofh.bg>2012-07-05 15:31:12 +0200
commit92d18a7b6c46eadc9db58ca60ffce3980e2313ff (patch)
treeb0a869a5312279d65c3e920ffbf0b32344ab1d0f /system/database/drivers/postgre
parentd66872ae5d7cd4d2b531251a9c63528e81af3322 (diff)
parent7ca36131d881d3f83a86d824263d4abd65439e12 (diff)
Merge upstream branch
Diffstat (limited to 'system/database/drivers/postgre')
-rw-r--r--system/database/drivers/postgre/postgre_driver.php6
-rw-r--r--system/database/drivers/postgre/postgre_result.php5
2 files changed, 4 insertions, 7 deletions
diff --git a/system/database/drivers/postgre/postgre_driver.php b/system/database/drivers/postgre/postgre_driver.php
index e73122bc7..20b78673e 100644
--- a/system/database/drivers/postgre/postgre_driver.php
+++ b/system/database/drivers/postgre/postgre_driver.php
@@ -48,12 +48,6 @@ class CI_DB_postgre_driver extends CI_DB {
protected $_like_escape_str = " ESCAPE '%s' ";
protected $_like_escape_chr = '!';
- /**
- * The syntax to count rows is slightly different across different
- * database engines, so this string appears in each driver and is
- * used for the count_all() and count_all_results() functions.
- */
- protected $_count_string = 'SELECT COUNT(*) AS ';
protected $_random_keyword = ' RANDOM()'; // database specific random keyword
/**
diff --git a/system/database/drivers/postgre/postgre_result.php b/system/database/drivers/postgre/postgre_result.php
index f913bc9eb..515acd20f 100644
--- a/system/database/drivers/postgre/postgre_result.php
+++ b/system/database/drivers/postgre/postgre_result.php
@@ -33,6 +33,7 @@
* @category Database
* @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/database/
+ * @since 1.3
*/
class CI_DB_postgre_result extends CI_DB_result {
@@ -43,7 +44,9 @@ class CI_DB_postgre_result extends CI_DB_result {
*/
public function num_rows()
{
- return @pg_num_rows($this->result_id);
+ return is_int($this->num_rows)
+ ? $this->num_rows
+ : $this->num_rows = @pg_num_rows($this->result_id);
}
// --------------------------------------------------------------------