When an ENUM field contains the value '0' this produces in invalid search term SQL which will not find any rows.
CREATE TABLE `1_test` (
`foo` enum('0','1') COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`foo`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
INSERT INTO `1_test` (`foo`) VALUES ('0'), ('1');
From search tab:
Select โ0โ from dropdown for field foo
> Go > === 0 results (incorrect)
Select โ1โ from dropdown for field foo
> Go > === 1 result (correct)
The generated SQL for โ0โ is producing foo
= 0 whereas for โ1โ it is foo
= โ1โ
All values used to search an ENUM in the SQL should be inside quotes.
I think I have found the part which causes the problem, I'm setting up a pull request.
Here is my pull request: #14648
Most helpful comment
I think I have found the part which causes the problem, I'm setting up a pull request.