a34c819b8da5b8c8b1f096ebe76fcf89e32134d6
max
  Fri Oct 23 14:25:01 2015 -0700
didn't test my previous fix, stupid typo, should be OK now.
refs #16158

diff --git src/hg/hgTables/hgTables.c src/hg/hgTables/hgTables.c
index 50b9e24..647b54f 100644
--- src/hg/hgTables/hgTables.c
+++ src/hg/hgTables/hgTables.c
@@ -929,31 +929,31 @@
                 && sameString(jp->b->table, table) )
                     {
                     idField = cloneString(jp->b->field);
                     break;
                     }
                 }
             }
         joinerPairFreeList(&jpList);
         }
     }
 /* If we haven't found the answer but this looks like a non-positional table,
  * use the first field. */
 if (idField == NULL && !isCustomTrack(table) && (hti == NULL || !hti->isPos))
     {
     char *dotPos = strstr(table, ".");
-    if (isHubTrack(table) && dotPos != NULL)
+    if (!isHubTrack(table) && dotPos != NULL)
         // if the database is part of the table name in mysql notation
         // (= databaseName.tableName), split the table string and override db.
         // The jksql table name/field cache cannot handle it otherwise
         {
             *dotPos = 0;
             db = table;
             table = dotPos+1;
         }
     struct sqlConnection *conn = track ? hAllocConnTrack(db, track) : hAllocConn(db);
     struct slName *fieldList = sqlListFields(conn, table);
     if (fieldList == NULL)
         errAbort("getIdField: Can't find fields of table %s", table);
     idField = cloneString(fieldList->name);
     slFreeList(&fieldList);
     hFreeConn(&conn);