<p dir="ltr"><br>
On 16 Jul 2013 20:39, "Mark Morgan Lloyd" <<a href="mailto:markMLl.lazarus@telemetry.co.uk">markMLl.lazarus@telemetry.co.uk</a>> wrote:<br>
><br>
> Henry Vermaak wrote:<br>
>><br>
>> On Tue, Jul 16, 2013 at 12:23:10PM +0200, Reinier Olislagers wrote:<br>
>>><br>
>>> On 16-7-2013 11:53, Henry Vermaak wrote:<br>
>>>><br>
>>>> Ranting from a position of ignorance seriously dilutes your credibility<br>
>>>> in my book.<br>
>>><br>
>>> I'm just saying the rants may be justified if mysql cannot be configured<br>
>>> to follow the RDBMS integrity norms.<br>
>>> Obviously you don't know if that is possible either, so let's give the<br>
>>> ranters the benefit of the doubt.<br>
>><br>
>><br>
>> Sigh, I thought I was clear on that.  Using Graeme's example:<br>
>><br>
>> mysql> set sql_mode = TRADITIONAL;<br>
>> Query OK, 0 rows affected (0.00 sec)<br>
>><br>
>> mysql> create table a (b int not null, c int not null);<br>
>> Query OK, 0 rows affected (0.10 sec)<br>
>><br>
>> mysql> insert into a (b) values (1);<br>
>> ERROR 1364 (HY000): Field 'c' doesn't have a default value<br>
>> mysql> <br>
><br>
><br>
> I certainly sympathise with your argument Henry, but I'm a bit concerned if MySQL is prepared to accept a "not null" constraint that it does not intend to enforce. So assuming that there is no sql_mode change between these two commands (using the earlier example):<br>

><br>
><br>
> mysql> create table a (b int not null, c int not null);<br>
> Query OK, 0 rows affected (0.17 sec)<br>
><br>
><br>
> mysql> insert into a (b) values (1);<br>
> Query OK, 1 row affected, 1 warning (0.03 sec)<br>
><br>
> one or other of them should at the very least raise a warning.</p>
<p dir="ltr">Not specifying a default is perfectly legitimate, that's why the insert fails in strict mode (in my example).  You just have to enable the strict mode, since the default mysql mode uses an implicit default.</p>

<p dir="ltr">Henry</p>