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!

CommentFileSizeAuthor
ambigious_nid_fix.patch1.58 KBkatin

Comments

westwesterson’s picture

patch 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!

westwesterson’s picture

Status: Needs review » Fixed

works no regressions for mysql 5, applying to core module. Thanks. Great patch!

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

  • Commit 8f555f9 on 5.x-2.x, 6.x-2.x, 6.x-3.x, 6.x-4.x, 6.x-5.x, 6.x-6.x, 7.x-4.x, master, 7.x-5.x by westwesterson:
    #201040 multichoice ambiguous query on quiz results by katin
    
    

  • Commit 8f555f9 on 5.x-2.x, 6.x-2.x, 6.x-3.x, 6.x-4.x, 6.x-5.x, 6.x-6.x, 7.x-4.x, master, 7.x-5.x, quiz-pages by westwesterson:
    #201040 multichoice ambiguous query on quiz results by katin
    
    

  • Commit 8f555f9 on 5.x-2.x, 6.x-2.x, 6.x-3.x, 6.x-4.x, 6.x-5.x, 6.x-6.x, 7.x-4.x, master, 7.x-5.x, quiz-pages, 2269219 by westwesterson:
    #201040 multichoice ambiguous query on quiz results by katin
    
    

  • Commit 8f555f9 on 5.x-2.x, 6.x-2.x, 6.x-3.x, 6.x-4.x, 6.x-5.x, 6.x-6.x, 7.x-4.x, master, 7.x-5.x, 2269219 by westwesterson:
    #201040 multichoice ambiguous query on quiz results by katin