Hi,

>
> This usually comes up when people expect an exception to be thrown when
> they assign NULL to a NOT NULL column, but this is the same idea.  From
> the manual <http://www.mysql.com/doc/en/constraint_NOT_NULL.html>:

Indeed. One of those weird MySQL things. Is this different on InnoDB?

> > To be able to support easy handling of non-transactional tables all
> > fields in MySQL have default values.
> >
> > If you insert a 'wrong' value in a column like a NULL in a NOT NULL
> > column or a too big numerical value in a numerical column, MySQL will
> > instead of giving an error instead set the column to the 'best
> > possible value'.
>
> In the case of ENUMs, "best possible" means the special error value
> which is 0 in numeric context and '' in string context.

Well, so it seems. We learn new things every day.

> Supporting non-transactional tables is the key here.  Throwing an error
> in the middle of a multi row insert is a problem if you cannot roll
> back.

Time to phase out those tables :-)

>Hence, data integrity checking is the responsibility of the
> client/programmer.

Ouch.

With regards,

Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server.
Upscene Productions
http://www.upscene.com


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to