Package: libapache-mod-log-sql / 1.100-16.3

003-mod_log_sql_dbi.c.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
From: Thomas Goirand <thomas@goirand.fr>
Subject: Add a scoreboard feature to mod_log_sql
 You can keep tracks of number of hits and bytes for each of the
 hosted websites.

--- libapache-mod-log-sql/mod_log_sql_dbi.c.orig	2007-08-06 00:55:18.000000000 +0800
+++ libapache-mod-log-sql/mod_log_sql_dbi.c	2007-08-06 00:53:04.000000000 +0800
@@ -219,6 +219,10 @@
 	return LOGSQL_TABLE_SUCCESS;
 }
 
+static char *make_dbi_ignore_insert(char * insert_query, request_rec *r) {
+	return apr_psprintf(r->pool, "insert ignore into %s ;",insert_query);
+}
+
 static logsql_dbdriver log_sql_dbi_driver = {
     "dbi",
 	NULL,
@@ -226,7 +230,8 @@
 	log_sql_dbi_close,	/* close DB connection */
 	log_sql_dbi_escape,	/* escape query */
 	log_sql_dbi_query,	/* insert query */
-	log_sql_dbi_create	/* create table */
+	log_sql_dbi_create,	/* create table */
+	make_dbi_ignore_insert /* insert ignore */
 };
 
 static apr_status_t log_sql_dbi_cleanup(void *data)