summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTufan Barış YILDIRIM <tufanbarisyildirim@gmail.com>2013-12-19 20:30:56 +0100
committerTufan Barış YILDIRIM <tufanbarisyildirim@gmail.com>2013-12-19 20:30:56 +0100
commit30893b901b9e91c013f86ef733407e17ea084d4c (patch)
tree2881e18b54f3dc5235d28dfbd17e60992d34f62f
parentf1cceaa271fe86e68e0dfc3181d4b39ce4e5f846 (diff)
changed EXISTS / NOT EXISTS pattern
@narfbg "It has parenthesis, so use the IN / NOT IN pattern as a base."
-rw-r--r--system/database/DB_driver.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php
index ffee74df7..33903434c 100644
--- a/system/database/DB_driver.php
+++ b/system/database/DB_driver.php
@@ -1421,7 +1421,7 @@ abstract class CI_DB_driver {
*/
protected function _has_operator($str)
{
- return (bool) preg_match('/(<|>|!|=|\sIS NULL|\sIS NOT NULL|EXISTS|\sBETWEEN|\sLIKE|\sIN\s*\(|\s)/i', trim($str));
+ return (bool) preg_match('/(<|>|!|=|\sIS NULL|\sIS NOT NULL|\sEXISTS|\sBETWEEN|\sLIKE|\sIN\s*\(|\s)/i', trim($str));
}
// --------------------------------------------------------------------
@@ -1447,8 +1447,8 @@ abstract class CI_DB_driver {
'\s*>\s*', // >
'\s+IS NULL', // IS NULL
'\s+IS NOT NULL', // IS NOT NULL
- '\s+EXISTS', // EXISTS
- '\s+NOT EXISTS', // NOT EXISTS
+ '\s+EXISTS\s*\([^\)]+\)', // EXISTS(sql)
+ '\s+NOT EXISTS\s*\([^\)]+\)', // NOT EXISTS(sql)
'\s+BETWEEN\s+\S+\s+AND\s+\S+', // BETWEEN value AND value
'\s+IN\s*\([^\)]+\)', // IN(list)
'\s+NOT IN\s*\([^\)]+\)', // NOT IN (list)