Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Change column default string value#20244

Draft
M393 wants to merge 5 commits intophpmyadmin:QA_5_2phpmyadmin/phpmyadmin:QA_5_2from
M393:change-column-default-string-valueM393/phpmyadmin:change-column-default-string-valueCopy head branch name to clipboard
Draft

Change column default string value#20244
M393 wants to merge 5 commits intophpmyadmin:QA_5_2phpmyadmin/phpmyadmin:QA_5_2from
M393:change-column-default-string-valueM393/phpmyadmin:change-column-default-string-valueCopy head branch name to clipboard

Conversation

@M393
Copy link
Contributor

@M393 M393 commented Mar 17, 2026

Fixes the column editing problem from #16801.
The default value for text columns is still displayed in quotes in the table structure page.

Example table, when editing, both column Default values should be As defined: with empty string value

CREATE TABLE `empty_default` (
`c1` TINYTEXT NOT NULL DEFAULT '', 
`c2` VARCHAR(77) NOT NULL DEFAULT '' 
) ENGINE = InnoDB;

The problem with the missing default value when it is an empty string was introduces in 8929288

The problem with quotes not being removed when editing a text column is probably even older, the value was assigned to the wrong property.

M393 added 2 commits March 17, 2026 19:09
null in a switch also matches empty string.

Signed-off-by: Maximilian Krög <maximilian.kroeg@geocept.com>
For text type columns the value is quoted. The unquoted value was
written to the wrong property in $columnMeta. Has to be 'DefaultValue'
instead of 'Default'.

Signed-off-by: Maximilian Krög <maximilian.kroeg@geocept.com>
@M393 M393 marked this pull request as draft March 19, 2026 17:11
@M393
Copy link
Contributor Author

M393 commented Mar 19, 2026

There is some ambiguity here with expressions and literals, probably best to add a new expression type to the select input.

  • None
  • As defined:
  • Expression:
  • NULL
  • CURRENT_TIMESTAMP

There are quite a few differences between the different MySQL/MariaDB versions for this, makes it rather difficult to implement.

M393 added 3 commits March 19, 2026 19:36
Signed-off-by: Maximilian Krög <maximilian.kroeg@geocept.com>
Signed-off-by: Maximilian Krög <maximilian.kroeg@geocept.com>
Signed-off-by: Maximilian Krög <maximilian.kroeg@geocept.com>
@M393 M393 force-pushed the change-column-default-string-value branch from 5ae3ff2 to f719f5e Compare March 19, 2026 18:36
Comment on lines +536 to +537
mb_substr($columnMeta['Default'], 0, 1) === "'" &&
mb_substr($columnMeta['Default'], -1) === "'"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

str_starts_with and ends_with

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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.