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

DBs do not want to drop indexes with "-" in name

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0
    • Component/s: Database SQL/XMLDB
    • Labels:
      None
    • Database:
      Any
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE

      Description

      $table = new xmldb_table('role_assignments');
      $index = new xmldb_index('contextid-roleid-userid', XMLDB_INDEX_UNIQUE, array('contextid', 'roleid', 'userid'));

      // Conditionally launch drop index contextid-roleid-userid
      if ($dbman->index_exists($table, $index)) {
      $dbman->drop_index($table, $index);

      fails, because MySQL with error that -roleid-userid is invalid syntax, it needs `around` it for some reason

        Attachments

          Activity

            People

            • Assignee:
              stronk7 Eloy Lafuente (stronk7)
              Reporter:
              skodak Petr Skoda
              Tester:
              Nobody
              Participants:
              Component watchers:
              Jake Dallimore, Jun Pataleta, Ryan Wyllie
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                24/Nov/10