At 3:17 PM +0200 6/13/01, Glenn F. Henriksen wrote:
>Hello.
>
>I just noticed that when I have a table that has a field created with NOT
>NULL (in the example I'm using "clientID" I can set it to NULL with no error
>but it is set to an empty string ( '' ).
>
>This is obviously by design:
>>From the manual chapter 7.7 Create Table syntax:
>"If no DEFAULT value is specified for a column, MySQL automatically assigns
>one. If the column may take NULL as a value, the default value is NULL. If
>the column is declared as NOT NULL, the default value depends on the column
>type:
> (...)
> * For string types other than ENUM, the default
> value is the empty string. (...)"
>
>I found it very confusing that it allowed an empty field when I had
>specified "NOT NULL".
Why? NULL and the empty string are two distinct values?
>
>Is there any other way to disallow empty fields?
>
>Thank you.
>
>Regards,
>Glenn Henriksen (glenn@stripped)
--
Paul DuBois, paul@stripped