Skip to content

fix(system): Correct issues with data formatting in database tables grid - #72

Open
Ibochkarev wants to merge 24 commits into
3.xfrom
fix/14976-database-tables-mysql8
Open

fix(system): Correct issues with data formatting in database tables grid#72
Ibochkarev wants to merge 24 commits into
3.xfrom
fix/14976-database-tables-mysql8

Conversation

@Ibochkarev

@Ibochkarev Ibochkarev commented Aug 21, 2026

Copy link
Copy Markdown
Member

Что сделано

  • Кастует Data_length / Data_free / Index_length в int перед мат-операциями размера (MySQL 8 может вернуть NULL).
  • Использует сырые размеры для eligibility optimize/truncate; UI truncate совпадает с database_truncate.
  • Логирует и возвращает пусто, когда имя или SHOW TABLE STATUS-стейтмент отсутствуют.

Зачем нужно

На MySQL 8 грид Database Tables может прийти пустым, когда config dbname пуст, а NULL-колонки размера ломают старую арифметику и ссылку optimize.

Как проверить

  1. Откройте Reports → System Information → Database Tables
  2. Подтвердите, что таблицы перечислены с размерами
  3. Подтвердите Optimize только при overhead (Data_free > 0)
  4. Подтвердите Truncate только на manager_log с database_truncate

Связанные

Refs modxcms#14976

Оригинал: modxcms#16855

Ibochkarev and others added 24 commits July 27, 2026 18:54
- Resolve database name via SELECT DATABASE() with config fallback for MySQL 8
- Cast Data_length, Data_free, Index_length to int to handle NULL in SHOW TABLE STATUS
- Compute Effective_size as max(0, dataLength - dataFree)
- Extract formatTableRow(), cache permission and manager_log table name before loop
- Add type hints for formatTableRow parameters

Resolves modxcms#14976
…processor

- Added logging for cases where the database name cannot be determined.
- Enhanced error handling by returning early if the statement is null.
- Changed access modifiers for formatTableRow() and getDatabaseName() methods to protected for better extensibility.
…ist.php

Co-authored-by: Jim Graham <jim@pixelsandstrings.com>
…ist.php

Co-authored-by: Jim Graham <jim@pixelsandstrings.com>
…ist.php

Co-authored-by: Jim Graham <jim@pixelsandstrings.com>
…ist.php

Co-authored-by: Jim Graham <jim@pixelsandstrings.com>
…ist.php

Co-authored-by: Jim Graham <jim@pixelsandstrings.com>
…ist.php

Co-authored-by: Jim Graham <jim@pixelsandstrings.com>
…ist.php

Co-authored-by: Jim Graham <jim@pixelsandstrings.com>
…ist.php

Co-authored-by: Jim Graham <jim@pixelsandstrings.com>
…ist.php

Co-authored-by: Jim Graham <jim@pixelsandstrings.com>
Co-authored-by: Jim Graham <jim@pixelsandstrings.com>
…ist.php

Co-authored-by: Jim Graham <jim@pixelsandstrings.com>
…ist.php

Co-authored-by: Jim Graham <jim@pixelsandstrings.com>
…ist.php

Co-authored-by: Jim Graham <jim@pixelsandstrings.com>
…ist.php

Co-authored-by: Jim Graham <jim@pixelsandstrings.com>
…ist.php

Co-authored-by: Jim Graham <jim@pixelsandstrings.com>
…ist.php

Co-authored-by: Jim Graham <jim@pixelsandstrings.com>
…ist.php

Co-authored-by: Jim Graham <jim@pixelsandstrings.com>
Fix spacing and remove extra doc block
…ist.php

Co-authored-by: Jim Graham <jim@pixelsandstrings.com>
…ist.php

Co-authored-by: Jim Graham <jim@pixelsandstrings.com>
…ist.php

Co-authored-by: Jim Graham <jim@pixelsandstrings.com>
@Ibochkarev Ibochkarev changed the title fix(system): исправить форматирование данных в грид таблиц БД fix(system): Correct issues with data formatting in database tables grid Aug 21, 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.

2 participants