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/hgTracks/factorSource.c src/hg/hgTracks/factorSource.c index 24e8443f5ce..8f512e48d01 100644 --- src/hg/hgTracks/factorSource.c +++ src/hg/hgTracks/factorSource.c @@ -343,30 +343,30 @@ /* Start out as a bed, and then specialize loader, mark self as packable. */ track->bedSize = 5; bedMethods(track); track->drawItemAt = factorSourceDrawItemAt; track->drawItems = factorSourceDraw; track->loadItems = factorSourceLoadItems; track->itemRightPixels = factorSourceRightPixels; /* Get the associated data describing the various sources. */ track->expTable = trackDbRequiredSetting(track->tdb, SOURCE_TABLE); struct sqlConnection *conn = hAllocConn(database); char query[256]; track->sourceCount = sqlTableSizeIfExists(conn, track->expTable); sqlSafef(query, sizeof(query), "select * from %s order by id", track->expTable); struct expRecord *exp, *expList = expRecordLoadByQuery(conn, query); -int expIx; +long expIx; AllocArray(track->sources, track->sourceCount); for (exp=expList, expIx=0; exp != NULL; exp = exp->next, expIx += 1) track->sources[expIx] = exp; hFreeConn(&conn); /* Figure out how many pixels need to the right. */ #ifdef UNUSED int rightCount = tl.mWidth/2; for (expIx=0; expIx < track->sourceCount; ++expIx) rightCount += mgFontStringWidth(tl.font, track->sources[expIx]->name); track->sourceRightPixels = rightCount; #endif }