Skip to content

Fix missing table metadata in structure and designer views - #20548

Open
kenny-ish wants to merge 2 commits into
phpmyadmin:masterfrom
kenny-ish:fix-missing-table-metadata-20493
Open

kenny-ish wants to merge 2 commits into
phpmyadmin:masterfrom
kenny-ish:fix-missing-table-metadata-20493

Conversation

@kenny-ish

Copy link
Copy Markdown

Description

Fixes #20493

When a storage engine is removed, MariaDB can leave table metadata with a null row count and without column metadata. The database structure template passed the null value to format_number(), while the designer template treated an empty column list as one empty column.

This change:

  • skips the row-count cell when TABLE_ROWS is null
  • iterates over the available designer columns and defaults missing metadata to an empty list
  • adds regression tests for both affected templates

Test plan

  • composer run phpunit -- --testsuite unit --filter 'TemplateTest::testRender(DesignerTableWithoutColumnMetadata|StructureTableWithoutRowCount)' --no-coverage --display-all-issues
  • composer run phpunit -- --testsuite unit --display-all-issues --no-coverage
  • ./tests/ci-phplint
  • composer phpcs
  • composer run twig-lint
  • composer phpstan -- --memory-limit 2G
  • composer psalm

Checklist

  • I have read the contributing guidelines.
  • Every commit has a Signed-off-by line.
  • The change is covered by tests.

A removed storage engine can leave a table without a row count or column
metadata. Avoid formatting a null row count and render the designer table
without inventing an empty column.

Fixes phpmyadmin#20493
Signed-off-by: kenny-ish <114967656+kenny-ish@users.noreply.github.com>
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.

[6.0]: Issues after DUCKDB engine is removed

2 participants