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:
Reproduce v2:
ALTER TABLE `test` CHANGE `content` `content` TEXT NOT NULL DEFAULT '';
Expected:
Environment:
Verified the problem with a completely different linux environment, but i don't have the specs right now.
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;