Fixing bug in DB Driver where identifiers could be escaped in some drivers that can't accept it in the list_fields() function.
http://codeigniter.com/bug_tracker/bug/5865/
http://codeigniter.com/bug_tracker/bug/11218/
diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php
index 390d557..d7f17cc 100644
--- a/system/database/DB_driver.php
+++ b/system/database/DB_driver.php
@@ -822,7 +822,7 @@
return FALSE;
}
- if (FALSE === ($sql = $this->_list_columns($this->_protect_identifiers($table, TRUE, NULL, FALSE))))
+ if (FALSE === ($sql = $this->_list_columns($table)))
{
if ($this->db_debug)
{
diff --git a/system/database/drivers/mysql/mysql_driver.php b/system/database/drivers/mysql/mysql_driver.php
index 85a6ef4..bd60d9f 100644
--- a/system/database/drivers/mysql/mysql_driver.php
+++ b/system/database/drivers/mysql/mysql_driver.php
@@ -408,7 +408,7 @@
*/
function _list_columns($table = '')
{
- return "SHOW COLUMNS FROM ".$table;
+ return "SHOW COLUMNS FROM ".$this->_protect_identifiers($table, TRUE, NULL, FALSE);
}
// --------------------------------------------------------------------
diff --git a/system/database/drivers/mysqli/mysqli_driver.php b/system/database/drivers/mysqli/mysqli_driver.php
index 5d7200f..d0e2def 100644
--- a/system/database/drivers/mysqli/mysqli_driver.php
+++ b/system/database/drivers/mysqli/mysqli_driver.php
@@ -409,7 +409,7 @@
*/
function _list_columns($table = '')
{
- return "SHOW COLUMNS FROM ".$table;
+ return "SHOW COLUMNS FROM ".$this->_protect_identifiers($table, TRUE, NULL, FALSE);
}
// --------------------------------------------------------------------