The function advpoll_calculate_results_binary() in modes/binary.inc uses " to escape the values in the query.
This query will fail on postgres. Correct escape char for postgres is '.

Wrong:
$result = db_query('SELECT uid, vote_source FROM {votingapi_vote} WHERE content_type = "advpoll" AND content_id = %d AND value_type = "option" GROUP BY uid, vote_source, timestamp', $node->nid);

Correct:
$result = db_query("SELECT uid, vote_source FROM {votingapi_vote} WHERE content_type = 'advpoll' AND content_id = %d AND value_type = 'option' GROUP BY uid, vote_source, timestamp", $node->nid);

Comments

Vector-’s picture

Status: Active » Needs review
StatusFileSize
new704 bytes

Well, this issue is still active in the latest revision... perhaps a patch will help?

PS: As per http://drupal.org/node/2497 - there may be other reasons for this besides just PostgreSQL, but:
"Any string literal or %s placeholder must be enclosed by single quotes: ' . Never use double quotes."

jacob.embree’s picture

Issue summary: View changes
Status: Needs review » Closed (duplicate)
Parent issue: » #1690096: Incorrect use of double quotation marks in binary.inc

I didn't see this issue when I posted the patch at #1690096: Incorrect use of double quotation marks in binary.inc. Otherwise that would be the duplicate. Nevertheless, marking this issue as a duplicate because the patch I posted there applies and this one doesn't anymore.