Phpmyadmin: Alter table with TEXT DEFAULT '' misbehaves

Created on 28 Jun 2019  路  3Comments  路  Source: phpmyadmin/phpmyadmin

Changing the default value of a field with type TEXT to nothing (empty string), adds two quotes as a new default.

Given a table 'test' with a field 'content' as TEXT.

Reproduce v1:

  • open table structure view
  • click on CHANGE for field 'content'
  • change field settings to DEFAULT 'As defined' and leave default value blank.

Reproduce v2:

  • go to SQL and
  • ALTER TABLE `test` CHANGE `content` `content` TEXT NOT NULL DEFAULT '';

Expected:

  • In the structure view, the default value should be empty and not show '' (compare to type varchar).
  • INSERT form should not add '' to the text field but rather leave it empty.

Environment:

  • Operating system: Win10
  • Web server: Apache/2.4.39 (Win64) OpenSSL/1.1.1c
  • Database version: 10.3.15-MariaDB
  • PHP version: PHP/7.3.6
  • phpMyAdmin version: 4.9.0.1
  • Browser: Any
  • Operating system: Any

Verified the problem with a completely different linux environment, but i don't have the specs right now.

bug has-pr

All 3 comments

image

image

image

image

Just reproduced this and I was going to open an issue!

Test table:


CREATE TABLE `issue-15363` (
  `id` int(11) DEFAULT NULL,
  `empty text` text DEFAULT '',
  `empty varchar` varchar(25) NOT NULL DEFAULT '',
  `really empty string` varchar(25) NOT NULL DEFAULT '''''',
  `really empty text` text NOT NULL DEFAULT '\'\'',
  `l'eau dans un varchar` varchar(25) NOT NULL DEFAULT 'l''eau ',
  `l'eau 2` text NOT NULL DEFAULT 'l\'eau',
  `l'eau dans un texte` text NOT NULL DEFAULT 'l\'eau',
  `l'eau` varchar(25) NOT NULL DEFAULT 'l''eau \\n \\n \\t l''eau',
  `l'eau 3` text NOT NULL DEFAULT 'l\'eau \\n \\n \\t l\'eau'
) ENGINE=InnoDB;
Was this page helpful?
0 / 5 - 0 ratings

Related issues

Imrulkais picture Imrulkais  路  3Comments

barkermn01 picture barkermn01  路  3Comments

mauriciofauth picture mauriciofauth  路  3Comments

AlexeyKosov picture AlexeyKosov  路  3Comments

viking1972 picture viking1972  路  3Comments