summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2013-12-19 20:33:04 +0100
committerAndrey Andreev <narf@devilix.net>2013-12-19 20:33:04 +0100
commitec03e972205a1b82ab24e7df368ad74f63d04560 (patch)
tree55888bb85f26b3c71eeabddc32ad30abd3e1e796
parent3cfd53937034d92ff15f9c2457a0f5bc1d80b0f6 (diff)
parent341532c5d631689c3f9f1a318db598d1ce5344d8 (diff)
Merge pull request #2781 from tufanbarisyildirim/develop
EXISTS / NOT EXISTS clause support for DB_driver
-rw-r--r--system/database/DB_driver.php6
-rw-r--r--user_guide_src/source/changelog.rst1
2 files changed, 5 insertions, 2 deletions
diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php
index 72be14e4b..ba6a4b70d 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|\sEXISTS|\sNOT 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\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)
diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst
index d1a5e8c2b..3dc7ade36 100644
--- a/user_guide_src/source/changelog.rst
+++ b/user_guide_src/source/changelog.rst
@@ -137,6 +137,7 @@ Release Date: Not Released
- Database
+ - Added EXISTS / NOT EXISTS support to DB_Driver class.
- Added **dsn** configuration setting for drivers that support DSN strings (PDO, PostgreSQL, Oracle, ODBC, CUBRID).
- Added **schema** configuration setting (defaults to *public*) for drivers that might need it (currently used by PostgreSQL and ODBC).
- Added subdrivers support (currently only used by PDO).