phpmyadmin / phpmyadmin/phpmyadmin

[Bug]: Pagination count is not accurate

Open
#20,448 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bug
Dominant language
PHP
Stars
7.9k
Forks
3.6k
Avg merge
4d 18h
Merged PRs (30d)
36

Description

Describe the bug

Pagination count is not accurate when using WHERE and also when there are hundreds of thousands of rows.

It adds 1 more page than it should.

How to Reproduce
  1. Go to https://demo.phpmyadmin.net/master-config/public/index.php?route=/database/structure&db=world&server=1

  2. Run:

CREATE TABLE `test` (
  `id` int(10) unsigned NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=FIXED;

INSERT INTO `test` (`id`) SELECT `seq` FROM seq_1_to_982289;

SELECT * FROM `test` WHERE `id` >= 82290;
  1. Go to last page
Expected behavior

Exact pagination count.

Screenshots

https://github.com/user-attachments/assets/c2dc1eab-7858-4564-b7e3-4326815f5dd0

Database Server

MariaDB

phpMyAdmin version

5.2.4-dev, 6.0.0-dev

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue from the linked phpMyAdmin database structure page with the provided MariaDB SQL, especially the SELECT using WHERE on the large test table. Trace how pagination calculates the count and verify that the last page shows the exact number of matching rows without an extra page.

Written by the indexing model from the issue text.

Assessment

Tech stack
mariadb, php
Domain
databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.