Index: src/hg/hgTables/hgTables.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/hgTables/hgTables.c,v
retrieving revision 1.191
retrieving revision 1.192
diff -b -B -U 4 -r1.191 -r1.192
--- src/hg/hgTables/hgTables.c	12 Apr 2010 05:32:51 -0000	1.191
+++ src/hg/hgTables/hgTables.c	13 Apr 2010 04:42:01 -0000	1.192
@@ -1140,9 +1140,10 @@
 
 return(ret);
 }
 
-void doTabOutDb( char *db, char *table, FILE *f, struct sqlConnection *conn, char *fields)
+void doTabOutDb( char *db, char *dbVarName, char *table, char *tableVarName,
+	FILE *f, struct sqlConnection *conn, char *fields)
 /* Do tab-separated output on fields of a single table. */
 {
 struct region *regionList = getRegions();
 struct region *region;
@@ -1199,9 +1200,9 @@
     {
     struct sqlResult *sr;
     char **row;
     int colIx, lastCol = fieldCount-1;
-    char *filter = filterClause(db, table, region->chrom, identifierFilter);
+    char *filter = filterClause(dbVarName, tableVarName, region->chrom, identifierFilter);
 
     sr = regionQuery(conn, table, fieldSpec->string,
     	region, isPositional, filter);
     if (sr == NULL)
@@ -1211,9 +1212,9 @@
     if (! printedColumns)
         {
 	// Show only the SQL filter built from filter page options, not identifierFilter,
 	// because identifierFilter can get enormous (like 126kB for 12,500 rsIDs).
-	char *filterNoIds = filterClause(db, table, region->chrom, NULL);
+	char *filterNoIds = filterClause(dbVarName, tableVarName, region->chrom, NULL);
 	if (filterNoIds != NULL)
 	    hOrFPrintf(f, "#filter: %s\n", filterNoIds);
 	hOrFPrintf(f, "#");
 	if (showItemRgb)
@@ -1267,18 +1269,17 @@
     struct trackDb *track = findTrack(table, fullTrackList);
     doTabOutCustomTracks(db, track, conn, fields, f);
     }
 else
-    doTabOutDb(db, table, f, conn, fields);
+    doTabOutDb(db, db, table, table, f, conn, fields);
 }
 
 struct slName *fullTableFields(char *db, char *table)
 /* Return list of fields in db.table.field format. */
 {
 char dtBuf[256];
 struct sqlConnection *conn;
 struct slName *fieldList = NULL, *dtfList = NULL, *field, *dtf;
-// uglyAbort("fullTableFields(db=%s, table=%s, isCustomTrack=%d)", db, table, isCustomTrack(table));
 if (hIsBigBed(database, table, curTrack, ctLookupName))
     {
     conn = hAllocConn(db);
     fieldList = bigBedGetFields(table, conn);

