summaryrefslogtreecommitdiffstats
path: root/system/database/drivers/mysql/mysql_driver.php
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-03-03 02:25:23 +0100
committerAndrey Andreev <narf@bofh.bg>2012-03-03 02:25:23 +0100
commit80e34f9cbd722193a5bdb94f4b593ae98c10efc7 (patch)
tree5d71422853b5d6ea1470b187fdfa1d042cab978a /system/database/drivers/mysql/mysql_driver.php
parenta92c7cdeddd9f1b46a6c8f254b2949ad047bbc21 (diff)
parent08856b8738ea4fc17b13986c9f2619383cb4a6e9 (diff)
Merge upstream branch
Diffstat (limited to 'system/database/drivers/mysql/mysql_driver.php')
-rw-r--r--system/database/drivers/mysql/mysql_driver.php29
1 files changed, 11 insertions, 18 deletions
diff --git a/system/database/drivers/mysql/mysql_driver.php b/system/database/drivers/mysql/mysql_driver.php
index c88a8a766..7108a6db1 100644
--- a/system/database/drivers/mysql/mysql_driver.php
+++ b/system/database/drivers/mysql/mysql_driver.php
@@ -157,13 +157,15 @@ class CI_DB_mysql_driver extends CI_DB {
// --------------------------------------------------------------------
/**
- * Version number query string
+ * Database version number
*
* @return string
*/
- protected function _version()
+ public function version()
{
- return 'SELECT version() AS ver';
+ return isset($this->data_cache['version'])
+ ? $this->data_cache['version']
+ : $this->data_cache['version'] = @mysql_get_server_info($this->conn_id);
}
// --------------------------------------------------------------------
@@ -417,25 +419,16 @@ class CI_DB_mysql_driver extends CI_DB {
// --------------------------------------------------------------------
/**
- * The error message string
+ * Error
*
- * @return string
- */
- protected function _error_message()
- {
- return mysql_error($this->conn_id);
- }
-
- // --------------------------------------------------------------------
-
- /**
- * The error message number
+ * Returns an array containing code and message of the last
+ * database error that has occured.
*
- * @return int
+ * @return array
*/
- protected function _error_number()
+ public function error()
{
- return mysql_errno($this->conn_id);
+ return array('code' => mysql_errno($this->conn_id), 'message' => mysql_error($this->conn_id));
}
// --------------------------------------------------------------------