summaryrefslogtreecommitdiffstats
path: root/system/database/DB_driver.php
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-03-01 18:28:04 +0100
committerAndrey Andreev <narf@bofh.bg>2012-03-01 18:28:04 +0100
commitb92d4e7c807fc87b961eeaa90c1c2bdc619cddd9 (patch)
tree442521251f981bbf44dd58247010252eae17d887 /system/database/DB_driver.php
parenta10c8e17bbd1eb75aed1bb74523449f81ee393a2 (diff)
parente3a68042c086acfc98ae273adbd8527af0c6ab8b (diff)
Merge upstream branch
Diffstat (limited to 'system/database/DB_driver.php')
-rw-r--r--system/database/DB_driver.php24
1 files changed, 9 insertions, 15 deletions
diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php
index 6352c731e..5f435e363 100644
--- a/system/database/DB_driver.php
+++ b/system/database/DB_driver.php
@@ -185,20 +185,19 @@ class CI_DB_driver {
/**
* Set client character set
*
- * @access public
* @param string
* @param string
- * @return resource
+ * @return bool
*/
- function db_set_charset($charset, $collation)
+ public function db_set_charset($charset, $collation = '')
{
- if ( ! $this->_db_set_charset($this->char_set, $this->dbcollat))
+ if (method_exists($this, '_db_set_charset') && ! $this->_db_set_charset($charset, $collation))
{
- log_message('error', 'Unable to set database connection charset: '.$this->char_set);
+ log_message('error', 'Unable to set database connection charset: '.$charset);
if ($this->db_debug)
{
- $this->display_error('db_unable_to_set_charset', $this->char_set);
+ $this->display_error('db_unable_to_set_charset', $charset);
}
return FALSE;
@@ -645,17 +644,12 @@ class CI_DB_driver {
/**
* Determines if a query is a "write" type.
*
- * @access public
* @param string An SQL query string
- * @return boolean
+ * @return bool
*/
- function is_write_type($sql)
+ public function is_write_type($sql)
{
- if ( ! preg_match('/^\s*"?(SET|INSERT|UPDATE|DELETE|REPLACE|CREATE|DROP|TRUNCATE|LOAD DATA|COPY|ALTER|GRANT|REVOKE|LOCK|UNLOCK)\s+/i', $sql))
- {
- return FALSE;
- }
- return TRUE;
+ return (bool) preg_match('/^\s*"?(SET|INSERT|UPDATE|DELETE|REPLACE|CREATE|DROP|TRUNCATE|LOAD DATA|COPY|ALTER|RENAME|GRANT|REVOKE|LOCK|UNLOCK|OPTIMIZE)\s+/i', $sql);
}
// --------------------------------------------------------------------
@@ -1443,4 +1437,4 @@ class CI_DB_driver {
}
/* End of file DB_driver.php */
-/* Location: ./system/database/DB_driver.php */ \ No newline at end of file
+/* Location: ./system/database/DB_driver.php */