westwestern - thank you kindly for the tips and links! :) I'll start small and work my way up.
Here's a tiny patch to fix an error I get when completing a quiz made up of four multichoice questions. An example error msg is:
• user warning: Column 'nid' in where clause is ambiguous query: SELECT *, IFNULL((SELECT 1 FROM quiz_multichoice_user_answers ua WHERE question_nid = nid AND question_vid = vid AND result_id = 3 AND ua.answer_id = ma.answer_id),0) as user_answer, (SELECT is_correct FROM quiz_node_results_answers WHERE question_nid = nid AND question_vid = vid AND result_id = 3) as question_correct FROM node LEFT JOIN node_revisions USING (nid, vid) LEFT JOIN quiz_multichoice_answers ma USING (nid, vid)WHERE nid = 10 AND vid = 10 in /Users/katin/Sites/includes/database.mysql.inc on line 172.
And one of these messages appears for each question in the quiz. This is present in multichoice.module,v 1.59 2007/12/13 22:49:15 (from HEAD).
The attached patch fixes this issue by clarifying which nid & vid (node or node_revisions). This may only apply to mysql Ver 14.7 Distrib 4.1.21, the version I'm using on my test bench, but the fix shouldn't break mysql 5 or other versions.
I did search for issues and patches that might already address this issue before submitting this patch, and I didn't find any. Hoping to avoid dups (like my last one, erp.) Feedback on my process is welcomed. Thanks!
| Comment | File | Size | Author |
|---|---|---|---|
| ambigious_nid_fix.patch | 1.58 KB | katin |
Comments
Comment #1
westwesterson commentedpatch looks clean and good, will test when i have time. If you review a patch and it works for you you can leave a comment, or mark it ready to be committed. that speeds up the process of getting things into the module!
Comment #2
westwesterson commentedworks no regressions for mysql 5, applying to core module. Thanks. Great patch!
Comment #3
(not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.