balderdashy / waterline-sequel

A SQL generator for use in Waterline Adapters
MIT License
16 stars 61 forks source link

prepareCriterion in CriteriaProcessor escaping already escaped date #20

Closed johnywith1n closed 9 years ago

johnywith1n commented 9 years ago

In criteriaProcessor.js, the function prepareCriterion doesn't check if a value is already an escaped date when its processing NOT clauses.

This is creating SQL statements like:

SELECT *  WHERE ((`message`.`createdAt` <> "\"2015-01-21 20:09:47\"" ) OR (`message`.`id` < 75 )) AND `message`.`createdAt` <= "2015-01-21 20:09:47" ORDER BY `message`.`createdAt` DESC, `message`.`id` ASC LIMIT 1

specifically:

"\"2015-01-21 20:09:47\""

I'm not sure if this also affects the cases below it, but they also don't check for already escaped dates.

johnywith1n commented 9 years ago

Was this check left out for any particular reason?

CWyrtzen commented 9 years ago

Ninja'd~

sailsbot commented 9 years ago

Thanks for posting, @johnywith1n. I'm a repo bot-- nice to meet you!

It has been 30 days since there have been any updates or new comments on this page. If this issue has been resolved, feel free to disregard the rest of this message. On the other hand, if you are still waiting on a patch, please:

Thanks so much for your help!