| Bug #19498 | Inconsistent support for DEFAULT in TEXT columns | ||
|---|---|---|---|
| Submitted: | 3 May 2006 2:04 | Modified: | 15 Aug 2006 5:32 |
| Reporter: | Ask Bjørn Hansen (Basic Quality Contributor) | ||
| Status: | Closed | ||
| Category: | Server: Types | Severity: | S3 (Non-critical) |
| Version: | 5.0.18 | OS: | Not specific |
| Assigned to: | Jim Winstead | Target Version: | |
[3 May 2006 2:04]
Ask Bjørn Hansen
[3 May 2006 14:57]
Hartmut Holzgraefe
verified with current 5.0bk source on linux
[12 Jul 2006 6:03]
Greg Lehey
This problem was reported against mysqldump on Mac OS X. In fact, it occurs on other platforms, including Linux and probably all others, and it's not specifically related to mysqldump, though the problem occurs with mysqldump as well. The test case shows this: it doesn't refer to mysqldump at all. The issue here is in 'SHOW CREATE', which doesn't show the defaults. The test case shows that they are stored. I'm resetting the category to "Server: Data Types".
[19 Jul 2006 0:07]
Jim Winstead
A default value of '' is allowed to be specified for TEXT and BLOB fields, but it does not actually allow a default of '' (except in the case of a NOT NULL field, which will always have a default of ''). It appears this is a feature just to make life easier for applications that automate table generation. We'll make it so this issues a warning (or fails with an error in strict mode).
[19 Jul 2006 0:57]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/9310
[20 Jul 2006 19:49]
Ask Bjørn Hansen
Hmn. Other fields keep that sort of extra meta-data even if it's not actually supported. (It could be that it's Just Not Right, but in my application I use the "DEFAULT" meta-data to have my framework Do The Right Thing). Would it be possible to make TEXT fields support a default value?
[22 Jul 2006 19:32]
Tim Smith
Patch looks good. Thanks, Jim. Ask Bjørn, allowing default values for BLOB/TEXT fields could be added as a separate "feature request" bug. Regards, Timothy
[3 Aug 2006 18:46]
Magnus Svensson
Pushed to 5.0.25
[4 Aug 2006 5:53]
Paul DuBois
Noted in 5.0.25 changelog. TEXT and BLOB columns do not support DEFAULT values. However, when a default of '' was specified, the specification was silently ignored. This now results in a warning, or an error in strict mode.
[9 Aug 2006 11:29]
Ask Bjørn Hansen
Tim, I added it as an enhancement request in http://bugs.mysql.com/21532. Thanks. :-)
[10 Aug 2006 11:13]
Ask Bjørn Hansen
Hi Paul, The change log entry isn't entirely correct. The default value of '' was actually stored and mysqld would tell you about it if you asked in the right way, but SHOW CREATE ... didn't include it. - ask
[10 Aug 2006 11:14]
Ask Bjørn Hansen
(reopening the bug so at least the documentation can be updated, if deemed appropriate)
[11 Aug 2006 1:16]
Paul DuBois
The changelog entry is derived pretty directly from the developer comment in the changeset that includes the patch.
[14 Aug 2006 22:56]
Konstantin Osipov
Merged into 5.1.12
[15 Aug 2006 5:32]
Paul DuBois
Noted in 5.1.12 changelog.
