13a162ac62b49cf2908da7d0bdd872e3f0010591 braney Mon Oct 3 11:47:30 2022 -0700 special case the knownGene track in the table browser until we get bigBed support in the all.joiner structure diff --git src/hg/hgTables/schema.c src/hg/hgTables/schema.c index cbfaae3..c441c7e 100644 --- src/hg/hgTables/schema.c +++ src/hg/hgTables/schema.c @@ -727,38 +727,33 @@ /* Show schema around current track. */ { if (curTrackDescribesCurTable()) { char *table = connectingTableForTrack(curTable); if (!isCustomTrack(table) && !hashFindVal(fullTableToTdbHash, table)) hashAdd(fullTableToTdbHash, table, curTrack); htmlOpen("Schema for %s - %s", curTrack->shortLabel, curTrack->longLabel); showSchema(database, curTrack, table); htmlClose(); } else doTableSchema(database, curTable, conn); } -struct asObject *asForTable(struct sqlConnection *conn, char *table) -/* Get autoSQL description if any associated with table. */ -/* Wrap some error catching around asForTable. */ +struct asObject *asForTableNoTdb(struct sqlConnection *conn, char *table) +/* Get autoSQL description if any associated with table. Don't try tdb */ { -struct trackDb *tdb = hashFindVal(fullTableToTdbHash, table); -if (tdb != NULL) - return asForTdb(conn,tdb); - // Some cases are for tables with no tdb! struct asObject *asObj = NULL; if (sqlTableExists(conn, "tableDescriptions")) { struct errCatch *errCatch = errCatchNew(); if (errCatchStart(errCatch)) { char query[256]; sqlSafef(query, sizeof(query), "select autoSqlDef from tableDescriptions where tableName='%s'", table); char *asText = asText = sqlQuickString(conn, query); // If no result try split table. (not likely) if (asText == NULL) @@ -766,15 +761,26 @@ sqlSafef(query, sizeof(query), "select autoSqlDef from tableDescriptions where tableName='chrN_%s'", table); asText = sqlQuickString(conn, query); } if (asText != NULL && asText[0] != 0) { asObj = asParseText(asText); } freez(&asText); } errCatchEnd(errCatch); errCatchFree(&errCatch); } return asObj; } + +struct asObject *asForTable(struct sqlConnection *conn, char *table) +/* Get autoSQL description if any associated with table. */ +/* Wrap some error catching around asForTable. */ +{ +struct trackDb *tdb = hashFindVal(fullTableToTdbHash, table); +if (tdb != NULL) + return asForTdb(conn,tdb); + +return asForTableNoTdb(conn, table); +}