List:General Discussion« Previous MessageNext Message »
From:Jay Blanchard Date:January 5 2004 1:53pm
Subject:RE: Enum default values
View as plain text  
[snip]
> If you insert an invalid value into an ENUM (that is, a string not
> present in the list of allowed values), the empty string is inserted
> instead as a special error value. This string can be distinguished
from
> a 'normal' empty string by the fact that this string has the numerical
> value 0. More about this later.

"changeday" is NOT NULL -> but you still can enter
'' ... Strange and, IMO, a bug. What's the use of
restricting to a set of possible values without enforcing it?
[/snip]

On an INSERT it allows you to get or track entry errors. You have to
apply error checking to your application to enforce the integrity of the
enum field. This has been one of those excessively debated issues over
the years. I have used this 'feature' for error checking for a long time
now.
Thread
Enum default valuesRichard Dyce5 Jan
RE: Enum default valuesJay Blanchard5 Jan
  • Re: Enum default valuesRichard Dyce5 Jan
    • Re[2]: Enum default valuesAleksandar Bradaric5 Jan
      • Re: Re[2]: Enum default valuesRichard Dyce5 Jan
  • Re: Enum default valuesMartijn Tonies5 Jan
RE: Enum default valuesJay Blanchard5 Jan
  • Re: Enum default valuesMartijn Tonies5 Jan
RE: Enum default valuesJay Blanchard5 Jan
  • Re: Enum default valuesMartijn Tonies5 Jan
    • Re: Enum default valuesMichael Stassen5 Jan
  • Re: Enum default valuesMartijn Tonies5 Jan