06767e4dcd73d74ff5935fbc141ab44689a03ca3
markd
  Wed Apr 6 23:35:26 2011 -0700
Fix case where databases are split between two servers with a trackDb specifcationpointing to both servers, e.g.:
db.trackDb=localDb:trackDb_markd,db:trackDb

If a given genome databases existed on only one of the servers, then it would
cause an error when checking for a trackDb in that server.  This change
checks for the existance of the database as well as the table.

diff --git src/hg/inc/jksql.h src/hg/inc/jksql.h
index 57501d1..74989ed 100644
--- src/hg/inc/jksql.h
+++ src/hg/inc/jksql.h
@@ -133,30 +133,36 @@
 
 struct sqlConnection *sqlConnCacheMayAlloc(struct sqlConnCache *cache,
                                            char *database);
 /* Allocate a cached connection. errAbort if too many open connections,
  * return NULL if can't connect to server. */
 
 struct sqlConnection *sqlConnCacheAlloc(struct sqlConnCache *cache,
                                         char *database);
 /* Allocate a cached connection. */
 
 struct sqlConnection *sqlConnCacheProfileAlloc(struct sqlConnCache *cache,
                                                char *profileName,
                                                char *database);
 /* Allocate a cached connection given a profile and/or database. */
 
+struct sqlConnection *sqlConnCacheProfileAllocMaybe(struct sqlConnCache *cache,
+                                                    char *profileName,
+                                                    char *database);
+/* Allocate a cached connection given a profile and/or database. Return NULL
+ * if the database doesn't exist.  */
+
 void sqlConnCacheDealloc(struct sqlConnCache *cache,struct sqlConnection **pConn);
 /* Free up a cached connection. */
 
 void sqlUpdate(struct sqlConnection *conn, char *query);
 /* Tell database to do something that produces no results table. */
 
 int sqlUpdateRows(struct sqlConnection *conn, char *query, int* matched);
 /* Execute an update query, returning the number of rows change.  If matched
  * is not NULL, it gets the total number matching the query. */
 
 boolean sqlExists(struct sqlConnection *conn, char *query);
 /* Query database and return TRUE if it had a non-empty result. */
 
 
 boolean sqlRowExists(struct sqlConnection *conn,