KamoCRM

Stop the bug list 500ing on every unfiltered load

Fixkamo-shared-library
Shipped
25 ஆகஸ்ட், 2026 அன்று 3:29 PM UTC
Author
Kamo
Commit
718635f

PostgreSQL cannot infer a type for a null parameter inside a string expression: LOWER(CONCAT('%', :search, '%')) with a null :search guessed bytea, and the list died on 'function lower(bytea) does not exist' for every load without a search term — which is all of them by default. :search is now a ready-made, lower-cased LIKE pattern built by the caller and never null, with ESCAPE declared so the caller's escaping of % and _ is not inert. Two more faults found while fixing it: the nullable description needed COALESCE, because NULL LIKE '%' is NULL rather than true and a bug filed with no description would have vanished from an unfiltered list; and the derived count query counted a bug once per site it named, so a bug tagged with three sites inflated the total by two. Verified by executing the generated SQL against yb-tserver directly.

All changes

Like what you see shipping?

All of it arrives in your workspace on its own. Start on the free plan and read this page again in a month.

Start Free ForeverView Pricing