diff --git a/core/lib/Drupal/Core/Database/Query/Select.php b/core/lib/Drupal/Core/Database/Query/Select.php
index b269410..a5e93e8 100644
--- a/core/lib/Drupal/Core/Database/Query/Select.php
+++ b/core/lib/Drupal/Core/Database/Query/Select.php
@@ -660,7 +660,7 @@ public function orderRandom() {
    * {@inheritdoc}
    */
   public function range($start = NULL, $length = NULL) {
-    $this->range = func_num_args() ? array('start' => $start, 'length' => $length) : array();
+    $this->range = $start !== NULL ? array('start' => $start, 'length' => $length) : array();
     return $this;
   }

diff --git a/core/tests/Drupal/KernelTests/Core/Database/SelectComplexTest.php b/core/tests/Drupal/KernelTests/Core/Database/SelectComplexTest.php
index ccf153b..3fe713b 100644
--- a/core/tests/Drupal/KernelTests/Core/Database/SelectComplexTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Database/SelectComplexTest.php
@@ -155,6 +155,20 @@ function testRange() {
   }

   /**
+   * Test whether the range property of a select clause can be undone.
+   */
+  function testRangeUndo() {
+    $query = db_select('test');
+    $name_field = $query->addField('test', 'name');
+    $age_field = $query->addField('test', 'age', 'age');
+    $query->range(0, 2);
+    $query->range(NULL, NULL);
+    $query_result = $query->countQuery()->execute()->fetchField();
+
+    $this->assertEqual($query_records, 4, 'Returned the correct number of rows.');
+  }
+
+  /**
    * Tests distinct queries.
    */
   function testDistinct() {
