summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2015-07-02 10:46:56 +0200
committerAndrey Andreev <narf@devilix.net>2015-07-02 10:46:56 +0200
commita1170aff602317d9b6f2d5c1d5cc60d3dc82ee58 (patch)
treeacd33c8b0330ad59f14a5d960340265a79834911
parent441d3536b79bc53c80dd710a803ac5d0baba6c18 (diff)
Fix QB delete() for multiple tables with where()
Reported via the forums: http://forum.codeigniter.com/thread-61774.html
-rw-r--r--system/database/DB_query_builder.php3
-rw-r--r--user_guide_src/source/changelog.rst2
2 files changed, 4 insertions, 1 deletions
diff --git a/system/database/DB_query_builder.php b/system/database/DB_query_builder.php
index 859f9f564..a8b5b3579 100644
--- a/system/database/DB_query_builder.php
+++ b/system/database/DB_query_builder.php
@@ -2092,10 +2092,13 @@ abstract class CI_DB_query_builder extends CI_DB_driver {
}
elseif (is_array($table))
{
+ empty($where) && $reset_data = FALSE;
+
foreach ($table as $single_table)
{
$this->delete($single_table, $where, $limit, $reset_data);
}
+
return;
}
else
diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst
index 073f687e9..edbcf2f6a 100644
--- a/user_guide_src/source/changelog.rst
+++ b/user_guide_src/source/changelog.rst
@@ -45,7 +45,7 @@ Bug fixes for 3.0.1
- Fixed a bug (#3922) - :doc:`Email <libraries/email>` and :doc:`XML-RPC <libraries/xmlrpc>` libraries could enter an infinite loop due to `PHP bug #39598 <https://bugs.php.net/bug.php?id=39598>`_.
- Fixed a bug (#3913) - :doc:`Cache Library <libraries/caching>` didn't work with the direct ``$this->cache->$driver_name->method()`` syntax with Redis and Memcache(d).
- Fixed a bug (#3932) - :doc:`Query Builder <database/query_builder>` didn't properly compile WHERE and HAVING conditions for field names that end with "and", "or".
-
+- Fixed a bug in :doc:`Query Builder <database/query_builder>` where ``delete()`` didn't properly work on multiple tables with a WHERE condition previously set via ``where()``.
Version 3.0.0
=============