summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-06-28 13:06:54 +0200
committerAndrey Andreev <narf@bofh.bg>2012-06-28 13:06:54 +0200
commitd580999cead0aa37d705c2f32e02712a2d522deb (patch)
treefb79ac8c877c87d93f654bbb6baf82b0da79c309
parent580388bc79e340ddf44f52853524ecc03b9d339c (diff)
Fix issue #1545
-rw-r--r--system/database/drivers/oci8/oci8_driver.php18
-rw-r--r--user_guide_src/source/changelog.rst1
2 files changed, 13 insertions, 6 deletions
diff --git a/system/database/drivers/oci8/oci8_driver.php b/system/database/drivers/oci8/oci8_driver.php
index 67bb0403b..691247fee 100644
--- a/system/database/drivers/oci8/oci8_driver.php
+++ b/system/database/drivers/oci8/oci8_driver.php
@@ -158,6 +158,8 @@ class CI_DB_oci8_driver extends CI_DB {
$this->dsn = '';
}
+ // --------------------------------------------------------------------
+
/**
* Non-persistent database connection
*
@@ -179,9 +181,9 @@ class CI_DB_oci8_driver extends CI_DB {
*/
public function db_pconnect()
{
- return ( ! empty($this->char_set))
- ? @oci_pconnect($this->username, $this->password, $this->dsn, $this->char_set)
- : @oci_pconnect($this->username, $this->password, $this->dsn);
+ return empty($this->char_set)
+ ? @oci_pconnect($this->username, $this->password, $this->dsn)
+ : @oci_pconnect($this->username, $this->password, $this->dsn, $this->char_set);
}
// --------------------------------------------------------------------
@@ -217,6 +219,8 @@ class CI_DB_oci8_driver extends CI_DB {
return @oci_execute($this->stmt_id, $this->commit_mode);
}
+ // --------------------------------------------------------------------
+
/**
* Generate a statement ID
*
@@ -236,7 +240,7 @@ class CI_DB_oci8_driver extends CI_DB {
/**
* Get cursor. Returns a cursor from the database
*
- * @return cursor id
+ * @return resource
*/
public function get_cursor()
{
@@ -300,6 +304,7 @@ class CI_DB_oci8_driver extends CI_DB {
/**
* Bind parameters
*
+ * @param array
* @return void
*/
protected function _bind_params($params)
@@ -328,6 +333,7 @@ class CI_DB_oci8_driver extends CI_DB {
/**
* Begin Transaction
*
+ * @param bool
* @return bool
*/
public function trans_begin($test_mode = FALSE)
@@ -636,8 +642,8 @@ class CI_DB_oci8_driver extends CI_DB {
protected function _limit($sql, $limit, $offset)
{
$this->limit_used = TRUE;
- return 'SELECT * FROM (SELECT inner_query.*, rownum rnum FROM ('.$sql.') inner_query WHERE rownum < '.($offset + $limit).')'
- .($offset ? ' WHERE rnum >= '.$offset : '');
+ return 'SELECT * FROM (SELECT inner_query.*, rownum rnum FROM ('.$sql.') inner_query WHERE rownum < '.($offset + $limit + 1).')'
+ .($offset ? ' WHERE rnum >= '.($offset + 1): '');
}
// --------------------------------------------------------------------
diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst
index 70d0c80a9..d2774ca12 100644
--- a/user_guide_src/source/changelog.rst
+++ b/user_guide_src/source/changelog.rst
@@ -299,6 +299,7 @@ Bug fixes for 3.0
- Fixed a bug (#1328) - :doc:`Form Validation Library <libraries/form_validation>` didn't properly check the type of the form fields before processing them.
- Fixed a bug (#79) - :doc:`Form Validation Library <libraries/form_validation>` didn't properly validate array fields that use associative keys or have custom indexes.
- Fixed a bug (#427) - :doc:`Form Validation Library <libraries/form_validation>` method ``strip_image_tags()`` was an alias to a non-existent method.
+- Fixed a bug (#1545) - :doc:`Query Builder <database/query_builder>` method ``limit()`` wasn't executed properly under Oracle.
Version 2.1.1
=============