OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
Re: Recent change in behaviour when inserting into NOT NULL fields??

From: Ed W (listswildgooses.com)
Date: Mon Apr 07 2008 - 06:11:52 CDT


Baron Schwartz wrote:
> Hi Ed,
>
> On Thu, Apr 3, 2008 at 3:32 PM, Ed W <listswildgooses.com> wrote:
>
>> Hi
>>
>> Up until version 5.0.44 (on linux) it appeared that you could do stuff like
>> deliberately insert a NULL into a NOT NULL varchar field and it would be
>> silently converted to an empty string. Similarly if you didn't specify a
>> value it appeared to use what is describe in the docs as the "DEFAULT()"
>> function to enter an empty string in the column
>>
>> However, I just upgraded from 5.0.44 to 5.0.54 and now the behaviour has
>> changed so that this errors noisily.
>> The docs on SQL Modes
>> http://dev.mysql.com/doc/refman/5.0/en/server-sql-mode.html - suggests that
>> this behaviour can be controlled, but as far as I can see I don't have the
>> |STRICT_ALL_TABLES or ||STRICT_TRANS_TABLES options enabled anyway..?
>>
>
> Check the changelogs in the manual, but I don't think this behavior
> has changed. That would break backwards compatibility in a way I
> don't think has happened.
>
> You should check by examining your SQL mode on the running server:
>
> SELECT SQL_MODE;
>
> This is more reliable than looking at the configuration file, because
> you might be looking at the wrong file, or the wrong section, or
> someone might have updated the SQL mode by using SET GLOBAL SQL_MODE
> -- who knows.
>

It's "blank" in both cases.

Additionally if I compile in support for perl (something like --use-perl
configure flag) then the old behaviour returns...

Any thoughts?

Ed W