3a0ee80add460d891837796588d377e22e4d5491 braney Wed Oct 15 15:12:33 2014 -0700 fix #14168 fix custom wiggle tracks on assembly hubs diff --git src/hg/hgTracks/wigTrack.c src/hg/hgTracks/wigTrack.c index 3e9f43d..eb92b3b 100644 --- src/hg/hgTracks/wigTrack.c +++ src/hg/hgTracks/wigTrack.c @@ -387,31 +387,35 @@ * * To help DrawItems, we are going to make up a list of Spans that * were read in for this track. DrawItems can use that list to * limit itself to the appropriate span. (Even though we tried to * use Span to limit the hRangeQuery, there may be other Spans in * the result that are not needed during the drawing.) * This list of spans is actually a hash of hashes. * The first level is a hash of track names from each call to * wigLoadItems. The second level chosen from the track name is * the actual hash of Spans for this particular track. * * With 1K zoom Spans available, no more than approximately 1024 * rows will need to be loaded at any one time. */ { -struct sqlConnection *conn = hAllocConn(database); +struct sqlConnection *conn = NULL ; + +// if this is a custom track we don't need an SQL connection to the database +if (!(isCustomTrack(tg->table) && tg->customPt)) + conn = hAllocConn(database); struct sqlResult *sr; char **row; int rowOffset; struct wiggle wiggle; struct wigItem *wiList = NULL; char *whereNULL = NULL; int itemsLoaded = 0; char *previousFileName; struct hash *spans = NULL; /* Spans encountered during load */ /* Check our scale from the global variables that exist in * hgTracks.c - This can give us a guide about which rows to load. * If the scale is more than 1000 bases per pixel, we can try loading * only those rows with Span >= 1000 to see if an appropriate zoom * level exists. */