d983323cd2570af1cf3971763d14ef2d88c06fe4 jcasper Wed Feb 19 17:00:19 2025 -0800 sqlTableSize needs to support tables with more than 2B rows (rarely, but it does), refs #35262 diff --git src/hg/lib/hdb.c src/hg/lib/hdb.c index 88e51540fe2..63391ad7021 100644 --- src/hg/lib/hdb.c +++ src/hg/lib/hdb.c @@ -863,31 +863,31 @@ hCartMkCache(); return sqlConnCacheAlloc(cartCc, cartDb); } void hDisconnectCart(struct sqlConnection **pConn) /* Put back connection for reuse. */ { if (*pConn != NULL) sqlConnCacheDealloc(cartCc, pConn); } boolean hCanHaveSplitTables(char *db) /* Return TRUE if split tables are allowed in database. */ { struct sqlConnection *conn = hAllocConn(db); -int count = sqlTableSizeIfExists(conn, "chromInfo"); +long count = sqlTableSizeIfExists(conn, "chromInfo"); hFreeConn(&conn); return (count >= 0 && count <= HDB_MAX_SEQS_FOR_SPLIT); } static void tableListHashAdd(struct hash *dbTblHash, char *profile, char *db) /* Add to a hash that maps a track/table name (unsplit) to an slName list * of actual table names (possibly split) -- we can compute this once and * cache it to save a lot of querying if we will check existence of * lots of tables. */ { if (trackHubDatabase(db)) { struct trackHub *hub = hubConnectGetHubForDb(db); if (hub != NULL) { @@ -5535,31 +5535,31 @@ * chrom name comparison, that strip prefixes and does numeric compare */ { const struct bed *a = *((struct bed **)va); const struct bed *b = *((struct bed **)vb); int dif; dif = chrNameCmp(a->chrom, b->chrom); if (dif == 0) dif = a->chromStart - b->chromStart; return dif; } int getTableSize(char *db, char *table) /* Get count of rows in a table in the primary database */ { struct sqlConnection *conn = hAllocConn(db); -int ct = sqlTableSize(conn, table); +long ct = sqlTableSize(conn, table); hFreeConn(&conn); return ct; } int compareDbs(char *dbA, char *dbB) /* Compare two org# e.g. mm6 vs. mm16 or mm6 vs. hg17 * Return > 0 if dbA > dbB, < 0 if less than, and 0 if equal */ { char *dbAOrg = splitOffNonNumeric(dbA); char *dbBOrg = splitOffNonNumeric(dbB); int result = strcmp(dbAOrg,dbBOrg); if (result == 0) { char *dbANum = splitOffNumber(dbA); char *dbBNum = splitOffNumber(dbB);