? 926636-execute-alter-query-comment.patch
? drupal.storage-collapse.11.patch
? drupal.storage-collapse.12.patch
? head.db
? sqlite_addExpression_efq.patch
? modules/field/modules/.DS_Store
? modules/simpletest/.DS_Store
? sites/all/.DS_Store
? sites/all/contributions
? sites/all/modules/.DS_Store
? sites/all/modules/devel
? sites/all/modules/multiple_email
? sites/all/modules/multiple_email.tgz
? sites/default/files
? sites/default/settings.php
Index: includes/entity.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/entity.inc,v
retrieving revision 1.19
diff -u -p -r1.19 entity.inc
--- includes/entity.inc	30 Nov 2010 19:31:46 -0000	1.19
+++ includes/entity.inc	21 Dec 2010 01:45:44 -0000
@@ -1069,7 +1069,6 @@ class EntityFieldQuery {
     $base_table = $entity_info['base table'];
     $base_table_schema = drupal_get_schema($base_table);
     $select_query = db_select($base_table);
-    $select_query->addExpression(':entity_type', 'entity_type', array(':entity_type' => $entity_type));
     // Process the property conditions.
     foreach ($this->propertyConditions as $property_condition) {
       $this->addCondition($select_query, "$base_table." . $property_condition['column'], $property_condition);
@@ -1130,7 +1129,7 @@ class EntityFieldQuery {
       }
     }
 
-    return $this->finishQuery($select_query);
+    return $this->finishQuery($select_query, 'entity_id', $entity_type);
   }
 
   /**
@@ -1161,11 +1160,13 @@ class EntityFieldQuery {
    *   fields added.
    * @param $id_key
    *   Which field's values to use as the returned array keys.
+   * @param $entity_type
+   *   Internal use only: the type of entity appearing in the result.
    *
    * @return
    *   See EntityFieldQuery::execute().
    */
-  function finishQuery($select_query, $id_key = 'entity_id') {
+  function finishQuery($select_query, $id_key = 'entity_id', $entity_type = NULL) {
     foreach ($this->tags as $tag) {
       $select_query->addTag($tag);
     }
@@ -1182,6 +1183,9 @@ class EntityFieldQuery {
     $return = array();
     foreach ($select_query->execute() as $partial_entity) {
       $bundle = isset($partial_entity->bundle) ? $partial_entity->bundle : NULL;
+      if (!empty($entity_type)) {
+        $partial_entity->entity_type = $entity_type;
+      }
       $entity = entity_create_stub_entity($partial_entity->entity_type, array($partial_entity->entity_id, $partial_entity->revision_id, $bundle));
       $return[$partial_entity->entity_type][$partial_entity->$id_key] = $entity;
       $this->ordered_results[] = $partial_entity;
