Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$cleanInlist() in findAll() is a little overzealous #944

Closed
chapmandu opened this issue May 8, 2019 · 2 comments
Closed

$cleanInlist() in findAll() is a little overzealous #944

chapmandu opened this issue May 8, 2019 · 2 comments

Comments

@chapmandu
Copy link
Contributor

chapmandu commented May 8, 2019

What problem does $cleanInlist() in findAll() solve?

https://github.com/cfwheels/cfwheels/blob/master/wheels/global/internal.cfm#L139
https://github.com/cfwheels/cfwheels/blob/master/wheels/model/read.cfm#L56

From what I can see it transforms a sql IN operator statement from:
IN (1, 2, 3) to IN (1,2,3)
IN ('foo', 'bar') to IN ('foo','bar')

This is fine until you try to do this (note parenthesis around the address):

userid IN (1,2) AND (address = '1 Foo Street, Barville') in which case (due to the presence of "IN ()") it is modified to be userid IN (1,2) AND (address = '1 Foo Street,Barville') which is not desirable.

So my questions are:

What problem does this solve? (Is there a fussy database engine that doesn't support spaces between commas?)
Could it be safely removed?

@perdjurner
Copy link
Contributor

I can't remember but this seems related:
#564

@chapmandu
Copy link
Contributor Author

I'll do some more experimentation.. Thanks @perdjurner for the hint!

PS. Good to see you!

@chapmandu chapmandu changed the title Purpose of $cleanInlist() in findAll() $cleanInlist() in findAll() is a little overzealous May 16, 2019
chapmandu added a commit that referenced this issue May 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants