From 5f67e128b2150d8652aeeb809e852644e02d3079 Mon Sep 17 00:00:00 2001
From: Bob Vincent <bobvin@pillars.net>
Date: Wed, 6 Jul 2011 08:51:20 -0400
Subject: [PATCH] Issue #1210606: Document that argument length should be limited in node_delete_multiple(), node_load_multiple(), and DrupalDefaultEntityController::buildQuery() functions.

---
 includes/entity.inc      |    3 +++
 modules/node/node.module |    9 ++++++++-
 2 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/includes/entity.inc b/includes/entity.inc
index 9ee7889cfb7ca439e77cfdb44282b68e19584a0a..ebcb21700c6233e841a7ca5b75dc95f168097fe9 100644
--- a/includes/entity.inc
+++ b/includes/entity.inc
@@ -238,6 +238,9 @@ class DrupalDefaultEntityController implements DrupalEntityControllerInterface {
    * See CommentController::buildQuery() or TaxonomyTermController::buildQuery()
    * for examples.
    *
+   * Since all the arguments are combined into a single query, their length
+   * should be limited to avoid PDO and out-of-memory errors.
+   *
    * @param $ids
    *   An array of entity IDs, or FALSE to load all entities.
    * @param $conditions
diff --git a/modules/node/node.module b/modules/node/node.module
index 8476970203c6aeeae6d4e5348465d796d775bef8..7479fa8f635911f6ccbc354532c26c7169b97851 100644
--- a/modules/node/node.module
+++ b/modules/node/node.module
@@ -884,7 +884,9 @@ function node_invoke($node, $hook, $a2 = NULL, $a3 = NULL, $a4 = NULL) {
  *
  * This function should be used whenever you need to load more than one node
  * from the database. Nodes are loaded into memory and will not require
- * database access if loaded again during the same page request.
+ * database access if loaded again during the same page request. Since the
+ * query builder tries to load all the nodes in a single query, the length of
+ * the argument array should be limited to avoid PDO and out-of-memory errors.
  *
  * @see entity_load()
  * @see EntityFieldQuery
@@ -1188,6 +1190,11 @@ function node_delete($nid) {
 /**
  * Delete multiple nodes.
  *
+ * The nodes are first loaded into memory via node_load_multiple() before being
+ * deleted. Since the query builder tries to load all the nodes in a single
+ * query, the length of the argument array should be limited to avoid PDO and
+ * out-of-memory errors.
+ *
  * @param $nids
  *   An array of node IDs.
  */
-- 
1.7.4.1

