List:General Discussion« Previous MessageNext Message »
From:LMS Date:October 26 2005 9:24pm
Subject:Bug? Set Null Value in NOT NULL field...
View as plain text  
Hi,
I have this structure:
-----------------------------------------------
CREATE TABLE tabla (
   id int(10) unsigned NOT NULL auto_increment,
   nombre varchar(100) NOT NULL default '',
   PRIMARY KEY  (id),
   UNIQUE KEY nombre (nombre),
   UNIQUE KEY id (id)
) ENGINE=MyISAM;

SELECT * FROM tabla
+++++++++++++++++++++++++++++++++
+ id	+	nombre		+
+++++++++++++++++++++++++++++++++
+ 1	+	marcos		+
+++++++++++++++++++++++++++++++++

Now, I make a update:
---------------------------------
UPDATE tabla SET nombre = NULL WHERE id = 1;
---------------------------------
MySQL responds: "Query OK, 0 rows affected (0,01 sec)".
Again I do select:

SELECT * FROM tabla
+++++++++++++++++++++++++++++++++
+ id	+	nombre		+
+++++++++++++++++++++++++++++++++
+ 1	+			+
+++++++++++++++++++++++++++++++++

MySQL Server change the NULL value by '', Why?, this is a bug?.

Thanks for any answer.......
Marcelo Sosa
Thread
Bug? Set Null Value in NOT NULL field...LMS27 Oct
  • Re: Bug? Set Null Value in NOT NULL field...Jeff Smelser27 Oct
    • Re: Bug? Set Null Value in NOT NULL field...LMS27 Oct
      • Re: Bug? Set Null Value in NOT NULL field...Joerg Bruehe28 Oct