1d8a8611535e7ee7e5a1ede5d619034952a6b81f
braney
  Wed Apr 15 12:52:03 2015 -0700
fix a hgTables problem with tracks with '.' in them in track hubs #15182

diff --git src/hg/hgTables/joining.c src/hg/hgTables/joining.c
index 04462a3..34a5183 100644
--- src/hg/hgTables/joining.c
+++ src/hg/hgTables/joining.c
@@ -5,30 +5,31 @@
 
 /* Copyright (C) 2014 The Regents of the University of California 
  * See README in this or parent directory for licensing information. */
 
 #include "common.h"
 #include "hash.h"
 #include "localmem.h"
 #include "memalloc.h"
 #include "dystring.h"
 #include "obscure.h"
 #include "jksql.h"
 #include "joiner.h"
 #include "hdb.h"
 #include "hgTables.h"
 #include "trackHub.h"
+#include "hubConnect.h"
 
 
 
 struct joinedRow
 /* A row that is joinable.  Allocated in joinableResult->lm. */
     {
     struct joinedRow *next;
     struct slName **fields;	/* Fields user has requested. */
     struct slName **keys;	/* Fields to key from. */
     bool passedFilter;		/* TRUE if row has passed filter at this stage. */
     bool hitThisTable;		/* TRUE if hit on this table. */
     };
 
 struct joinedTables
 /* Database query result table that is joinable. */
@@ -966,31 +967,31 @@
 
 char *regionType = cartUsualString(cart, hgtaRegionType, "genome");
 boolean hasRegions = sameString(regionType, hgtaRegionTypeRange)
 		 ||  sameString(regionType, hgtaRegionTypeEncode)
 		 || (sameString(regionType, hgtaRegionTypeUserRegions) && (userRegionsFileName() != NULL));
 
 if (hasIdentifiers || hasRegions)
     {
     boolean hasTable = FALSE;
     char *dtfDb, *dtfTable;
     char split[1024];
     /* Choosing the All Tables group and then choosing a db like hgFixed or go 
      * causes it to inserts a $db. in front of the table name while leaving the primaryDb as the assembly. 
      * In effect, the table field is sometimes overloaded to carry this extra database for all tables support. */
     char *sep = strchr(primaryTable, '.');
-    if (sep)
+    if (!isHubTrack(primaryTable) && sep)
 	{
 	safecpy(split, sizeof split, primaryTable);
 	sep = strchr(split, '.');
 	*sep++ = 0;
 	dtfDb = split;
 	dtfTable = sep;
 	}
     else
 	{
 	dtfDb = primaryDb;
 	dtfTable = primaryTable;
 	}
     /* see if we already have the primary table in output fields or filter */
     struct joinerDtf *temp;
     for (temp = dtfList; temp; temp = temp->next)