I have a table where default value is not specified at the time of table creation. Now I want to change default value to '' (empty string). When I run alter table query it get success but still on new row insertion table consider NULL as default value if column value is not specified.
TABLE Schema::
CREATE TABLE `table1` (
`col1` INT(11) NOT NULL AUTO_INCREMENT,
`col2` TEXT,
`col3` INT(11) DEFAULT NULL,
`col4` TINYINT(1) DEFAULT '0',
PRIMARY KEY (`id`)
);
ALTER Query::
ALTER TABLE `table1` change `col2` `col2` text default '';