summaryrefslogtreecommitdiffstats
path: root/system/database/drivers/ibase
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-07-19 12:06:02 +0200
committerAndrey Andreev <narf@bofh.bg>2012-07-19 12:06:02 +0200
commitc9b924c1498847d8f324d81c8994fff0b95f26dc (patch)
treec78ca7d7ad67df0cf69414180e36a037c8c45970 /system/database/drivers/ibase
parent94611df88cf99ae530258a25e2051e901b9ffcc7 (diff)
Remove _limit()'s extra parameters and qb_limit, qb_offset unneeded typecasts + add _compile_group_by() method
Diffstat (limited to 'system/database/drivers/ibase')
-rw-r--r--system/database/drivers/ibase/ibase_driver.php15
1 files changed, 8 insertions, 7 deletions
diff --git a/system/database/drivers/ibase/ibase_driver.php b/system/database/drivers/ibase/ibase_driver.php
index 86c1fee6d..7b37b9999 100644
--- a/system/database/drivers/ibase/ibase_driver.php
+++ b/system/database/drivers/ibase/ibase_driver.php
@@ -285,7 +285,10 @@ class CI_DB_ibase_driver extends CI_DB {
*/
protected function _field_data($table)
{
- return $this->_limit('SELECT * FROM '.$this->protect_identifiers($table), 1, NULL);
+ $this->qb_limit = 1;
+ $sql = $this->_limit('SELECT * FROM '.$this->protect_identifiers($table));
+ $this->qb_limit = 0;
+ return $sql;
}
// --------------------------------------------------------------------
@@ -378,22 +381,20 @@ class CI_DB_ibase_driver extends CI_DB {
* Generates a platform-specific LIMIT clause
*
* @param string the sql query string
- * @param int the number of rows to limit the query to
- * @param int the offset value
* @return string
*/
- protected function _limit($sql, $limit, $offset)
+ protected function _limit($sql)
{
// Limit clause depends on if Interbase or Firebird
if (stripos($this->version(), 'firebird') !== FALSE)
{
- $select = 'FIRST '. (int) $limit
- .($offset ? ' SKIP '. (int) $offset : '');
+ $select = 'FIRST '.$this->qb_limit
+ .($this->qb_offset ? ' SKIP '.$this->qb_offset : '');
}
else
{
$select = 'ROWS '
- .($offset ? (int) $offset.' TO '.($limit + $offset) : (int) $limit);
+ .($this->qb_offset ? $this->qb_offset.' TO '.($this->qb_limit + $this->qb_offset) : $this->qb_limit);
}
return preg_replace('`SELECT`i', 'SELECT '.$select, $sql);