diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/pager/Mini.php b/core/modules/views/lib/Drupal/views/Plugin/views/pager/Mini.php
index da66285..472d913 100644
--- a/core/modules/views/lib/Drupal/views/Plugin/views/pager/Mini.php
+++ b/core/modules/views/lib/Drupal/views/Plugin/views/pager/Mini.php
@@ -55,14 +55,16 @@ public function summaryTitle() {
   public function query() {
     parent::query();
 
-    // Don't query for the next page if we have a pager that has a limited
-    // amount of pages.
-    if (empty($this->options['total_pages']) || ($this->getCurrentPage() < $this->options['total_pages'])) {
-      // Increase the items in the query in order to be able to find out whether
-      // there is another page.
-      $limit = $this->view->query->getLimit();
-      $limit += 1;
-      $this->view->query->setLimit($limit);
+    if ($this->getItemsPerPage() > 0) {
+      // Don't query for the next page if we have a pager that has a limited
+      // amount of pages.
+      if (empty($this->options['total_pages']) || ($this->getCurrentPage() < $this->options['total_pages'])) {
+        // Increase the items in the query in order to be able to find out whether
+        // there is another page.
+        $limit = $this->view->query->getLimit();
+        $limit += 1;
+        $this->view->query->setLimit($limit);
+      }
     }
   }
 
@@ -77,14 +79,16 @@ public function useCountQuery() {
    * Overrides \Drupal\views\Plugin\views\pager\PagerPluginBase::postExecute().
    */
   public function postExecute(&$result) {
-    // In query() one more item might have been retrieved than necessary. If so,
-    // the next link needs to be displayed and the item removed.
-    if (count($result) > $this->getItemsPerPage()) {
-      array_pop($result);
-      // Make sure the pager shows the next link by setting the total items to
-      // the biggest possible number but prevent failing calculations like
-      // ceil(PHP_INT_MAX) we take PHP_INT_MAX / 2.
-      pager_default_initialize(PHP_INT_MAX / 2, $this->getItemsPerPage(), $this->options['id']);
+    if ($this->getItemsPerPage() > 0) {
+      // In query() one more item might have been retrieved than necessary. If so,
+      // the next link needs to be displayed and the item removed.
+      if (count($result) > $this->getItemsPerPage()) {
+        array_pop($result);
+        // Make sure the pager shows the next link by setting the total items to
+        // the biggest possible number but prevent failing calculations like
+        // ceil(PHP_INT_MAX) we take PHP_INT_MAX / 2.
+        pager_default_initialize(PHP_INT_MAX / 2, $this->getItemsPerPage(), $this->options['id']);
+      }
     }
   }
 
diff --git a/core/modules/views/lib/Drupal/views/Tests/Plugin/MiniPagerTest.php b/core/modules/views/lib/Drupal/views/Tests/Plugin/MiniPagerTest.php
index d67e7d5..f46a6e6 100644
--- a/core/modules/views/lib/Drupal/views/Tests/Plugin/MiniPagerTest.php
+++ b/core/modules/views/lib/Drupal/views/Tests/Plugin/MiniPagerTest.php
@@ -91,6 +91,13 @@ public function testMiniPagerRender() {
     $this->assertText('‹‹');
     $this->assertText($this->nodes[19]->label());
 
+    $this->drupalGet('test_mini_pager_all');
+    $this->assertNoText('‹‹ test', 'The previous link does not appear on the page.');
+    $this->assertText('Page 1', 'The current page info shows the only page.');
+    $this->assertNoText('test ››', 'The next link does not appear on the page.');
+    $result = $this->xpath('//div[contains(@class, "views-row")]');
+    $this->assertEqual(count($result), count($this->nodes), 'All rows appear on the page.');
+
     // Remove all items beside 1, so there should be no links shown.
     for ($i = 0; $i < 19; $i++) {
       $this->nodes[$i]->delete();
diff --git a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_mini_pager.yml b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_mini_pager.yml
index 9483274..9a3ebb3 100644
--- a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_mini_pager.yml
+++ b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_mini_pager.yml
@@ -97,6 +97,19 @@ display:
         type: mini
         options:
           items_per_page: '1'
+  page_3:
+    display_plugin: page
+    id: page_3
+    display_title: Page
+    position: ''
+    display_options:
+      path: test_mini_pager_all
+      defaults:
+        pager: '0'
+      pager:
+        type: mini
+        options:
+          items_per_page: '0'
 base_field: nid
 status: '1'
 module: views
