summaryrefslogtreecommitdiffstats
path: root/system/database/drivers/pdo/subdrivers/pdo_pgsql_driver.php
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2016-01-11 11:09:52 +0100
committerAndrey Andreev <narf@devilix.net>2016-01-11 11:09:52 +0100
commit38b08116c61c0a68e6d350c986f75589220692ed (patch)
treefa8a9b5a0f0be955d42110b67037d1ff46e54604 /system/database/drivers/pdo/subdrivers/pdo_pgsql_driver.php
parent34251bfec2627fb0526d5f99f3a13a3d8a4506d8 (diff)
parentfd5fe1a64c03ae7204a7e72d936215f7a61d8c30 (diff)
Merge branch '3.0-stable' into develop
Resolved conflicts: system/database/drivers/mysql/mysql_driver.php system/database/drivers/mysqli/mysqli_driver.php
Diffstat (limited to 'system/database/drivers/pdo/subdrivers/pdo_pgsql_driver.php')
-rw-r--r--system/database/drivers/pdo/subdrivers/pdo_pgsql_driver.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/system/database/drivers/pdo/subdrivers/pdo_pgsql_driver.php b/system/database/drivers/pdo/subdrivers/pdo_pgsql_driver.php
index 2dd41ca87..79c3c7be0 100644
--- a/system/database/drivers/pdo/subdrivers/pdo_pgsql_driver.php
+++ b/system/database/drivers/pdo/subdrivers/pdo_pgsql_driver.php
@@ -154,7 +154,12 @@ class CI_DB_pdo_pgsql_driver extends CI_DB_pdo_driver {
*/
public function is_write_type($sql)
{
- return (bool) preg_match('/^\s*"?(SET|INSERT(?![^\)]+\)\s+RETURNING)|UPDATE(?!.*\sRETURNING)|DELETE|CREATE|DROP|TRUNCATE|LOAD|COPY|ALTER|RENAME|GRANT|REVOKE|LOCK|UNLOCK|REINDEX)\s/i', str_replace(array("\r\n", "\r", "\n"), ' ', $sql));
+ if (preg_match('#^(INSERT|UPDATE).*RETURNING\s.+(\,\s?.+)*$#i', $sql))
+ {
+ return FALSE;
+ }
+
+ return parent::is_write_type($sql);
}
// --------------------------------------------------------------------