src/hg/lib/hdb.c 1.400

1.400 2009/04/15 19:40:43 angie
Use the more efficient hDbExists in hTableOrSplitExists, and move the sqlDatabaseExists into hDbExists.
Index: src/hg/lib/hdb.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/lib/hdb.c,v
retrieving revision 1.399
retrieving revision 1.400
diff -b -B -U 4 -r1.399 -r1.400
--- src/hg/lib/hdb.c	17 Mar 2009 19:54:56 -0000	1.399
+++ src/hg/lib/hdb.c	15 Apr 2009 19:40:43 -0000	1.400
@@ -284,9 +284,9 @@
 char query[256];
 boolean res = FALSE;
 safef(query, sizeof(query), "select name from dbDb where name = '%s'",
       database);
-res = (sqlQuickQuery(conn, query, buf, sizeof(buf)) != NULL);
+res = (sqlQuickQuery(conn, query, buf, sizeof(buf)) != NULL) && sqlDatabaseExists(database);
 hDisconnectCentral(&conn);
 hashAddInt(dbsChecked, database, res);
 return res;
 }
@@ -795,9 +795,9 @@
 
 boolean hTableOrSplitExists(char *db, char *track)
 /* Return TRUE if track table (or split table) exists in db. */
 {
-if (!sqlDatabaseExists(db))
+if (!hDbExists(db))
     return FALSE;
 struct hash *hash = tableListGetDbHash(db);
 return (hashLookup(hash, track) != NULL);
 }