Skip to content

Query returns no results on indexed column if query string is longer than index #198

@flack

Description

@flack

I have the following code:

// email is a string field with index="yes"
$email = 'thisisareallyreallylongstringtomakesurewerelongerthantheindex@unitteststheproblemshowedupwith86chrs.fx';
$person = new openpsa_person;
$person->email = $email;
$person->create();

$qb = new midgard_query_builder('openpsa_person');
$qb->add_constraint('email', '=', $email);
$results = $qb->execute();
echo count($results); // Expected: 1, Actual: 0

what is interesting is that if you use this constraint instead:

$qb->add_constraint('email', 'LIKE', $email);

then it works as expected. I also tried a plain mysql select with "=", and it works, too, so this is something that midgard does

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions