diff -ruN freeradius-server-2.1.9/src/modules/rlm_sql/rlm_sql.c freeradius-server-2.1.9-new/src/modules/rlm_sql/rlm_sql.c
--- freeradius-server-2.1.9/src/modules/rlm_sql/rlm_sql.c	2010-05-24 01:40:58.000000000 -0400
+++ freeradius-server-2.1.9-new/src/modules/rlm_sql/rlm_sql.c	2010-06-22 15:43:52.000000000 -0400
@@ -936,7 +936,13 @@
 		return -1;
 	}
 
-	paircompare_register(PW_SQL_GROUP, PW_USER_NAME, sql_groupcmp, inst);
+	// only register this instance to parse group membership if the query is defined
+	if (inst->config->groupmemb_query &&
+	    (inst->config->groupmemb_query[0] > 0)) {
+		paircompare_register(PW_SQL_GROUP, PW_USER_NAME, sql_groupcmp, inst);
+		radlog(L_INFO, "rlm_sql (%s): Registered to process Sql-Group",
+			inst->config->xlat_name, inst->config->sql_driver);
+	}
 
 	if (inst->config->do_clients){
 		if (generate_sql_clients(inst) == -1){

