diff options
Diffstat (limited to 'system/database/drivers/cubrid/cubrid_driver.php')
-rw-r--r-- | system/database/drivers/cubrid/cubrid_driver.php | 36 |
1 files changed, 14 insertions, 22 deletions
diff --git a/system/database/drivers/cubrid/cubrid_driver.php b/system/database/drivers/cubrid/cubrid_driver.php index 99b8e0051..0a3a8725c 100644 --- a/system/database/drivers/cubrid/cubrid_driver.php +++ b/system/database/drivers/cubrid/cubrid_driver.php @@ -175,13 +175,15 @@ class CI_DB_cubrid_driver extends CI_DB { // -------------------------------------------------------------------- /** - * Version number query string + * Database version number * * @return string */ - protected function _version() + public function version() { - return cubrid_get_server_info($this->conn_id); + return isset($this->data_cache['version']) + ? $this->data_cache['version'] + : $this->data_cache['version'] = cubrid_get_server_info($this->conn_id); } // -------------------------------------------------------------------- @@ -372,7 +374,8 @@ class CI_DB_cubrid_driver extends CI_DB { { return 0; } - $query = $this->query($this->_count_string.$this->_protect_identifiers('numrows').' FROM '.$this->_protect_identifiers($table, TRUE, NULL, FALSE)); + + $query = $this->query($this->_count_string.$this->protect_identifiers('numrows').' FROM '.$this->protect_identifiers($table, TRUE, NULL, FALSE)); if ($query->num_rows() == 0) { return 0; @@ -417,7 +420,7 @@ class CI_DB_cubrid_driver extends CI_DB { */ protected function _list_columns($table = '') { - return 'SHOW COLUMNS FROM '.$this->_protect_identifiers($table, TRUE, NULL, FALSE); + return 'SHOW COLUMNS FROM '.$this->protect_identifiers($table, TRUE, NULL, FALSE); } // -------------------------------------------------------------------- @@ -438,29 +441,18 @@ class CI_DB_cubrid_driver extends CI_DB { // -------------------------------------------------------------------- /** - * The error message string + * Error * - * @return string - */ - protected function _error_message() - { - return cubrid_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 cubrid_errno($this->conn_id); + return array('code' => cubrid_errno($this->conn_id), 'message' => cubrid_error($this->conn_id)); } - // -------------------------------------------------------------------- - /** * Escape the SQL Identifiers * |