d53e5750a3d3e8b7da4d38d6242022bdece345e2
braney
  Tue Jan 24 13:00:31 2017 -0800
changes to tagStorm support. #18183

diff --git src/hg/lib/mdb.c src/hg/lib/mdb.c
index d4dc956..ac9482e 100644
--- src/hg/lib/mdb.c
+++ src/hg/lib/mdb.c
@@ -2,30 +2,31 @@
  * generated mdb.h and mdb.sql.  This module links the database and
  * the RAM representation of objects. */
 
 /* Copyright (C) 2014 The Regents of the University of California 
  * See README in this or parent directory for licensing information. */
 
 #include "common.h"
 #include "linefile.h"
 #include "dystring.h"
 #include "jksql.h"
 #include "hdb.h"
 #include "cv.h"
 #include "mdb.h"
 #include "encode/encodeExp.h"
 #include "trackHub.h"
+#include "hubConnect.h"
 
 
 void mdbStaticLoad(char **row, struct mdb *ret)
 /* Load a row from mdb table into ret.  The contents of ret will
  * be replaced at the next call to this function. */
 {
 
 ret->obj = row[0];
 ret->var = row[1];
 ret->val = row[2];
 }
 
 struct mdb *mdbLoadByQuery(struct sqlConnection *conn, char *query)
 /* Load all mdb from table that satisfy the query given.
  * Where query is of the form 'select * from example where something=something'
@@ -3260,31 +3261,31 @@
 mdbObj->obj     = cloneString(tdb->table?tdb->table:tdb->track);
 AllocVar(mdbObj->vars);
 mdbObj->vars->var = cloneString(MDB_OBJ_TYPE);
 mdbObj->vars->val = cloneString(MDB_OBJ_TYPE_TABLE);
 mdbObj->varHash = hashNew(8);
 hashAdd(mdbObj->varHash, mdbObj->vars->var, mdbObj->vars);
 mdbObj = mdbObjAddVarPairs(mdbObj,setting);
 mdbObjRemoveVars(mdbObj,MDB_VAR_TABLENAME); // NOTE: Special hint that the tdb metadata
 return mdbObj;                              //       is used since no mdb metadata is found
 }
 
 const struct mdbObj *metadataForTable(char *db,struct trackDb *tdb,char *table)
 // Returns the metadata for a table.  NEVER FREE THIS STRUCT!
 {
 struct mdbObj *mdbObj = NULL;
-if (trackHubDatabase(db))
+if (isHubTrack(tdb->track))
     return metadataForTableFromTdb(tdb); // FIXME: metadata setting in TDB soon to be obsolete
 
 // See of the mdbObj was already built
 if (tdb != NULL)
     {
     mdbObj = tdbExtrasMdb(tdb);
     if (mdbObj == METADATA_NOT_FOUND) // NOT in mtatbl, not in tdb metadata setting!
         return NULL;
     else if (mdbObj == MDB_NOT_FOUND) // looked mdb already and not found!
         return metadataForTableFromTdb(tdb);
     else if (mdbObj != NULL)
         {
         return mdbObj;  // No reason to query the table again!
         }
     }