Doug,

> create table t1 ( id varchar(5) not null, name varchar(5) not null );
> insert into t1 ( id ) values ( "1234" );
> select count(*) from t1 where name = "";                --> Result = 1
> 1) Why did the insert succeed since the "name" field is not null and I didn't 
>provide a value?
> 2) Why does MySql think it's correct to substitute an empty string for a 
>non-provided value?

It's in the documentation, although I found no better explanation than
this one:

NULLs must be indicated as "NULL" values, not left blank. (User
comment)

MySQL always has a default value for all fields. This is something
that is imposed on MySQL to be able to work with both transactional
and not transactional tables. (Manual text)

http://www.mysql.com/doc/en/INSERT.html

Regards,
--
  Stefan Hinz <[EMAIL PROTECTED]>
  iConnect GmbH <http://iConnect.de>
  Heesestr. 6, 12169 Berlin (Germany)
  Telefon: +49 30 7970948-0  Fax: +49 30 7970948-3


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to