Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-8703

Serious problem upgrading Quiz tables on MYSQL using a SUB SELECT

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 1.9
    • Fix Version/s: 1.9
    • Component/s: Questions, Quiz
    • Labels:
      None
    • Environment:
      MySQL 5.0.22, PHP 5.1.6
    • Database:
      MySQL
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE

      Description

      The change is here:

      http://moodle.cvs.sourceforge.net/moodle/moodle/mod/quiz/db/upgrade.php?r1=1.1&r2=1.2

      SQL for MySQL is:

      DELETE FROM mdl_question_numerical_units WHERE id > (SELECT MIN(iqnu.id) FROM mdl_question_numerical_units iqnu WHERE iqnu.question = mdl_question_numerical_units.question AND iqnu.unit = mdl_question_numerical_units.unit)

      The query fails completely with errors:

      1093: You can't specify target table 'mdl_question_numerical_units' for update in FROM clause

      Also, should this upgrade be in the quiz/db? I would have thought question/type/numerical/db ...

        Attachments

          Activity

            People

            Assignee:
            timhunt Tim Hunt
            Reporter:
            dougiamas Martin Dougiamas
            Tester:
            Nobody
            Participants:
            Component watchers:
            Tim Hunt, Andrew Nicols, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Tim Hunt, Andrew Nicols, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              3/Mar/08