5f552f1a0ee9b190c5c88434da3327c323afc797 kent Wed Jun 8 14:26:20 2016 -0700 Moving bits of tdbQuery that checked for fields not existing in a query statement to rqlParse.c, and making cdwQuery do this check as well. diff --git src/inc/rql.h src/inc/rql.h index 86db767..76a5e0e 100644 --- src/inc/rql.h +++ src/inc/rql.h @@ -107,27 +107,35 @@ struct rqlParse *rqlParseExpression(struct tokenizer *tkz); /* Parse out a clause, usually a where clause. */ struct rqlStatement *rqlStatementParse(struct lineFile *lf); /* Parse an RQL statement out of text */ struct rqlStatement *rqlStatementParseString(char *string); /* Return a parsed-out RQL statement based on string */ void rqlStatementFree(struct rqlStatement **pRql); /* Free up an rql statement. */ void rqlStatementDump(struct rqlStatement *rql, FILE *f); /* Print out statement to file. */ +void *rqlHashFindValEvenInWilds(struct hash *hash, char *name); +/* Find hash val but if no exact match look for wildcards in hash and then match. */ + +void rqlCheckFieldsExist(struct rqlStatement *rql, + struct hash *fieldsThatExist, char *fieldSource); +/* Check that all fields referenced in an rql statement actually exist. + * fieldsThatExist is a hash of field names, and fieldSource is where they came from. */ + typedef char* (*RqlEvalLookup)(void *record, char *key); /* Callback for rqlEvalOnRecord to lookup a variable value. */ struct rqlEval rqlEvalOnRecord(struct rqlParse *p, void *record, RqlEvalLookup lookup, struct lm *lm); /* Evaluate parse tree on record, using lm for memory for string operations. */ struct rqlEval rqlEvalCoerceToBoolean(struct rqlEval r); /* Return TRUE if it's a nonempty string or a non-zero number. */ #endif /* RQL_H */