List:MySQL and Java« Previous MessageNext Message »
From:Eric Raymond Date:June 1 2003 5:37am
Subject:Re: Enum Type...
View as plain text  
Hmmmm.  Not sure I buy that argument completely.

What happens when you add a row with a duplicate value to a unique index 
column in a table?  You get an error back from the DB and the insert 
will fail.  I'm guessing the fact that this test involves a key makes 
the implementation more efficient (and perhaps simpler).

Ideally the behavior of "type safety" should be something controlled by 
a system parameter (you can partially control this via the 
|-DDONT_USE_DEFAULT_FIELDS| compile option).  I personally prefer 
development tools to err on the side of complaining rather than silently 
ignoring the issue.

Anyway, this thread seems off topic for the java list.....

>The problem is, how do you make 'rejections' work with non-transactional
>tables (like MyISAM, which is the default table type in MySQL)?
>
>You have to remember that relational databases do operations as 'sets',
>not on a record-by-record basis, so thinking in a record-by-record way
>is sometimes going to lead you down the wrong path. MySQL can't reject a
>record, because changes might have already been done to it can be
>'rolled back', as parts of it might have already been updated.
>
>See http://www.mysql.com/doc/en/constraint_NOT_NULL.html for the full
>explanation (which is linked to from the documentation for 'ENUM' and
>'SET' types as well).
>
>  
>
>  
>

Thread
Enum Type...harsh29 May
  • Re: Enum Type...Nick Scholtz29 May
    • Re: Enum Type...harsh30 May
      • Re: Enum Type...Mark Matthews30 May
RE: Enum Type...Charles Zhao29 May
  • Re: Enum Type...Mark Matthews29 May
RE: Enum Type...Charles Zhao30 May
Re: Enum Type...Eric Raymond1 Jun