-/* $Id: plugin_mysql.c,v 1.9 2006/01/20 15:43:25 reinelt Exp $
+/* $Id: plugin_mysql.c,v 1.10 2006/01/20 15:58:05 reinelt Exp $
*
* plugin for execute SQL queries into a MySQL DBSM.
*
*
*
* $Log: plugin_mysql.c,v $
+ * Revision 1.10 2006/01/20 15:58:05 reinelt
+ * MySQL::count() added again
+ *
* Revision 1.9 2006/01/20 15:43:25 reinelt
* MySQL::query() returns a value, not the number of rows
*
return configured;
}
-#if 0
-/* removed because you can use 'query("select count(*)")' */
-static void my_MySQLquery(RESULT * result, RESULT * query)
+static void my_MySQLcount(RESULT * result, RESULT * query)
{
char *q;
double value;
SetResult(&result, R_NUMBER, &value);
}
-#endif
static void my_MySQLquery(RESULT * result, RESULT * query)
int plugin_init_mysql(void)
{
#ifdef HAVE_MYSQL_MYSQL_H
+ AddFunction("MySQL::count", 1, my_MySQLcount);
AddFunction("MySQL::query", 1, my_MySQLquery);
AddFunction("MySQL::status", 0, my_MySQLstatus);
#endif