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

Detect foreign tables in 2.3.x upgrade, print error and skip

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.3.1, 2.4
    • Fix Version/s: 2.3.2
    • Component/s: Database SQL/XMLDB
    • Labels:
    • Testing Instructions:
      Hide

      1/ install Moodle 2.2 with 'mdl_' prefix
      2/ add bogus tables with names: 'mdl_111user', 'mdl_user-bak', 'mdl_userBak'
      3/ create with 'mdl_tableview' from any other table such as "create view mdl_tableview as select * from mdl_config"
      4/ expected warnings during upgrade to 2.3 or master branch:

      • Database table with invalid name 'mdl_111user' detected, skipping.
      • Database table with invalid name 'mdl_user-bak' detected, skipping.
      • Database table with invalid name 'mdl_userBak' detected, skipping.
      • Unsupported database table view 'mdl_tableview' detected, skipping.
      Show
      1/ install Moodle 2.2 with 'mdl_' prefix 2/ add bogus tables with names: 'mdl_111user', 'mdl_user-bak', 'mdl_userBak' 3/ create with 'mdl_tableview' from any other table such as "create view mdl_tableview as select * from mdl_config" 4/ expected warnings during upgrade to 2.3 or master branch: Database table with invalid name 'mdl_111user' detected, skipping. Database table with invalid name 'mdl_user-bak' detected, skipping. Database table with invalid name 'mdl_userBak' detected, skipping. Unsupported database table view 'mdl_tableview' detected, skipping.
    • Affected Branches:
      MOODLE_23_STABLE, MOODLE_24_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      w36_MDL-35080_m24_weirdtables

      Description

      It is not allowed to add custom views or tables that are not defined in install.xml, these foreign tables must not use moodle database table prefix.

      Some admins and developers ignore this, we need to educate them and for now skip these tables during upgrade to 2.3.x

      In the future standalone db diagnostics scripts should detect this and warn admins.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  10/Sep/12