[MOBY-guts] biomoby commit

Mark Wilkinson mwilkinson at pub.open-bio.org
Fri Jul 22 19:46:52 UTC 2005


mwilkinson
Fri Jul 22 15:46:52 EDT 2005
Update of /home/repository/moby/moby-live/Perl/MOBY/Adaptor/moby/queryapi
In directory pub.open-bio.org:/tmp/cvs-serv1164/MOBY/Adaptor/moby/queryapi

Modified Files:
	mysql.pm 
Log Message:
the logic for findig existing services was still wonky.

moby-live/Perl/MOBY/Adaptor/moby/queryapi mysql.pm,1.26,1.27
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY/Adaptor/moby/queryapi/mysql.pm,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- /home/repository/moby/moby-live/Perl/MOBY/Adaptor/moby/queryapi/mysql.pm	2005/07/22 19:29:38	1.26
+++ /home/repository/moby/moby-live/Perl/MOBY/Adaptor/moby/queryapi/mysql.pm	2005/07/22 19:46:52	1.27
@@ -638,9 +638,14 @@
 	delete $args{'authority_uri'};  # this can't be passed into the search since it doens't exist in the table
 	my @args;
 	while (my ($k, $v) = each %args){
-	    push @args, ("and",{$k => $v}); # format for the add_condition subroutine
+	    push @args, ({$k => $v}, "and"); # format for the add_condition subroutine
 	}
-	push @args, ("and", {authority_id => $authority_id}) if ($authority_id);
+	if ($authority_id){
+	    push @args, ({authority_id => $authority_id}) ;
+	} else {
+    	    pop @args;  # remove final "and"
+	}
+	
 	my $statement = "select
           service_instance_id,
           category,




More information about the MOBY-guts mailing list