From c9054be8617adb9418e8edb732d6e234f7024e82 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Wed, 10 May 2017 11:36:31 +0300 Subject: Merge pull request #5112 from cerealbeer/develop read() in DB_cache fails when catching E_WARNING with custom error handler --- system/database/DB_cache.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/database') diff --git a/system/database/DB_cache.php b/system/database/DB_cache.php index b74c31924..7c8ee5fc9 100644 --- a/system/database/DB_cache.php +++ b/system/database/DB_cache.php @@ -143,7 +143,7 @@ class CI_DB_Cache { $segment_two = ($this->CI->uri->segment(2) == FALSE) ? 'index' : $this->CI->uri->segment(2); $filepath = $this->db->cachedir.$segment_one.'+'.$segment_two.'/'.md5($sql); - if (FALSE === ($cachedata = @file_get_contents($filepath))) + if ( ! is_file($filepath) OR FALSE === ($cachedata = file_get_contents($filepath))) { return FALSE; } -- cgit v1.2.3-24-g4f1b From ee9d428171dc201f51eaffdb62616312915681ff Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 5 Jun 2017 10:44:37 +0300 Subject: [ci skip] Merge pull request #5143 from TysonAndre/misc-phpdoc-nits Fix misc inconsistencies between code and doc comments --- system/database/DB_forge.php | 6 +++--- system/database/drivers/ibase/ibase_forge.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'system/database') diff --git a/system/database/DB_forge.php b/system/database/DB_forge.php index 7289235c8..3cb02ca4e 100644 --- a/system/database/DB_forge.php +++ b/system/database/DB_forge.php @@ -488,7 +488,7 @@ abstract class CI_DB_forge { * * @param string $table Table name * @param bool $if_exists Whether to add an IF EXISTS condition - * @return string + * @return mixed (Returns a platform-specific DROP table string, or TRUE to indicate there's nothing to do) */ protected function _drop_table($table, $if_exists) { @@ -979,8 +979,8 @@ abstract class CI_DB_forge { /** * Process indexes * - * @param string $table - * @return string + * @param string $table Table name + * @return string[] list of SQL statements */ protected function _process_indexes($table) { diff --git a/system/database/drivers/ibase/ibase_forge.php b/system/database/drivers/ibase/ibase_forge.php index 44bb24e68..31352f128 100644 --- a/system/database/drivers/ibase/ibase_forge.php +++ b/system/database/drivers/ibase/ibase_forge.php @@ -91,7 +91,7 @@ class CI_DB_ibase_forge extends CI_DB_forge { * Create database * * @param string $db_name - * @return string + * @return bool */ public function create_database($db_name) { -- cgit v1.2.3-24-g4f1b From 09d4eb6d6272251a598986552971d6ba311f7afb Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 13 Jun 2017 13:23:27 +0300 Subject: [ci skip] Merge pull request #5150 from ytetsuro/add-oracle-rename-column-to-keyword Fix DBForge triggering ORA-00946 while renaming columns --- system/database/drivers/oci8/oci8_forge.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/database') diff --git a/system/database/drivers/oci8/oci8_forge.php b/system/database/drivers/oci8/oci8_forge.php index 867a94341..724a76df4 100644 --- a/system/database/drivers/oci8/oci8_forge.php +++ b/system/database/drivers/oci8/oci8_forge.php @@ -124,7 +124,7 @@ class CI_DB_oci8_forge extends CI_DB_forge { if ($alter_type === 'MODIFY' && ! empty($field[$i]['new_name'])) { $sqls[] = $sql.' RENAME COLUMN '.$this->db->escape_identifiers($field[$i]['name']) - .' '.$this->db->escape_identifiers($field[$i]['new_name']); + .' TO '.$this->db->escape_identifiers($field[$i]['new_name']); } $field[$i] = "\n\t".$field[$i]['_literal']; -- cgit v1.2.3-24-g4f1b From 7ff61363b7f153670e9c8e4972eb5b842fc4ea53 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 13 Jun 2017 13:26:31 +0300 Subject: [ci skip] Apply PR #5150 patch to pdo/oci and add changelog entry --- system/database/drivers/pdo/subdrivers/pdo_oci_forge.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/database') diff --git a/system/database/drivers/pdo/subdrivers/pdo_oci_forge.php b/system/database/drivers/pdo/subdrivers/pdo_oci_forge.php index c8983ee56..813207b8e 100644 --- a/system/database/drivers/pdo/subdrivers/pdo_oci_forge.php +++ b/system/database/drivers/pdo/subdrivers/pdo_oci_forge.php @@ -117,7 +117,7 @@ class CI_DB_pdo_oci_forge extends CI_DB_pdo_forge { if ($alter_type === 'MODIFY' && ! empty($field[$i]['new_name'])) { $sqls[] = $sql.' RENAME COLUMN '.$this->db->escape_identifiers($field[$i]['name']) - .' '.$this->db->escape_identifiers($field[$i]['new_name']); + .' TO '.$this->db->escape_identifiers($field[$i]['new_name']); } } } -- cgit v1.2.3-24-g4f1b From 2c1b3d9694e570c45ac82fcefbb51c965c6ea8a8 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 15 Jun 2017 14:22:49 +0300 Subject: Merge pull request #5155 from tianhe1986/develop_count_ignore_limit Fix CI_DB_query_builder::count_all_results() returning wrong count with LIMIT/OFFSET --- system/database/DB_query_builder.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/database') diff --git a/system/database/DB_query_builder.php b/system/database/DB_query_builder.php index 0abf2a260..9216651aa 100644 --- a/system/database/DB_query_builder.php +++ b/system/database/DB_query_builder.php @@ -1409,7 +1409,7 @@ abstract class CI_DB_query_builder extends CI_DB_driver { $this->qb_orderby = NULL; } - $result = ($this->qb_distinct === TRUE OR ! empty($this->qb_groupby) OR ! empty($this->qb_cache_groupby)) + $result = ($this->qb_distinct === TRUE OR ! empty($this->qb_groupby) OR ! empty($this->qb_cache_groupby) OR $this->qb_limit OR $this->qb_offset) ? $this->query($this->_count_string.$this->protect_identifiers('numrows')."\nFROM (\n".$this->_compile_select()."\n) CI_count_all_results") : $this->query($this->_compile_select($this->_count_string.$this->protect_identifiers('numrows'))); -- cgit v1.2.3-24-g4f1b