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/hdb.h src/hg/inc/hdb.h
index a5efa12..18d403e 100644
--- src/hg/inc/hdb.h
+++ src/hg/inc/hdb.h
@@ -123,39 +123,48 @@
 
 struct sqlConnection *hAllocConn(char *db);
 /* Get free connection if possible. If not allocate a new one. */
 
 struct sqlConnection *hAllocConnMaybe(char *db);
 /* Get free connection if possible. If not allocate a new one. Return
  * NULL if db doesn't exist or can't be connected to. */
 
 char *getTrackProfileName(struct trackDb *tdb);
 /* get profile is associated with a track, return it, otherwise NULL */
 
 struct sqlConnection *hAllocConnProfile(char *profileName, char *db);
 /* Get free connection, specifying a profile and/or a database. If none
  * is available, allocate a new one. */
 
+struct sqlConnection *hAllocConnProfileMaybe(char *profileName, char *db);
+/* Get free connection, specifying a profile and/or a database. If none is
+ * available, allocate a new one.  Return NULL if database doesn't exist. */
+
 struct sqlConnection *hAllocConnTrack(char *db, struct trackDb *tdb);
 /* Get free connection for accessing tables associated with the specified
  * track and database. If none is available, allocate a new one. */
 
 struct sqlConnection *hAllocConnProfileTbl(char *db, char *spec, char **tableRet);
 /* Allocate a connection to db, spec can either be in the form `table' or
  * `profile:table'.  If it contains profile, connect via that profile.  Also
  * returns pointer to table in spec string. */
 
+struct sqlConnection *hAllocConnProfileTblMaybe(char *db, char *spec, char **tableRet);
+/* Allocate a connection to db, spec can either be in the form `table' or
+ * `profile:table'.  If it contains profile, connect via that profile.  Also
+ * returns pointer to table in spec string. Return NULL if database doesn't exist */
+
 struct sqlConnection *hAllocConnDbTbl(char *spec, char **tableRet, char *defaultDb);
 /* Allocate a connection to db and table, spec is in form `db.table'; if
  * defaultDb is not NULL, 'table' can also be used.  Also returns pointer to
  * table in spec string. */
 
 void hFreeConn(struct sqlConnection **pConn);
 /* Put back connection for reuse. */
 
 struct sqlConnection *hConnectCentral(void);
 /* Connect to central database where user info and other info
  * not specific to a particular genome lives.  Free this up
  * with hDisconnectCentral(). */
 
 void hDisconnectCentral(struct sqlConnection **pConn);
 /* Put back connection for reuse. */