summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--src/mysql.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/mysql.c b/src/mysql.c
index d97200a..1391743d 100644
--- a/src/mysql.c
+++ b/src/mysql.c
@@ -31,3 +31,3 @@ struct vmod_mysql_data
static void
-check_errno(struct dbrw_connection *conn)
+check_errno(struct dbrw_connection *conn, char const *query)
{
@@ -35,2 +35,4 @@ check_errno(struct dbrw_connection *conn)
+ dbrw_error("query failed: %s", query);
+ dbrw_error("%s", mysql_error(&mp->mysql));
switch (mysql_errno(&mp->mysql)) {
@@ -40,3 +42,2 @@ check_errno(struct dbrw_connection *conn)
case ER_ABORTING_CONNECTION:
- dbrw_error("query failed: %s", mysql_error(&mp->mysql));
sql_disconnect(conn);
@@ -55,4 +56,2 @@ check_errno(struct dbrw_connection *conn)
case ER_WRONG_FIELD_SPEC:
- case ER_PARSE_ERROR:
- case ER_EMPTY_QUERY:
case ER_FIELD_SPECIFIED_TWICE:
@@ -60,3 +59,2 @@ check_errno(struct dbrw_connection *conn)
case ER_NOT_ALLOWED_COMMAND:
- dbrw_error("query failed: %s", mysql_error(&mp->mysql));
dbrw_error("disabling MySQL connection");
@@ -65,4 +63,6 @@ check_errno(struct dbrw_connection *conn)
break;
+ case ER_EMPTY_QUERY:
+ case ER_PARSE_ERROR:
default:
- dbrw_error("query failed: %s", mysql_error(&mp->mysql));
+ break;
}
@@ -162,3 +162,3 @@ s_mysql_query(struct dbrw_connection *conn, const char *query)
if (rc) {
- check_errno(conn);
+ check_errno(conn, query);
if (conn->state != state_init)

Return to:

Send suggestions and report system problems to the System administrator.