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>
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