mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-21 10:19:57 +00:00
employee_query, lead_query and bom() ranked autocomplete results with a bare Locate(txt, col) in ORDER BY. frappe maps Locate -> strpos on Postgres, which is case-sensitive, while MariaDB's LOCATE against a column uses the column's case-insensitive collation. So the search-dropdown ordering diverged between engines for mixed-case matches (row count/membership unchanged — the WHERE .like() is already ILIKE). Wrap both Locate operands in Lower(), matching the sibling item_query/get_project_name handlers in the same file: a no-op on MariaDB, and case-insensitive (MariaDB-faithful) on Postgres. The existing test_queries suite stays green on both engines.