Skip to content

Fix inherited collation when editing a column - #20491

Open
omkolte17 wants to merge 1 commit into
phpmyadmin:QA_5_2from
omkolte17:fix/20411-inherited-column-collation-5.2
Open

omkolte17 wants to merge 1 commit into
phpmyadmin:QA_5_2from
omkolte17:fix/20411-inherited-column-collation-5.2

Conversation

@omkolte17

Copy link
Copy Markdown

Summary

Column metadata reports the effective collation even when a column inherits it from the table. The edit form previously treated that value as an explicit column choice, so changing another property added a COLLATE clause.

Use SHOW CREATE TABLE to distinguish inherited settings from explicit column COLLATE or character set clauses. Leave the collation choice blank for inherited columns, preserve explicit settings, and retain the prior behavior if the table definition cannot be parsed.

Fixes #20411

Verification

  • On MySQL 8.4.11 with the QA_5_2 build, changed an inherited VARCHAR column from NOT NULL to NULL through phpMyAdmin. The generated ALTER TABLE contained no COLLATE clause, and SHOW CREATE TABLE still showed no column collation clause.
  • Changed an explicitly collated column the same way. Its generated SQL and resulting table definition retained the explicit collation.
  • Focused PHPUnit tests passed; PHPCS and PHPStan reported no errors.

The commit includes the required DCO sign-off.

Signed-off-by: Om Kolte <26180402+omkolte17@users.noreply.github.com>
@codecov

codecov Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 87.50000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 50.43%. Comparing base (e5255f8) to head (14bad64).
⚠️ Report is 1 commits behind head on QA_5_2.

Files with missing lines Patch % Lines
...s/Controllers/Table/Structure/ChangeController.php 87.50% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             QA_5_2   #20491      +/-   ##
============================================
+ Coverage     50.12%   50.43%   +0.31%     
- Complexity    17249    17261      +12     
============================================
  Files           607      607              
  Lines         68276    68300      +24     
============================================
+ Hits          34221    34446     +225     
+ Misses        34055    33854     -201     
Flag Coverage Δ
dbase-extension 50.22% <87.50%> (+0.07%) ⬆️
guzzlehttp/psr7-psr-7 50.14% <87.50%> (+0.01%) ⬆️
laminas/laminas-diactoros-psr-7 50.28% <87.50%> (+0.84%) ⬆️
nyholm/psr7-psr-7 50.10% <87.50%> (-1.19%) ⬇️
recode-extension 50.15% <87.50%> (-0.01%) ⬇️
slim/psr7-psr-7 50.15% <87.50%> (-0.01%) ⬇️
unit-7.2-ubuntu-latest 50.20% <87.50%> (-0.48%) ⬇️
unit-7.3-ubuntu-latest 49.40% <87.50%> (+<0.01%) ⬆️
unit-7.4-ubuntu-latest 50.80% <87.50%> (+1.37%) ⬆️
unit-8.0-ubuntu-latest 49.54% <87.50%> (+0.05%) ⬆️
unit-8.1-ubuntu-latest 49.49% <87.50%> (-0.01%) ⬇️
unit-8.2-ubuntu-latest 49.47% <87.50%> (+0.06%) ⬆️
unit-8.3-ubuntu-latest 49.45% <87.50%> (+0.05%) ⬆️
unit-8.4-ubuntu-latest 49.47% <87.50%> (+0.07%) ⬆️
unit-8.5-ubuntu-latest 49.41% <87.50%> (+<0.01%) ⬆️
unit-8.6-ubuntu-latest 49.47% <87.50%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

1 participant