4cffc3eb6f43e109452b5b52d1f760cf1ea6a981
jcasper
  Sun Jun 7 21:47:37 2026 -0700
Adjusting sessionDb and userDb IDs to be 64-bit in the code, since the database
is now ready for it and we're crossing the threshold.  refs #33554

diff --git src/hg/lib/cartDb.c src/hg/lib/cartDb.c
index 6f7ef72ca20..5ef297e14df 100644
--- src/hg/lib/cartDb.c
+++ src/hg/lib/cartDb.c
@@ -109,88 +109,88 @@
 	{
 	useSessionKey = FALSE;
 	}
     else if (sameString(sessionKey, "autodetect"))
 	{
 	errAbort("brower.sessionKey=autodetect has not implemented yet."); // TODO
 	}
     }
 return useSessionKey;
 }
 
 void cartDbSecureId(char *buf, int bufSize, struct cartDb *cartDb)
 /* Return combined string of session id plus sessionKey in buf if turned on.*/
 {
 if (cartDbUseSessionKey() && !sameString(cartDb->sessionKey,""))
-    safef(buf, bufSize, "%u_%s", cartDb->id, cartDb->sessionKey);
+    safef(buf, bufSize, "%lu_%s", cartDb->id, cartDb->sessionKey);
 else
-    safef(buf, bufSize, "%u", cartDb->id);
+    safef(buf, bufSize, "%lu", cartDb->id);
 }
 
-unsigned int cartDbParseId(char *id, char **pSessionKey)
+unsigned long int cartDbParseId(char *id, char **pSessionKey)
 /* Parse out the numeric id and id_sessionKey string if present. */
 {
-unsigned int result = 0;
+unsigned long int result = 0;
 if (sameString(id,"")) // some users reported blank cookie values.
     {
     verbose(1, "cartDbParseId: id with empty string found.");
     if (pSessionKey)
 	*pSessionKey = NULL;
     return 0;
     }
 char *e = strchr(id, '_');
 if (e)
     *e = 0;
-result = sqlUnsigned(id);
+result = sqlUnsignedLong(id);
 if (e)
     {
     *e = '_';
     if (pSessionKey)
 	*pSessionKey = e+1;
     }
 else
     {
     if (pSessionKey)
 	*pSessionKey = NULL;
     }
 return result;
 }
 
 
 void cartDbStaticLoad(char **row, struct cartDb *ret)
 /* Load a row from cartDb table into ret.  The contents of ret will
  * be replaced at the next call to this function. */
 {
 
-ret->id = sqlUnsigned(row[0]);
+ret->id = sqlUnsignedLong(row[0]);
 ret->contents = row[1];
 ret->reserved = sqlSigned(row[2]);
 ret->firstUse = row[3];
 ret->lastUse = row[4];
 ret->useCount = sqlSigned(row[5]);
 if (cartDbUseSessionKey())
     ret->sessionKey = row[6];
 }
 
 struct cartDb *cartDbLoad(char **row)
 /* Load a cartDb from row fetched with select * from cartDb
  * from database.  Dispose of this with cartDbFree(). */
 {
 struct cartDb *ret;
 
 AllocVar(ret);
-ret->id = sqlUnsigned(row[0]);
+ret->id = sqlUnsignedLong(row[0]);
 ret->contents = cloneString(row[1]);
 ret->reserved = sqlSigned(row[2]);
 ret->firstUse = cloneString(row[3]);
 ret->lastUse = cloneString(row[4]);
 ret->useCount = sqlSigned(row[5]);
 if (cartDbUseSessionKey())
     ret->sessionKey = cloneString(row[6]);
 return ret;
 }
 
 struct cartDb *cartDbLoadAll(char *fileName) 
 /* Load all cartDb from a tab-separated file.
  * Dispose of this with cartDbFreeList(). */
 {
 struct cartDb *list = NULL, *el;
@@ -229,31 +229,31 @@
 slReverse(&list);
 sqlFreeResult(&sr);
 dyStringFree(&query);
 return list;
 }
 
 struct cartDb *cartDbCommaIn(char **pS, struct cartDb *ret)
 /* Create a cartDb out of a comma separated string. 
  * This will fill in ret if non-null, otherwise will
  * return a new cartDb */
 {
 char *s = *pS;
 
 if (ret == NULL)
     AllocVar(ret);
-ret->id = sqlUnsignedComma(&s);
+ret->id = sqlUnsignedLongComma(&s);
 ret->contents = sqlStringComma(&s);
 ret->reserved = sqlSignedComma(&s);
 ret->firstUse = sqlStringComma(&s);
 ret->lastUse = sqlStringComma(&s);
 ret->useCount = sqlSignedComma(&s);
 if (cartDbUseSessionKey())
     ret->sessionKey = sqlStringComma(&s);
 *pS = s;
 return ret;
 }
 
 void cartDbFree(struct cartDb **pEl)
 /* Free a single dynamically allocated cartDb such as created
  * with cartDbLoad(). */
 {
@@ -273,31 +273,31 @@
 {
 struct cartDb *el, *next;
 
 for (el = *pList; el != NULL; el = next)
     {
     next = el->next;
     cartDbFree(&el);
     }
 *pList = NULL;
 }
 
 void cartDbOutput(struct cartDb *el, FILE *f, char sep, char lastSep) 
 /* Print out cartDb.  Separate fields with sep. Follow last field with lastSep. */
 {
 if (sep == ',') fputc('"',f);
-fprintf(f, "%u", el->id);
+fprintf(f, "%lu", el->id);
 if (sep == ',') fputc('"',f);
 fputc(sep,f);
 if (sep == ',') fputc('"',f);
 fprintf(f, "%s", el->contents);
 if (sep == ',') fputc('"',f);
 fputc(sep,f);
 fprintf(f, "%d", el->reserved);
 fputc(sep,f);
 if (sep == ',') fputc('"',f);
 fprintf(f, "%s", el->firstUse);
 if (sep == ',') fputc('"',f);
 fputc(sep,f);
 if (sep == ',') fputc('"',f);
 fprintf(f, "%s", el->lastUse);
 if (sep == ',') fputc('"',f);