diff --git a/core/lib/Drupal/Core/Entity/Query/Sql/Condition.php b/core/lib/Drupal/Core/Entity/Query/Sql/Condition.php
index 1ee2c3d..22af2cb 100644
--- a/core/lib/Drupal/Core/Entity/Query/Sql/Condition.php
+++ b/core/lib/Drupal/Core/Entity/Query/Sql/Condition.php
@@ -55,7 +55,16 @@ public function compile($conditionContainer) {
           $conditionContainer->where($condition['where'], $condition['where_args']);
         }
         else {
-          $conditionContainer->condition($field, $condition['value'], $condition['operator']);
+          // Only IN and NOT IN supports arrays.
+          if ($condition['value'] === array()) {
+            if ($condition['operator'] == 'IN') {
+              $conditionContainer->where('1 = 0');
+            }
+            // NOT IN () is always TRUE, nothing to do.
+          }
+          else {
+            $conditionContainer->condition($field, $condition['value'], $condition['operator']);
+          }
         }
       }
     }
diff --git a/core/modules/system/src/Tests/Entity/EntityQueryTest.php b/core/modules/system/src/Tests/Entity/EntityQueryTest.php
index 4130804..f2242b3 100644
--- a/core/modules/system/src/Tests/Entity/EntityQueryTest.php
+++ b/core/modules/system/src/Tests/Entity/EntityQueryTest.php
@@ -150,6 +150,20 @@ protected function setUp() {
    * Test basic functionality.
    */
   function testEntityQuery() {
+    // Test empty "in" operation.
+    $results = $this->factory->get('entity_test_mulrev')
+      ->condition('id', array(), 'IN')
+      ->sort('revision_id')
+      ->execute();
+    $this->assertIdentical($results, array());
+    // Test empty "not in" operation.
+    $this->queryResults = $this->factory->get('entity_test_mulrev')
+      ->condition('id', array(), 'NOT IN')
+      ->sort('id')
+      ->execute();
+    // Now we get everything.
+    $this->assertResult(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+
     $greetings = $this->greetings;
     $figures = $this->figures;
     $this->queryResults = $this->factory->get('entity_test_mulrev')
