src/hg/lib/hdb.c 1.433

1.433 2010/05/21 16:39:57 angie
hFindTableInfoWithConn: changed split table logic so that we test mrna/all_mrna and est/all_est before checking whether a chrom has been passed in and split table exists. For mrna and est, now we don't want to know if split tables still exist; it confuses other parts of the code.
Index: src/hg/lib/hdb.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/lib/hdb.c,v
retrieving revision 1.432
retrieving revision 1.433
diff -b -B -U 4 -r1.432 -r1.433
--- src/hg/lib/hdb.c	20 May 2010 23:10:05 -0000	1.432
+++ src/hg/lib/hdb.c	21 May 2010 16:39:57 -0000	1.433
@@ -2896,27 +2896,26 @@
     hashAdd(dbHash, db, hash);
     }
 if ((hti = hashFindVal(hash, rootName)) == NULL)
     {
+    if ((sameString(rootName, "mrna") && sqlTableExists(conn, "all_mrna")) ||
+	(sameString(rootName, "est") && sqlTableExists(conn, "all_est")))
+	{
+	safef(fullName, sizeof(fullName), "all_%s", rootName);
+	rootName = fullName;
+	}
+    else
+	{
     if (chrom != NULL)
 	{
 	safef(fullName, sizeof(fullName), "%s_%s", chrom, rootName);
 	if (sqlTableExists(conn, fullName))
 	    isSplit = TRUE;
 	}
     if (!isSplit)
         {
-	safef(fullName, sizeof(fullName), "%s", rootName);
+	    safecpy(fullName, sizeof(fullName), rootName);
 	if (!sqlTableExists(conn, fullName))
-	    {
-	    if (sameString(rootName, "mrna") || sameString(rootName, "est"))
-	        {
-		safef(fullName, sizeof(fullName), "all_%s", rootName);
-		rootName = fullName;
-		if (!sqlTableExists(conn, rootName))
-		    return NULL;
-		}
-	    else
 		return NULL;
 	    }
 	}
     AllocVar(hti);