Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge branch 'MDL-31829_21' of git://github.com/timhunt/moodle into M…

…OODLE_21_STABLE
  • Loading branch information...
commit 7f8c780dd36898b8077f5f49f7e7a1b0738a246a 2 parents 0b9c121 + b37cff4
Eloy Lafuente (stronk7) authored March 06, 2012

Showing 1 changed file with 2 additions and 25 deletions. Show diff stats Hide diff stats

  1. 27  question/engine/datalib.php
27  question/engine/datalib.php
@@ -770,22 +770,6 @@ protected function delete_usage_records_for_mysql(qubaid_condition $qubaids) {
770 770
     }
771 771
 
772 772
     /**
773  
-     * This function is a work-around for poor MySQL performance with
774  
-     * DELETE FROM x WHERE id IN (SELECT ...). We have to use a non-standard
775  
-     * syntax to get good performance. See MDL-29520.
776  
-     * @param string $test sql fragment.
777  
-     * @param array $params used by $test.
778  
-     */
779  
-    protected function delete_attempt_steps_for_mysql($test, $params) {
780  
-        // TODO once MDL-29589 is fixed, eliminate this method, and instead use the new $DB API.
781  
-        $this->db->execute('
782  
-                DELETE qas, qasd
783  
-                  FROM {question_attempt_steps}     qas
784  
-             LEFT JOIN {question_attempt_step_data} qasd ON qasd.attemptstepid = qas.id
785  
-                 WHERE qas.questionattemptid ' . $test, $params);
786  
-    }
787  
-
788  
-    /**
789 773
      * Delete all the steps for a question attempt.
790 774
      * @param int $qaids question_attempt id.
791 775
      * @param context $context the context that the $quba belongs to.
@@ -796,19 +780,12 @@ public function delete_steps($stepids, $context) {
796 780
         }
797 781
         list($test, $params) = $this->db->get_in_or_equal($stepids, SQL_PARAMS_NAMED);
798 782
 
799  
-        if ($deletefiles) {
800  
-            $this->delete_response_files($context->id, $test, $params);
801  
-        }
802  
-
803  
-        if ($this->db->get_dbfamily() == 'mysql') {
804  
-            $this->delete_attempt_steps_for_mysql($test, $params);
805  
-            return;
806  
-        }
  783
+        $this->delete_response_files($context->id, $test, $params);
807 784
 
808 785
         $this->db->delete_records_select('question_attempt_step_data',
809 786
                 "attemptstepid $test", $params);
810 787
         $this->db->delete_records_select('question_attempt_steps',
811  
-                "attemptstepid $test", $params);
  788
+                "id $test", $params);
812 789
     }
813 790
 
814 791
     /**

0 notes on commit 7f8c780

Please sign in to comment.
Something went wrong with that request. Please try again.