5b8c4168d4807c729fc8b1f199d9eb03c9411069 galt Thu Mar 3 18:40:54 2016 -0800 Replacing simple literal NOSQLINJ in string with the #define NOSQLINJ. This is slightly better because the compiler can catch a mis-spelling of the NOSQLINJ keyword. This was suggested by Angie. diff --git src/hg/lib/hgFind.c src/hg/lib/hgFind.c index a6a9a0e..774b06f 100644 --- src/hg/lib/hgFind.c +++ src/hg/lib/hgFind.c @@ -2636,31 +2636,31 @@ struct sqlConnection *conn = hAllocConn(db); struct sqlResult *sr = NULL; char **row; boolean isFuzzy = sameWord(hfs->searchMethod, "fuzzy"); // TODO wonder if we could re-work this better to get to upstream sql creation and // then be able to avoid this complexity:? // hfs->refTable sometimes contains a comma-separated table list // but we do not have control over the original sql since it is in trackDb.ra // example from human/hg19/trackDb.ra // xrefTable kgXref, ucscRetroInfo5 // xrefQuery select ucscRetroInfo5.name, spDisplayID from %s where spDisplayID like '%s%%' and kgName = kgID struct dyString *dy = dyStringNew(256); -dyStringAppend(dy, "NOSQLINJ "); +dyStringAppend(dy, NOSQLINJ ""); // in particular, if we could get to the upstream and change the first %s to %-s for the param corresponding to xrefTable, // that would be nice. dyStringPrintf(dy, hfs->xrefQuery, sqlCkIl(hfs->xrefTable), sqlEscapeString(term)); // keep this sqlEscape sr = sqlGetResult(conn, dy->string); dyStringFree(&dy); while ((row = sqlNextRow(sr)) != NULL) { if (!isFuzzy || keyIsPrefixIgnoreCase(term, row[1])) { xrefPtr = slPairNew(cloneString(row[1]), cloneString(row[0])); slAddHead(&xrefList, xrefPtr); } } sqlFreeResult(&sr); hFreeConn(&conn);