diff options
author | Andrey Andreev <narf@devilix.net> | 2016-01-11 11:09:52 +0100 |
---|---|---|
committer | Andrey Andreev <narf@devilix.net> | 2016-01-11 11:09:52 +0100 |
commit | 38b08116c61c0a68e6d350c986f75589220692ed (patch) | |
tree | fa8a9b5a0f0be955d42110b67037d1ff46e54604 /system/database/drivers/oci8 | |
parent | 34251bfec2627fb0526d5f99f3a13a3d8a4506d8 (diff) | |
parent | fd5fe1a64c03ae7204a7e72d936215f7a61d8c30 (diff) |
Merge branch '3.0-stable' into develop
Resolved conflicts:
system/database/drivers/mysql/mysql_driver.php
system/database/drivers/mysqli/mysqli_driver.php
Diffstat (limited to 'system/database/drivers/oci8')
-rw-r--r-- | system/database/drivers/oci8/oci8_driver.php | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/system/database/drivers/oci8/oci8_driver.php b/system/database/drivers/oci8/oci8_driver.php index 206924d06..994f8f33a 100644 --- a/system/database/drivers/oci8/oci8_driver.php +++ b/system/database/drivers/oci8/oci8_driver.php @@ -654,6 +654,14 @@ class CI_DB_oci8_driver extends CI_DB { */ protected function _limit($sql) { + if (version_compare($this->version(), '12.1', '>=')) + { + // OFFSET-FETCH can be used only with the ORDER BY clause + empty($this->qb_orderby) && $sql .= ' ORDER BY 1'; + + return $sql.' OFFSET '.(int) $this->qb_offset.' ROWS FETCH NEXT '.$this->qb_limit.' ROWS ONLY'; + } + $this->limit_used = TRUE; return 'SELECT * FROM (SELECT inner_query.*, rownum rnum FROM ('.$sql.') inner_query WHERE rownum < '.($this->qb_offset + $this->qb_limit + 1).')' .($this->qb_offset ? ' WHERE rnum >= '.($this->qb_offset + 1) : ''); |