Bug #26798 ERROR 1101 (42000): BLOB/TEXT column 'b' can't have a default value
Submitted: 2 Mar 2007 15:54 Modified: 5 Oct 2008 10:59
Reporter: Olaf van der Spek (Basic Quality Contributor) Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Data Types Severity:S4 (Feature request)
Version:5.1.16 OS:Windows (Windows XP)
Assigned to: CPU Architecture:Any
Tags: qc

[2 Mar 2007 15:54] Olaf van der Spek
Description:
It seems blob/text colums can't have a default value, not even the empty string. This causes a problem in strict mode, as you then have to explicitly insert the empty string each time, which shouldn't be necessary.

How to repeat:
Server version: 5.1.16-beta-community-nt MySQL Community Server (GP

mysql> create table a (b blob not null, c int);
Query OK, 0 rows affected (0.00 sec)

mysql> insert into a (c) values (1);
ERROR 1364 (HY000): Field 'b' doesn't have a default value
mysql> insert into a (b, c) values ('', 1);
Query OK, 1 row affected (0.00 sec)

mysql> alter table a change b b blob not null default '';
ERROR 1101 (42000): BLOB/TEXT column 'b' can't have a default value
mysql>
[2 Mar 2007 15:59] MySQL Verification Team
Hello Olaf,

Thank you for the report but this is not a bug. BLOB and TEXT column can not have default values.
http://dev.mysql.com/doc/refman/5.0/en/blob.html
[2 Mar 2007 16:03] Olaf van der Spek
Could you please read the rest of my report?
[2 Mar 2007 16:05] Olaf van der Spek
Just to clarify, this is basically a request to at least allow the empty string as default for blob/text columns.
[2 Mar 2007 19:31] Sergei Golubchik
Isn't it a regression ?
[3 Mar 2007 19:51] Valeriy Kravchuk
This is not a regression, as, at least according to older manual (http://dev.mysql.com/doc/refman/4.1/en/blob.html) any default values were not allowed for BLOB/TEXT columns.

As this is clearly described in the manual, I can not call it a bug, formally. It is a reasonable feature request (to allow '' as default value for NOT NULL BLOB/TEXT column), though.
[5 Oct 2008 10:59] Konstantin Osipov
This is a duplicate of Bug#21532
[18 Aug 2017 7:53] KaungMyat ChanThar
I am facing the same issue :(