I just (binary) edited my /usr/lib/apache2/modules/mod_log_sql.so and
replaced the string:

,----
| insert ignore into %s (domain,vhost,month,year,count_impressions) values 
('%s','%s','%s','%s','0')
`----

with the same-length string:

,----
| begin;insert into %s (domain,vhost,month,year,count_impressions) values 
('%s','%s',%s,%s,0);commit
`----

and it works.

So if you just wrap the insert in a begin;commit tuple it will Do The
Right Thing.  If the insert fails the commit does the same as rollback
and if it succeeds the commit commits the new row.  Either way the
subsequent update works correctly.

Much simple change than the function I earlier wrote.  And it just may
work cross-platform.  (But I do not have a mysqld to check against.)

-JimC
-- 
James Cloos <[EMAIL PROTECTED]>         OpenPGP: 1024D/ED7DAEA6



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to