Bug in Ubiquo 0.8 with Postgresql

13 views
Skip to first unread message

Bernat Ràfales

unread,
Mar 9, 2012, 3:04:10 AM3/9/12
to ubiquo...@googlegroups.com
Hello guys,
If you try to perform a filter_text search in any model using ubiquo_filtered_search and provide an invalid regular expression string such as '*', ubiquo breaks with an error.
The problem has been localized and happens because when using the Postgresql adapter, a search is done like this:
ActiveRecord::StatementInvalid (PG::Error: ERROR:  la expresión regular no es válida: quantifier operand invalid
: SELECT * FROM "category_sets" WHERE (lower(category_sets.name) ~* '*')  ORDER BY category_sets.id desc LIMIT 11 OFFSET 0):
Where '*' is obviously not a valid regular expression.

We should consider escaping possible regexp characters in the searches when using the postgresql adapter.

Discuss!

--
Bernat Ràfales
braf...@gnuine.com

gnuine
www.gnuine.com
C/ Pamplona, 96
Local 17
22@ - 08018 Barcelona

Tel: +34.93.567.94.94
Fax: +34.93.567.94.95

Reply all
Reply to author
Forward
0 new messages