Summary | Poll block broken for latest poll option |
Queue | Scry |
Type | Bug |
State | Resolved |
Priority | 1. Low |
Owners | Horde Developers (at) |
Requester | jason (at) alteredminds (dot) com |
Created | 05/19/2005 (7432 days ago) |
Due | |
Updated | 05/30/2005 (7421 days ago) |
Assigned | 05/21/2005 (7430 days ago) |
Resolved | 05/30/2005 (7421 days ago) |
Github Issue Link | |
Github Pull Request | |
Milestone | |
Patch | No |
State ⇒ Resolved
to load polls in one query and options in a second. Still 2 queries
max ,and then the limitQuery logic could work correctly.
State ⇒ Assigned
These are the log lines from the execution of the Block after I have
voted on the poll.
May 19 10:37:07 wintermute HORDE[9728]: [scry] SQL Query by
Scry_Driver_sql::getPolls(): SELECT * FROM scry_polls LEFT JOIN
scry_choices ON scry_polls.poll_id = scry_choices.poll_id WHERE
poll_enabled = 1 AND (1116495427 >= poll_start OR poll_start IS NULL)
AND (1116495427 < poll_end OR poll_end IS NULL) LIMIT 1 OFFSET 0 [on
line 116 of
"/export/home/jason/html/beta/horde/scry/lib/Driver/sql.php"]
May 19 10:37:07 wintermute HORDE[9728]: [scry] SQL Query by
Scry_Driver_sql::getPolls(): SELECT * FROM scry_polls LEFT JOIN
scry_choices ON scry_polls.poll_id = scry_choices.poll_id WHERE
scry_polls.poll_id = 4 [on line 116 of
"/export/home/jason/html/beta/horde/scry/lib/Driver/sql.php"]
May 19 10:37:07 wintermute HORDE[9728]: [scry] SQL Query by
Scry_Driver_sql::getVotes(): SELECT scry_choices.poll_id,
choice_value, COUNT(vote_id) AS vote_count
FROM scry_choices LEFT JOIN scry_votes ON
scry_choices.choice_id = scry_votes.choice_id WHERE
scry_votes.vote_confirmation IS NULL AND scry_choices.poll_id = 4
GROUP BY scry_choices.poll_id,
scry_choices.choice_value, scry_choices.choice_id
ORDER BY scry_choices.poll_id, vo
The result of the first query is only one line due to the limit
directive being set to 1. Using the patch this limit is upped to the
maximum number of possible poll elements. Thinking about it this is
not the most ideal way of getting all the questions out, but it does
work.
State ⇒ Feedback
debug logging and post the SQL statement that you get *without* your
patch?
State ⇒ Unconfirmed
Priority ⇒ 1. Low
Type ⇒ Bug
Summary ⇒ Poll block broken for latest poll option
Queue ⇒ Scry
New Attachment: scry.patch
latest" it will display only the first choice for the latest poll, not
the complete list of choices for that poll.
The attached patch is required to get the whole poll to display.
I am using the latest version of CVS head for everything as of this
date. The polls are being stored in a postgres database.