mysql plugin: Improve the `mysql_ping' warning.
authorFlorian Forster <octo@huhu.verplant.org>
Tue, 1 Sep 2009 20:49:47 +0000 (22:49 +0200)
committerFlorian Forster <octo@huhu.verplant.org>
Tue, 1 Sep 2009 20:49:47 +0000 (22:49 +0200)
src/mysql.c

index f243c50..1048511 100644 (file)
@@ -363,7 +363,11 @@ static MYSQL *getconnection (mysql_database_t *db)
                int err;
                if ((err = mysql_ping (db->con)) != 0)
                {
-                       WARNING ("mysql_ping failed: %s", mysql_error (db->con));
+                       WARNING ("mysql_ping failed for %s: %s",
+                                       (db->instance != NULL)
+                                       ? db->instance
+                                       : "<legacy>",
+                                       mysql_error (db->con));
                        db->state = 0;
                }
                else