662a9c06455561764ea4ff44a33347984638013a markd Wed Sep 1 22:38:53 2010 -0700 check for existance of ccdsNotes table before using it. Also fix some possible unnecessary connects diff --git src/hg/hgc/ccdsClick.c src/hg/hgc/ccdsClick.c index f5fae2d..8ab9aa9 100644 --- src/hg/hgc/ccdsClick.c +++ src/hg/hgc/ccdsClick.c @@ -17,7 +17,7 @@ /* Get a ccdsInfo object for a RefSeq, ensembl, or vega gene, if it * exists, otherwise return NULL */ { -if (hTableExists(database, "ccdsInfo")) +if (sqlTableExists(conn, "ccdsInfo")) return ccdsInfoSelectByMrna(conn, acc); else return NULL; @@ -347,7 +347,7 @@ printf("\n"); printf(" mRNAProtein\n"); printf("\n"); -if (hTableExists(database, "ccdsKgMap")) +if (sqlTableExists(conn, "ccdsKgMap")) ccdsKnownGenesRows(conn, ccdsId); ccdsNcbiRows(ccdsId, rsCcds); if (vegaCcds != NULL) @@ -366,7 +366,9 @@ static void writePublicNotesHtml(struct sqlConnection *conn, char *ccdsId) /* write public notes if available */ { -struct ccdsNotes *ccdsNotes = sqlQueryObjs(conn, (sqlLoadFunc)ccdsNotesLoad, sqlQueryMulti, +struct ccdsNotes *ccdsNotes = NULL; +if (sqlTableExists(conn, "ccdsNotes")) + ccdsNotes = sqlQueryObjs(conn, (sqlLoadFunc)ccdsNotesLoad, sqlQueryMulti, "select * from ccdsNotes where ccds = \"%s\" order by createDate", ccdsId); if (ccdsNotes != NULL) {