sequelize/sequelize — pull request #924 by lynx1983 (2013-09-21 11:16:45+00:00)
Title: Bug in findAndCountAll if wherу contains ["name LIKE ?", "%search%"] condition

Fixed findAndCountAll if where contains a condition of the form "name LIKE '%search%'"

options = {
where: ["name LIKE ?", "%search%"]
}

Result query for counting:

SELECT count(*) as "count" FROM "Table" WHERE name LIKE '%search%';

in second sql query after counting, options where is ["%search%"] only
what causes an error in the second query

Result query for items:

SELECT * FROM "Table" WHERE %search%