summaryrefslogtreecommitdiffstats
path: root/system/database
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2016-08-10 14:26:57 +0200
committerAndrey Andreev <narf@devilix.net>2016-08-10 14:26:57 +0200
commitc4bd43432df03e4f4835c7689c8ed722cd2c3020 (patch)
tree5603166833d78b0581bbe880adb53b6de085719d /system/database
parent488ad40ba334ca506f07bede97724726eac2b27f (diff)
parent9180a1264dc536c34e5cc8a0e44bb399a8ba484f (diff)
Merge branch '3.1-stable' into develop
Diffstat (limited to 'system/database')
-rw-r--r--system/database/DB_query_builder.php4
-rw-r--r--system/database/drivers/mysqli/mysqli_driver.php7
-rw-r--r--system/database/drivers/oci8/oci8_driver.php2
-rw-r--r--system/database/drivers/pdo/subdrivers/pdo_mysql_driver.php16
4 files changed, 8 insertions, 21 deletions
diff --git a/system/database/DB_query_builder.php b/system/database/DB_query_builder.php
index 713bf18f3..7a008eeb8 100644
--- a/system/database/DB_query_builder.php
+++ b/system/database/DB_query_builder.php
@@ -1271,7 +1271,7 @@ abstract class CI_DB_query_builder extends CI_DB_driver {
*/
protected function _limit($sql)
{
- return $sql.' LIMIT '.($this->qb_offset ? $this->qb_offset.', ' : '').$this->qb_limit;
+ return $sql.' LIMIT '.($this->qb_offset ? $this->qb_offset.', ' : '').(int) $this->qb_limit;
}
// --------------------------------------------------------------------
@@ -2340,7 +2340,7 @@ abstract class CI_DB_query_builder extends CI_DB_driver {
.$this->_compile_order_by(); // ORDER BY
// LIMIT
- if ($this->qb_limit)
+ if ($this->qb_limit OR $this->qb_offset)
{
return $this->_limit($sql."\n");
}
diff --git a/system/database/drivers/mysqli/mysqli_driver.php b/system/database/drivers/mysqli/mysqli_driver.php
index 168533240..c26f975c4 100644
--- a/system/database/drivers/mysqli/mysqli_driver.php
+++ b/system/database/drivers/mysqli/mysqli_driver.php
@@ -125,8 +125,7 @@ class CI_DB_mysqli_driver extends CI_DB {
}
else
{
- // Persistent connection support was added in PHP 5.3.0
- $hostname = ($persistent === TRUE && is_php('5.3'))
+ $hostname = ($persistent === TRUE)
? 'p:'.$this->hostname : $this->hostname;
$port = empty($this->port) ? NULL : $this->port;
$socket = NULL;
@@ -496,8 +495,8 @@ class CI_DB_mysqli_driver extends CI_DB {
if ( ! empty($this->_mysqli->connect_errno))
{
return array(
- 'code' => $this->_mysqli->connect_errno,
- 'message' => is_php('5.2.9') ? $this->_mysqli->connect_error : mysqli_connect_error()
+ 'code' => $this->_mysqli->connect_errno,
+ 'message' => $this->_mysqli->connect_error
);
}
diff --git a/system/database/drivers/oci8/oci8_driver.php b/system/database/drivers/oci8/oci8_driver.php
index df7e0848a..56fdf32cf 100644
--- a/system/database/drivers/oci8/oci8_driver.php
+++ b/system/database/drivers/oci8/oci8_driver.php
@@ -386,7 +386,7 @@ class CI_DB_oci8_driver extends CI_DB {
*/
protected function _trans_begin()
{
- $this->commit_mode = is_php('5.3.2') ? OCI_NO_AUTO_COMMIT : OCI_DEFAULT;
+ $this->commit_mode = OCI_NO_AUTO_COMMIT;
return TRUE;
}
diff --git a/system/database/drivers/pdo/subdrivers/pdo_mysql_driver.php b/system/database/drivers/pdo/subdrivers/pdo_mysql_driver.php
index 38a5a8aff..3631cdf7a 100644
--- a/system/database/drivers/pdo/subdrivers/pdo_mysql_driver.php
+++ b/system/database/drivers/pdo/subdrivers/pdo_mysql_driver.php
@@ -106,7 +106,7 @@ class CI_DB_pdo_mysql_driver extends CI_DB_pdo_driver {
empty($this->database) OR $this->dsn .= ';dbname='.$this->database;
empty($this->char_set) OR $this->dsn .= ';charset='.$this->char_set;
}
- elseif ( ! empty($this->char_set) && strpos($this->dsn, 'charset=', 6) === FALSE && is_php('5.3.6'))
+ elseif ( ! empty($this->char_set) && strpos($this->dsn, 'charset=', 6) === FALSE)
{
$this->dsn .= ';charset='.$this->char_set;
}
@@ -122,17 +122,6 @@ class CI_DB_pdo_mysql_driver extends CI_DB_pdo_driver {
*/
public function db_connect($persistent = FALSE)
{
- /* Prior to PHP 5.3.6, even if the charset was supplied in the DSN
- * on connect - it was ignored. This is a work-around for the issue.
- *
- * Reference: http://www.php.net/manual/en/ref.pdo-mysql.connection.php
- */
- if ( ! is_php('5.3.6') && ! empty($this->char_set))
- {
- $this->options[PDO::MYSQL_ATTR_INIT_COMMAND] = 'SET NAMES '.$this->char_set
- .(empty($this->dbcollat) ? '' : ' COLLATE '.$this->dbcollat);
- }
-
if (isset($this->stricton))
{
if ($this->stricton)
@@ -169,8 +158,7 @@ class CI_DB_pdo_mysql_driver extends CI_DB_pdo_driver {
$this->options[PDO::MYSQL_ATTR_COMPRESS] = TRUE;
}
- // SSL support was added to PDO_MYSQL in PHP 5.3.7
- if (is_array($this->encrypt) && is_php('5.3.7'))
+ if (is_array($this->encrypt))
{
$ssl = array();
empty($this->encrypt['ssl_key']) OR $ssl[PDO::MYSQL_ATTR_SSL_KEY] = $this->encrypt['ssl_key'];