summaryrefslogtreecommitdiffstats
path: root/system/database
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-03-01 15:18:42 +0100
committerAndrey Andreev <narf@bofh.bg>2012-03-01 15:18:42 +0100
commit67f71a415c4bd7a206fcfc1a6007d74af4590883 (patch)
tree4ce4dc197e9f56fa0cb6bedfe5fe559bd9427209 /system/database
parent850f601edef5de5680510c900c3e613bc346fe1b (diff)
Fix issue #1036 (is_write_type() returned FALSE for RENAME, OPTIMIZE queries)
Diffstat (limited to 'system/database')
-rw-r--r--system/database/DB_driver.php13
1 files changed, 4 insertions, 9 deletions
diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php
index 6352c731e..8ab5415ea 100644
--- a/system/database/DB_driver.php
+++ b/system/database/DB_driver.php
@@ -645,17 +645,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 +1438,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 */