diff options
author | Tufan Barış YILDIRIM <tufanbarisyildirim@gmail.com> | 2013-12-19 18:48:00 +0100 |
---|---|---|
committer | Tufan Barış YILDIRIM <tufanbarisyildirim@gmail.com> | 2013-12-19 18:58:33 +0100 |
commit | 0f0e6adee7d3edf45fbadf5ec01505a46d70760d (patch) | |
tree | afbbb4fa6270c2ca358de527975ba52c1fd4891b | |
parent | 3cfd53937034d92ff15f9c2457a0f5bc1d80b0f6 (diff) |
EXISTS / NOT EXISTS clause support for DB_driver
-rw-r--r-- | system/database/DB_driver.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php index 72be14e4b..ec3de7e6e 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|\sBETWEEN|\sLIKE|\sIN\s*\(|\s)/i', trim($str)); + return (bool) preg_match('/(<|>|!|=|\sIS NULL|\sIS NOT NULL|EXISTS|\sBETWEEN|\sLIKE|\sIN\s*\(|\s)/i', trim($str)); } // -------------------------------------------------------------------- @@ -1446,7 +1446,9 @@ abstract class CI_DB_driver { '\s*<>?\s*', // <, <> '\s*>\s*', // > '\s+IS NULL', // IS NULL - '\s+IS NOT NULL', // IS NOT NULL + '\s+IS NOT NULL', // IS NOT NULL + '\s+EXISTS', // EXISTS + '\s+NOT EXISTS', // NOT EXISTS '\s+BETWEEN\s+\S+\s+AND\s+\S+', // BETWEEN value AND value '\s+IN\s*\([^\)]+\)', // IN(list) '\s+NOT IN\s*\([^\)]+\)', // NOT IN (list) |