diff options
author | Timothy Warren <tim@timshomepage.net> | 2012-06-27 14:02:13 +0200 |
---|---|---|
committer | Timothy Warren <tim@timshomepage.net> | 2012-06-27 14:02:13 +0200 |
commit | 13077951b63cf9858dc14ec9cab7f2b53ec88a3e (patch) | |
tree | e1fc50ddb8c0a4103c945f15d674d85c6655231b /system/database/drivers/pdo | |
parent | 9128231452f3ccea857a848b61bd0e6e9e319737 (diff) | |
parent | b66664b5decd68de50ae6c239c8d995d6c088d94 (diff) |
Merge branch 'develop' of git://github.com/EllisLab/CodeIgniter into email
Diffstat (limited to 'system/database/drivers/pdo')
-rw-r--r-- | system/database/drivers/pdo/pdo_driver.php | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/system/database/drivers/pdo/pdo_driver.php b/system/database/drivers/pdo/pdo_driver.php index e25013a52..a3ad46900 100644 --- a/system/database/drivers/pdo/pdo_driver.php +++ b/system/database/drivers/pdo/pdo_driver.php @@ -599,19 +599,12 @@ class CI_DB_pdo_driver extends CI_DB { */ protected function _limit($sql, $limit, $offset) { - if ($this->pdodriver === 'cubrid' OR $this->pdodriver === 'sqlite') + if ($this->pdodriver === 'pgsql') { - $offset = ($offset == 0) ? '' : $offset.', '; - - return $sql.'LIMIT '.$offset.$limit; + return $sql.' LIMIT '.$limit.($offset ? ' OFFSET '.$offset : ''); } - else - { - $sql .= 'LIMIT '.$limit; - $sql .= ($offset > 0) ? ' OFFSET '.$offset : ''; - return $sql; - } + return $sql.' LIMIT '.($offset ? $offset.', ' : '').$limit; } } |