Make db_select() clear cached database metadata
diff --git a/system/database/drivers/mssql/mssql_driver.php b/system/database/drivers/mssql/mssql_driver.php
index d40d67a..66d7572 100644
--- a/system/database/drivers/mssql/mssql_driver.php
+++ b/system/database/drivers/mssql/mssql_driver.php
@@ -158,6 +158,7 @@
if (mssql_select_db('['.$database.']', $this->conn_id))
{
$this->database = $database;
+ $this->data_cache = array();
return TRUE;
}
diff --git a/system/database/drivers/mysql/mysql_driver.php b/system/database/drivers/mysql/mysql_driver.php
index 78b1d70..7804dda 100644
--- a/system/database/drivers/mysql/mysql_driver.php
+++ b/system/database/drivers/mysql/mysql_driver.php
@@ -208,6 +208,7 @@
if (mysql_select_db($database, $this->conn_id))
{
$this->database = $database;
+ $this->data_cache = array();
return TRUE;
}
diff --git a/system/database/drivers/mysqli/mysqli_driver.php b/system/database/drivers/mysqli/mysqli_driver.php
index 06c3418..f52163c 100644
--- a/system/database/drivers/mysqli/mysqli_driver.php
+++ b/system/database/drivers/mysqli/mysqli_driver.php
@@ -256,6 +256,7 @@
if ($this->conn_id->select_db($database))
{
$this->database = $database;
+ $this->data_cache = array();
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 70f2bfd..38a5a8a 100644
--- a/system/database/drivers/pdo/subdrivers/pdo_mysql_driver.php
+++ b/system/database/drivers/pdo/subdrivers/pdo_mysql_driver.php
@@ -218,6 +218,7 @@
if (FALSE !== $this->simple_query('USE '.$this->escape_identifiers($database)))
{
$this->database = $database;
+ $this->data_cache = array();
return TRUE;
}
diff --git a/system/database/drivers/sqlsrv/sqlsrv_driver.php b/system/database/drivers/sqlsrv/sqlsrv_driver.php
index 0cd9ce1..c55d5f7 100644
--- a/system/database/drivers/sqlsrv/sqlsrv_driver.php
+++ b/system/database/drivers/sqlsrv/sqlsrv_driver.php
@@ -171,6 +171,7 @@
if ($this->_execute('USE '.$this->escape_identifiers($database)))
{
$this->database = $database;
+ $this->data_cache = array();
return TRUE;
}