Skip to content

lucene: NewSQLDriver silently ignores fields with nil FieldInfo.Type #225

Description

@Lutherwaves

Split out of #224 planning.

Problem

Array-field detection depends entirely on FieldInfo.Type being populated. NewParser fills it by reflection, but NewSQLDriver and NewDynamoDBDriver are exported and trust the caller.

A caller that hand-builds []FieldInfo and omits Type (or sets a type that is not the real field type) gets every array check silently returning false. The field falls back to scalar equality — which is exactly the bug #224 fixes — with no error to explain it.

This is not hypothetical: the existing test files in storage/search/lucene hand-build FieldInfo values throughout.

Suggested fix

Reject a FieldInfo with a nil Type at driver construction, so the mistake surfaces far from the query with an error naming the offending field.

Why deferred

Breaking change for existing callers passing incomplete FieldInfo values. Deliberately deferred out of the #224 PR rather than overlooked.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions