sql logging problem

Martin Hepworth maxsec at TOTALISE.CO.UK
Thu Jul 24 16:24:19 IST 2003


Evert

Still means I have to have the SQLlogging code to test say, insert this
value or NULL.

any perl dudes out there with some help?


--
Martin



Evert Ford wrote:
> I use the same version of MySQL you do and have worked with it quite a bit.
>
> What always works for me when I have  a null value is NULL(and this is what
> the manual recommends, btw).
>
> to modify your insert with this:
>
> insert into maillog values ( '2003-07-24 14:40:57', 'h6ODerXL062460',
> 1066, 'martinh at soloman.solid-state-logic.com',
> 'martinh at solid-state-logic.com', 'test9', '127.0.0.1', NULL, 0, 0, NULL,
> NULL, 0, 0,
> NULL, 0, 0, 0, NULL, 'soloman.solid-state-logic.com');
>
> In MySQL NULL is not equal to either the empty string ("") or 0. and logic
> testing proves this.
>
> I hope this helps,
>
> Evert Ford
> Information Analyst
> Westone Laboratories
> http://www.westone.com
>
> -----Original Message-----
> From: MailScanner mailing list [mailto:MAILSCANNER at JISCMAIL.AC.UK]On
> Behalf Of Martin Hepworth
> Sent: Thursday, July 24, 2003 7:58 AM
> To: MAILSCANNER at JISCMAIL.AC.UK
> Subject: Re: sql logging problem
>
>
> Hmm the plot thickens....
>
> If use the values as qiven, there are 'empty' or null values being put
> in the string. When I use this syntax on a manual insert mysql complains
> about syntax error. However if I fill in these values to be the default
> then it's fine and the insert happens...
> eg
>
>   insert into maillog values ( '2003-07-24 14:40:57', 'h6ODerXL062460',
> 1066, 'martinh at soloman.solid-state-logic.com',
> 'martinh at solid-state-logic.com', 'test9', '127.0.0.1', , 0, 0, , , 0, 0,
> , 0, 0, 0, , 'soloman.solid-state-logic.com');
>
> doesn't work..
>
> insert into maillog values ( '2003-07-24 14:40:57', 'h6ODerXL062460',
> 1066, 'martinh at soloman.solid-state-logic.com',
> 'martinh at solid-state-logic.com', 'test9', '127.0.0.1',0 , 0, 0,0 ,0 , 0,
> 0,0 , 0, 0, 0,0 , 'soloman.solid-state-logic.com');
>
>
> does work..
>
>
> mysql is version 4.0.13
>
> time to hit the manuals..
>
>
> --
> Martin
> ---
> Incoming mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.483 / Virus Database: 279 - Release Date: 5/19/03
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.483 / Virus Database: 279 - Release Date: 5/19/03



More information about the MailScanner mailing list