Problem
In the QueryPredicate constructor (include/query_predicates.h), the member is located by scanning record.member_metadata for an entry whose offset matches the offset derived from the pointer-to-member:
for (auto i = 0; i < record.member_metadata.size(); ++i) {
if (record.member_metadata[i].offset == offset) {
member_name_ = record.member_metadata[i].name;
value_ = ...;
break;
}
}
If no entry matches (e.g. an unregistered type — see related issue — or an offset-derivation problem), member_name_ stays empty and no error is raised.
Impact
Evaluate() then emits a clause like = ? (empty column name), producing malformed SQL that fails later at prepare time with a confusing message, rather than failing fast at the point of misuse.
Suggested direction
Throw a clear exception from the constructor when no member matches the pointer-to-member, naming the record type, so the error is reported at construction.
Problem
In the
QueryPredicateconstructor (include/query_predicates.h), the member is located by scanningrecord.member_metadatafor an entry whoseoffsetmatches the offset derived from the pointer-to-member:If no entry matches (e.g. an unregistered type — see related issue — or an offset-derivation problem),
member_name_stays empty and no error is raised.Impact
Evaluate()then emits a clause like= ?(empty column name), producing malformed SQL that fails later at prepare time with a confusing message, rather than failing fast at the point of misuse.Suggested direction
Throw a clear exception from the constructor when no member matches the pointer-to-member, naming the record type, so the error is reported at construction.