21a6584e8ecdbba6d802ab30f3ec564c08b7dcc3 galt Sat Jun 29 02:11:16 2013 -0700 fixing callers of sqlGetField to use sqlSafeFrag diff --git src/hg/lib/hdb.c src/hg/lib/hdb.c index 01a680c..c31df64 100644 --- src/hg/lib/hdb.c +++ src/hg/lib/hdb.c @@ -4672,32 +4672,31 @@ } char *sqlGetField(char *db, char *tblName, char *fldName, char *condition) /* Return a single field from the database, table name, field name, and a condition string */ { struct sqlConnection *conn = hAllocConn(db); char query[256]; struct sqlResult *sr; char **row; char *answer; answer = NULL; sqlSafef(query, sizeof(query), "select %s from %s.%-s where %-s;", - fldName, db, tblName, condition); // note some callers pass an entire tables list with aliases in tblName -//printf("
%s\n", query); fflush(stdout); + fldName, db, sqlCheckIdentifiersList(tblName), condition); // note some callers pass an entire tables list with aliases in tblName sr = sqlGetResult(conn, query); row = sqlNextRow(sr); if (row != NULL) { answer = cloneString(row[0]); } sqlFreeResult(&sr); hFreeConn(&conn); return answer; } struct hash *hChromSizeHash(char *db) /* Get hash of chromosome sizes for database. Just hashFree it when done. */