ee9a6c5c63eba2d963a5d7581185b1004fffe964
angie
  Mon Apr 15 14:06:10 2013 -0700
Added indentifying name to annoStreamer for output header info and better error messages. refs #6152
diff --git src/hg/lib/annoStreamDb.c src/hg/lib/annoStreamDb.c
index 282a496..67b855a 100644
--- src/hg/lib/annoStreamDb.c
+++ src/hg/lib/annoStreamDb.c
@@ -268,37 +268,40 @@
     }
 sqlFreeResult(&sr);
 return indexName;
 }
 
 struct annoStreamer *annoStreamDbNew(char *db, char *table, struct annoAssembly *aa,
 				     struct asObject *asObj)
 /* Create an annoStreamer (subclass) object from a database table described by asObj. */
 {
 struct sqlConnection *conn = hAllocConn(db);
 if (!sqlTableExists(conn, table))
     errAbort("annoStreamDbNew: table '%s' doesn't exist in database '%s'", table, db);
 struct annoStreamDb *self = NULL;
 AllocVar(self);
 struct annoStreamer *streamer = &(self->streamer);
-annoStreamerInit(streamer, aa, asObj);
+int dbtLen = strlen(db) + strlen(table) + 2;
+char dbTable[dbtLen];
+safef(dbTable, dbtLen, "%s.%s", db, table);
+annoStreamerInit(streamer, aa, asObj, dbTable);
 streamer->rowType = arWords;
 streamer->setRegion = asdSetRegion;
 streamer->nextRow = asdNextRow;
 streamer->close = asdClose;
 self->conn = conn;
 self->table = cloneString(table);
 char *asFirstColumnName = streamer->asObj->columnList->name;
 if (sqlFieldIndex(self->conn, self->table, "bin") == 0)
     self->hasBin = 1;
 if (self->hasBin && !sameString(asFirstColumnName, "bin"))
     self->omitBin = 1;
 if (!asdInitBed3Fields(self))
-    errAbort("annoStreamDbNew: can't figure out which fields of %s to use as "
-	     "{chrom, chromStart, chromEnd}.", table);
+    errAbort("annoStreamDbNew: can't figure out which fields of %s.%s to use as "
+	     "{chrom, chromStart, chromEnd}.", db, table);
 // When a table has an index on endField, sometimes the query optimizer uses it
 // and that ruins the sorting.  Fortunately most tables don't anymore.
 self->endFieldIndexName = sqlTableIndexOnField(self->conn, self->table, self->endField);
 self->notSorted = FALSE;
 self->mergeBins = FALSE;
 return (struct annoStreamer *)self;
 }