On Sat, 04 Dec 2010 01:19:34 -0000, Patrick Crews <email address hidden> wrote:
> Why anyone would use a CHAR(0) column, I dunno. But I figure if one can
> live on MySQL, we should test for it : ) This is probably very much an
> edge case though.
MySQL permits you to create a column of type CHAR(0). This is useful
primarily when you have to be compliant with old applications that
depend on the existence of a column but that do not actually use its
value. CHAR(0) is also quite nice when you need a column that can take
only two values: A column that is defined as CHAR(0) NULL occupies only
one bit and can take only the values NULL and '' (the empty string).
For a start, very Oracle incompatible behaviour :)
On Sat, 04 Dec 2010 01:19:34 -0000, Patrick Crews <email address hidden> wrote:
> Why anyone would use a CHAR(0) column, I dunno. But I figure if one can
> live on MySQL, we should test for it : ) This is probably very much an
> edge case though.
from http:// dev.mysql. com/doc/ refman/ 5.0/en/ string- type-overview. html
MySQL permits you to create a column of type CHAR(0). This is useful
primarily when you have to be compliant with old applications that
depend on the existence of a column but that do not actually use its
value. CHAR(0) is also quite nice when you need a column that can take
only two values: A column that is defined as CHAR(0) NULL occupies only
one bit and can take only the values NULL and '' (the empty string).
For a start, very Oracle incompatible behaviour :)
--
Stewart Smith