[Lazarus] Lazarus, Jedi etc.

Henry Vermaak henry.vermaak at gmail.com
Wed Jul 17 00:43:15 CEST 2013


On 16 Jul 2013 20:39, "Mark Morgan Lloyd" <markMLl.lazarus at telemetry.co.uk>
wrote:
>
> Henry Vermaak wrote:
>>
>> On Tue, Jul 16, 2013 at 12:23:10PM +0200, Reinier Olislagers wrote:
>>>
>>> On 16-7-2013 11:53, Henry Vermaak wrote:
>>>>
>>>> Ranting from a position of ignorance seriously dilutes your credibility
>>>> in my book.
>>>
>>> I'm just saying the rants may be justified if mysql cannot be configured
>>> to follow the RDBMS integrity norms.
>>> Obviously you don't know if that is possible either, so let's give the
>>> ranters the benefit of the doubt.
>>
>>
>> Sigh, I thought I was clear on that.  Using Graeme's example:
>>
>> mysql> set sql_mode = TRADITIONAL;
>> Query OK, 0 rows affected (0.00 sec)
>>
>> mysql> create table a (b int not null, c int not null);
>> Query OK, 0 rows affected (0.10 sec)
>>
>> mysql> insert into a (b) values (1);
>> ERROR 1364 (HY000): Field 'c' doesn't have a default value
>> mysql>
>
>
> 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):
>
>
> mysql> create table a (b int not null, c int not null);
> Query OK, 0 rows affected (0.17 sec)
>
>
> mysql> insert into a (b) values (1);
> Query OK, 1 row affected, 1 warning (0.03 sec)
>
> one or other of them should at the very least raise a warning.

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.

Henry
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20130716/035aa880/attachment-0003.html>


More information about the Lazarus mailing list