summaryrefslogtreecommitdiffstats
path: root/mod_log_sql_mysql.c
diff options
context:
space:
mode:
authorGravatar Edward Rudd 2004-04-04 07:45:30 +0000
committerGravatar Edward Rudd 2004-04-04 07:45:30 +0000
commit812bc70dae80637548a0ccfab649f8912a09faf5 (patch)
treeb0410deed7f35f9db952bf51aa3770a9cb9b0a68 /mod_log_sql_mysql.c
parentbf387bc750caf37fe2cbe45a901161861fc50b01 (diff)
Updated to new logging function with apaceh 2 prototype instead of 1.3 so i can properly log Error numbers in apache 2 (better debugging)
Diffstat (limited to 'mod_log_sql_mysql.c')
-rw-r--r--mod_log_sql_mysql.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/mod_log_sql_mysql.c b/mod_log_sql_mysql.c
index edc0189..a3f8bbc 100644
--- a/mod_log_sql_mysql.c
+++ b/mod_log_sql_mysql.c
@@ -50,13 +50,13 @@ logsql_opendb_ret log_sql_mysql_connect(server_rec *s, logsql_dbconnection *db)
50 50
51 if (mysql_real_connect(dblink, host, user, passwd, database, tcpport, 51 if (mysql_real_connect(dblink, host, user, passwd, database, tcpport,
52 socketfile, 0)) { 52 socketfile, 0)) {
53 log_error(APLOG_MARK,APLOG_DEBUG,s,"HOST: '%s' PORT: '%d' DB: '%s' USER: '%s' SOCKET: '%s'", 53 log_error(APLOG_MARK,APLOG_DEBUG,0, s,"HOST: '%s' PORT: '%d' DB: '%s' USER: '%s' SOCKET: '%s'",
54 host, tcpport, database, user, socketfile); 54 host, tcpport, database, user, socketfile);
55 return LOGSQL_OPENDB_SUCCESS; 55 return LOGSQL_OPENDB_SUCCESS;
56 } else { 56 } else {
57 log_error(APLOG_MARK,APLOG_DEBUG,s,"mod_log_sql: database connection error: %s", 57 log_error(APLOG_MARK,APLOG_DEBUG,0, s,"mod_log_sql: database connection error: %s",
58 MYSQL_ERROR(dblink)); 58 MYSQL_ERROR(dblink));
59 log_error(APLOG_MARK,APLOG_DEBUG,s,"HOST: '%s' PORT: '%d' DB: '%s' USER: '%s' SOCKET: '%s'", 59 log_error(APLOG_MARK,APLOG_DEBUG, 0, s,"HOST: '%s' PORT: '%d' DB: '%s' USER: '%s' SOCKET: '%s'",
60 host, tcpport, database, user, socketfile); 60 host, tcpport, database, user, socketfile);
61 return LOGSQL_OPENDB_FAIL; 61 return LOGSQL_OPENDB_FAIL;
62 } 62 }
@@ -135,7 +135,7 @@ logsql_query_ret log_sql_mysql_query(request_rec *r,logsql_dbconnection *db,
135 real_error = mysql_errno(dblink); 135 real_error = mysql_errno(dblink);
136 136
137 if (real_error == ER_NO_SUCH_TABLE) { 137 if (real_error == ER_NO_SUCH_TABLE) {
138 log_error(APLOG_MARK,APLOG_ERR,r->server,"table does not exist, preserving query"); 138 log_error(APLOG_MARK,APLOG_ERR,0, r->server,"table does not exist, preserving query");
139 /* Restore SIGPIPE to its original handler function */ 139 /* Restore SIGPIPE to its original handler function */
140 signal(SIGPIPE, handler); 140 signal(SIGPIPE, handler);
141 return LOGSQL_QUERY_NOTABLE; 141 return LOGSQL_QUERY_NOTABLE;
@@ -213,7 +213,7 @@ logsql_table_ret log_sql_mysql_create(request_rec *r, logsql_dbconnection *db,
213 create_sql = apr_pstrcat(r->pool, create_prefix, table_name, create_suffix, 213 create_sql = apr_pstrcat(r->pool, create_prefix, table_name, create_suffix,
214 type_suffix, NULL); 214 type_suffix, NULL);
215 215
216 log_error(APLOG_MARK,APLOG_DEBUG,r->server,"create string: %s", create_sql); 216 log_error(APLOG_MARK,APLOG_DEBUG,0, r->server,"create string: %s", create_sql);
217 217
218 if (!dblink) { 218 if (!dblink) {
219 return LOGSQL_QUERY_NOLINK; 219 return LOGSQL_QUERY_NOLINK;
@@ -223,7 +223,7 @@ logsql_table_ret log_sql_mysql_create(request_rec *r, logsql_dbconnection *db,
223 223
224 /* Run the create query */ 224 /* Run the create query */
225 if ((retval = mysql_query(dblink, create_sql))) { 225 if ((retval = mysql_query(dblink, create_sql))) {
226 log_error(APLOG_MARK,APLOG_ERR,r->server,"failed to create table: %s", 226 log_error(APLOG_MARK,APLOG_ERR,0, r->server,"failed to create table: %s",
227 table_name); 227 table_name);
228 signal(SIGPIPE, handler); 228 signal(SIGPIPE, handler);
229 return LOGSQL_TABLE_FAIL; 229 return LOGSQL_TABLE_FAIL;