summaryrefslogtreecommitdiffstats
path: root/system/database
diff options
context:
space:
mode:
authorTimothy Warren <tim@timshomepage.net>2011-09-16 02:15:19 +0200
committerTimothy Warren <tim@timshomepage.net>2011-09-16 02:15:19 +0200
commit0a43ad879440c7dad246d3545ec883871ef460b8 (patch)
tree9114c2e1ac6265728bfdd248f974de3c5365c6a7 /system/database
parent57cea51f89a1da6f15d2e9e22dbd5f071b7bb286 (diff)
Implemented limit handling
Diffstat (limited to 'system/database')
-rw-r--r--system/database/drivers/pdo/pdo_driver.php26
1 files changed, 24 insertions, 2 deletions
diff --git a/system/database/drivers/pdo/pdo_driver.php b/system/database/drivers/pdo/pdo_driver.php
index 149a05247..ba02605b1 100644
--- a/system/database/drivers/pdo/pdo_driver.php
+++ b/system/database/drivers/pdo/pdo_driver.php
@@ -642,8 +642,30 @@ class CI_DB_pdo_driver extends CI_DB {
*/
function _limit($sql, $limit, $offset)
{
- // Does PDO doesn't use the LIMIT clause?
- return $sql;
+ if(strpos('cubrid', $this->hostname) !== FALSE || strpos('sqlite', $this->hostname) !== FALSE)
+ {
+ if ($offset == 0)
+ {
+ $offset = '';
+ }
+ else
+ {
+ $offset .= ", ";
+ }
+
+ return $sql."LIMIT ".$offset.$limit;
+ }
+ else
+ {
+ $sql .= "LIMIT ".$limit;
+
+ if ($offset > 0)
+ {
+ $sql .= " OFFSET ".$offset;
+ }
+
+ return $sql;
+ }
}
// --------------------------------------------------------------------