Skip to content

Commit

Permalink
MDL-29520 - mysql multitable delete, outer join some tables
Browse files Browse the repository at this point in the history
  • Loading branch information
stronk7 committed Oct 9, 2011
1 parent 9086337 commit 033d656
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions question/engine/datalib.php
Original file line number Diff line number Diff line change
Expand Up @@ -695,8 +695,8 @@ protected function delete_usage_records_for_mysql(qubaid_condition $qubaids) {
DELETE qu, qa, qas, qasd
FROM {question_usages} qu
JOIN {question_attempts} qa ON qa.questionusageid = qu.id
JOIN {question_attempt_steps} qas ON qas.questionattemptid = qa.id
JOIN {question_attempt_step_data} qasd ON qasd.attemptstepid = qas.id
LEFT JOIN {question_attempt_steps} qas ON qas.questionattemptid = qa.id
LEFT JOIN {question_attempt_step_data} qasd ON qasd.attemptstepid = qas.id
WHERE qu.id ' . $qubaids->usage_id_in(),
$qubaids->usage_id_in_params());
}
Expand All @@ -713,7 +713,7 @@ protected function delete_attempt_steps_for_mysql($test, $params) {
$this->db->execute('
DELETE qas, qasd
FROM {question_attempt_steps} qas
JOIN {question_attempt_step_data} qasd ON qasd.attemptstepid = qas.id
LEFT JOIN {question_attempt_step_data} qasd ON qasd.attemptstepid = qas.id
WHERE qas.questionattemptid ' . $test, $params);
}

Expand Down

0 comments on commit 033d656

Please sign in to comment.