#171 breaks searching for values with underscores #176

Closed
radar opened this Issue Dec 18, 2012 · 1 comment

2 participants

@radar
ActiveRecord Hackery member

This is related to #171.

Ransack is issuing a query that contains the underscores escaped:

... WHERE ((((("spree_users"."email" LIKE 'lol\_wut@gmail.com%' ...

I don't think this is the right behaviour for non-MSSQL databases. These characters should not be escaped in non-MSSQL databases.

@radar radar added a commit that referenced this issue Dec 18, 2012
@radar radar Revert escaping of underscore characater from #171
Related to #176
71a3938
@radar radar added a commit to radar/spree that referenced this issue Dec 18, 2012
@radar radar Depend on Ransack 0.7.2 a9418b0
@radar radar added a commit to radar/spree that referenced this issue Dec 18, 2012
@radar radar Depend on Ransack 0.7.2 0a98eaf
@radar radar added a commit to spree/spree that referenced this issue Dec 19, 2012
@radar radar Depend on Ransack 0.7.2 165bff2
@radar radar added a commit to radar/spree that referenced this issue Dec 21, 2012
@radar radar Depend on Ransack 0.7.2 241f1aa
@sanemat sanemat added a commit to sanemat/ransack that referenced this issue Dec 22, 2012
@sanemat sanemat Pend escaping of underscore characater test
Rerated to #171, #176
6837403
@labocho

Sorry. It's my mistake. Backslash can escape % and _ on MySQL and PostgreSQL only.

In order to work in other databases, I must specify escape character like below.

... WHERE email LIKE 'foo!_bar@example.com' ESCAPE '!' ...

But arel (3.0.2) does not support ESCAPE.

My escaping method will make problem on databases without MySQL or PostgreSQL. Please revert my commits completely.

@radar radar added a commit to spree/spree that referenced this issue Jan 2, 2013
@radar radar Depend on Ransack 0.7.2 9db456b
@radar radar added a commit that closed this issue Nov 6, 2013
@radar radar Fix overly aggressive escaping on databases that are not PostgreSQL
I am unsure if this is necessary for any other databases.

Relevant to #171
Fixes #176
Fixes spree/spree#3936
6060acf
@radar radar closed this in 6060acf Nov 6, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment