Skip to content

[FIX] Prevent zero-size dump batches for small tables.#2290

Merged
Seiger merged 1 commit intoevolution-cms:3.5.xfrom
middleDuckAi:middleDuck/evo-2288-mysqldumper-row-batch
Apr 10, 2026
Merged

[FIX] Prevent zero-size dump batches for small tables.#2290
Seiger merged 1 commit intoevolution-cms:3.5.xfrom
middleDuckAi:middleDuck/evo-2288-mysqldumper-row-batch

Conversation

@middleDuckAi
Copy link
Copy Markdown
Collaborator

Closes #2288

What changed

  • prevent MysqlDumper from producing a zero row batch size when a table has only a few rows but is split into multiple parts
  • move the batch-size math into a small helper for safer regression coverage
  • add a regression test for the reported divide-by-zero shape

Why

round($rowCount / $parts) can become 0 for small positive row counts, which then causes a division-by-zero crash when calculating the total page count.

Validation

  • php -l core/src/Support/MysqlDumper.php
  • php -l core/tests/Unit/Support/MysqlDumperRowBatchSizeTest.php
  • cd core && ./vendor/bin/pest tests/Unit/Support/MysqlDumperRowBatchSizeTest.php tests/Feature/ModifiersTest.php

@Seiger Seiger merged commit 99c543d into evolution-cms:3.5.x Apr 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Division by zero in MysqlDumper.php

3 participants