<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
There simply needs to be an if... then... else that determines which
SQL query to run based on the backend defined in httpd.conf.....&nbsp; or a
way to define a custom INSERT startment within httpd.conf that would be
compatible with any SQL system.<br>
<br>
Thomas Goirand wrote:
<blockquote cite="mid465704C0.40907@goirand.fr" type="cite">
  <pre wrap="">James Cloos wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">The original, mysql-specific query he used is:

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

I discovered that this works on postgres, w/o having to change any of
the rest of his patch:

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

Ie, s/insert ignore/insert/ and wrap in a transaction.
    </pre>
  </blockquote>
  <pre wrap=""><!---->
Hi!

I tried to to this with the MySQL backend driver, and unfortunately,
mod_log_sql was returning an error in the apache error.log. I was
surprised about it as the MySQL documentation said that it should work.

  </pre>
  <blockquote type="cite">
    <pre wrap="">Also, you may want to use global_config.driver-&gt;insert() instead of
using safe_sql_insert() to execute the insert.  I've not investigated
the differences, so I cannot be sure, though.
    </pre>
  </blockquote>
  <pre wrap=""><!---->
The advantage of safe_sql_insert() is that when it fails, the query goes
in a preserve file. Later, when the insert works again, then this file
is read and the insert statements are commited. I have found this very
nice, the only "problem" that I found is that this file is writen in
/etc while I think it should have been write somewhere in /var, possibly
in /var/lib/mod_log_sql. I think I should patch mod_log_sql to act like
this, and create the /var/lib/mod_log_sql folder in my debian packaging.
Currently, the package doesn't create the folder in /etc/apache2 so it
just writes in the error.log that writing in the preserve file didn't
work. Somebody could even have written a bug report about this issue, I
just didn't had the time to patch mod_log_sql to correct this yet.

Edward: do you think it would be possible that future versions of
mod_log_sql writes in /var rather than in /etc to be compliant with the
filesystem standards?

Also for Edward: I would have love to take the advantage of the new
thing you did in mod_log_sql 1.101 so my score_board patch could
calculate bytes out AND bytes in. Would you have time to help me to
write this, and support that new 1.101 (if not write it)? I'm currently
working on some other things (virtual private server statistics for I/O,
network and CPU inside our control panel) that we are in a hurry to
finish...

Thomas
_______________________________________________
Download the latest version at <a class="moz-txt-link-freetext" href="http://www.outoforder.cc/projects/apache/mod_log_sql/">http://www.outoforder.cc/projects/apache/mod_log_sql/</a>

To unsubscribe send an e-mail to 
<a class="moz-txt-link-abbreviated" href="mailto:mod_log_sql-unsubscribe@lists.outoforder.cc">mod_log_sql-unsubscribe@lists.outoforder.cc</a>
  </pre>
</blockquote>
</body>
</html>