Skip to content
Browse files

MDL-30739 qtype numerical: upgrade script uses SQL that is not cross-DB.

  • Loading branch information...
1 parent cb8e878 commit abe73c6d9985dea94b93b9574257ab80f5034d29 @timhunt timhunt committed Dec 15, 2011
Showing with 6 additions and 4 deletions.
  1. +6 −4 question/type/numerical/db/upgrade.php
View
10 question/type/numerical/db/upgrade.php
@@ -70,12 +70,14 @@ function xmldb_qtype_numerical_upgrade($oldversion) {
// Set a better default for questions without units.
$DB->execute('
- UPDATE {question_numerical_options} qno
+ UPDATE {question_numerical_options}
SET showunits = 3
WHERE NOT EXISTS (
- SELECT 1
- FROM {question_numerical_units} qnu
- WHERE qnu.question = qno.question)');
+ SELECT 1
+ FROM {question_numerical_units}
+ WHERE {question_numerical_units}.question =
+ {question_numerical_options}.question
+ )');
upgrade_plugin_savepoint(true, 2009100100, 'qtype', 'numerical');
}

0 comments on commit abe73c6

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