1cbaa9ddcb7a13929a2217db78d6b36ff738fe15 hiram Fri Apr 24 10:52:34 2026 -0700 doneStatus can simply be status refs #31811 diff --git src/hg/lib/ottoRequest.c src/hg/lib/ottoRequest.c index 2347b58c3c9..9333bc7107e 100644 --- src/hg/lib/ottoRequest.c +++ src/hg/lib/ottoRequest.c @@ -1,42 +1,42 @@ /* ottoRequest.c was originally generated by the autoSql program, which also * generated ottoRequest.h and ottoRequest.sql. This module links the database and * the RAM representation of objects. */ #include "common.h" #include "linefile.h" #include "dystring.h" #include "jksql.h" #include "ottoRequest.h" -char *ottoRequestCommaSepFieldNames = "id,requestType,fromDb,toDb,email,comment,requestTime,doneStatus,buildDir,completeTime"; +char *ottoRequestCommaSepFieldNames = "id,requestType,fromDb,toDb,email,comment,requestTime,status,buildDir,completeTime"; void ottoRequestStaticLoad(char **row, struct ottoRequest *ret) /* Load a row from ottoRequest table into ret. The contents of ret will * be replaced at the next call to this function. */ { ret->id = sqlUnsigned(row[0]); ret->requestType = row[1]; ret->fromDb = row[2]; ret->toDb = row[3]; ret->email = row[4]; ret->comment = row[5]; ret->requestTime = row[6]; -ret->doneStatus = sqlUnsigned(row[7]); +ret->status = sqlUnsigned(row[7]); ret->buildDir = row[8]; ret->completeTime = row[9]; } struct ottoRequest *ottoRequestLoadByQuery(struct sqlConnection *conn, char *query) /* Load all ottoRequest from table that satisfy the query given. * Where query is of the form 'select * from example where something=something' * or 'select example.* from example, anotherTable where example.something = * anotherTable.something'. * Dispose of this with ottoRequestFreeList(). */ { struct ottoRequest *list = NULL, *el; struct sqlResult *sr; char **row; @@ -48,50 +48,50 @@ } slReverse(&list); sqlFreeResult(&sr); return list; } void ottoRequestSaveToDb(struct sqlConnection *conn, struct ottoRequest *el, char *tableName, int updateSize) /* Save ottoRequest as a row to the table specified by tableName. * As blob fields may be arbitrary size updateSize specifies the approx size * of a string that would contain the entire query. Arrays of native types are * converted to comma separated strings and loaded as such, User defined types are * inserted as NULL. This function automatically escapes quoted strings for mysql. */ { struct dyString *update = dyStringNew(updateSize); sqlDyStringPrintf(update, "insert into %s values ( %u,'%s','%s','%s','%s','%s','%s',%u,'%s','%s')", - tableName, el->id, el->requestType, el->fromDb, el->toDb, el->email, el->comment, el->requestTime, el->doneStatus, el->buildDir, el->completeTime); + tableName, el->id, el->requestType, el->fromDb, el->toDb, el->email, el->comment, el->requestTime, el->status, el->buildDir, el->completeTime); sqlUpdate(conn, update->string); dyStringFree(&update); } struct ottoRequest *ottoRequestLoad(char **row) /* Load a ottoRequest from row fetched with select * from ottoRequest * from database. Dispose of this with ottoRequestFree(). */ { struct ottoRequest *ret; AllocVar(ret); ret->id = sqlUnsigned(row[0]); ret->requestType = cloneString(row[1]); ret->fromDb = cloneString(row[2]); ret->toDb = cloneString(row[3]); ret->email = cloneString(row[4]); ret->comment = cloneString(row[5]); ret->requestTime = cloneString(row[6]); -ret->doneStatus = sqlUnsigned(row[7]); +ret->status = sqlUnsigned(row[7]); ret->buildDir = cloneString(row[8]); ret->completeTime = cloneString(row[9]); return ret; } struct ottoRequest *ottoRequestLoadAll(char *fileName) /* Load all ottoRequest from a whitespace-separated file. * Dispose of this with ottoRequestFreeList(). */ { struct ottoRequest *list = NULL, *el; struct lineFile *lf = lineFileOpen(fileName, TRUE); char *row[10]; while (lineFileRow(lf, row)) { @@ -125,31 +125,31 @@ /* Create a ottoRequest out of a comma separated string. * This will fill in ret if non-null, otherwise will * return a new ottoRequest */ { char *s = *pS; if (ret == NULL) AllocVar(ret); ret->id = sqlUnsignedComma(&s); ret->requestType = sqlStringComma(&s); ret->fromDb = sqlStringComma(&s); ret->toDb = sqlStringComma(&s); ret->email = sqlStringComma(&s); ret->comment = sqlStringComma(&s); ret->requestTime = sqlStringComma(&s); -ret->doneStatus = sqlUnsignedComma(&s); +ret->status = sqlUnsignedComma(&s); ret->buildDir = sqlStringComma(&s); ret->completeTime = sqlStringComma(&s); *pS = s; return ret; } void ottoRequestFree(struct ottoRequest **pEl) /* Free a single dynamically allocated ottoRequest such as created * with ottoRequestLoad(). */ { struct ottoRequest *el; if ((el = *pEl) == NULL) return; freeMem(el->requestType); freeMem(el->fromDb); @@ -192,31 +192,31 @@ fprintf(f, "%s", el->toDb); if (sep == ',') fputc('"',f); fputc(sep,f); if (sep == ',') fputc('"',f); fprintf(f, "%s", el->email); if (sep == ',') fputc('"',f); fputc(sep,f); if (sep == ',') fputc('"',f); fprintf(f, "%s", el->comment); if (sep == ',') fputc('"',f); fputc(sep,f); if (sep == ',') fputc('"',f); fprintf(f, "%s", el->requestTime); if (sep == ',') fputc('"',f); fputc(sep,f); -fprintf(f, "%u", el->doneStatus); +fprintf(f, "%u", el->status); fputc(sep,f); if (sep == ',') fputc('"',f); fprintf(f, "%s", el->buildDir); if (sep == ',') fputc('"',f); fputc(sep,f); if (sep == ',') fputc('"',f); fprintf(f, "%s", el->completeTime); if (sep == ',') fputc('"',f); fputc(lastSep,f); } void ottoRequestJsonOutput(struct ottoRequest *el, FILE *f) /* Print out ottoRequest in JSON format. */ { fputc('{',f); @@ -263,34 +263,34 @@ fputc('"',f); fputc(':',f); fputc('"',f); fprintf(f, "%s", el->comment); fputc('"',f); fputc(',',f); fputc('"',f); fprintf(f,"requestTime"); fputc('"',f); fputc(':',f); fputc('"',f); fprintf(f, "%s", el->requestTime); fputc('"',f); fputc(',',f); fputc('"',f); -fprintf(f,"doneStatus"); +fprintf(f,"status"); fputc('"',f); fputc(':',f); -fprintf(f, "%u", el->doneStatus); +fprintf(f, "%u", el->status); fputc(',',f); fputc('"',f); fprintf(f,"buildDir"); fputc('"',f); fputc(':',f); fputc('"',f); fprintf(f, "%s", el->buildDir); fputc('"',f); fputc(',',f); fputc('"',f); fprintf(f,"completeTime"); fputc('"',f); fputc(':',f); fputc('"',f); fprintf(f, "%s", el->completeTime);