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

Unique index check needs to include current user for Oracle

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Development in progress
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.6.4
    • Fix Version/s: None
    • Labels:
    • Testing Instructions:
      Hide

      Use http://github.com/moodlehq/moodle-docker

      1. Start up the docker set:

        export MOODLE_DOCKER_WEB_PORT=0
        export MOODLE_DOCKER_WWWROOT=/path/to/your/integration/clone
        export MOODLE_DOCKER_DB=oracle
        

      2. Initialise phpunit:

        ./bin/moodle-docker-compose exec webserver php admin/tool/phpunit/cli/init.php
        

      3. While that goes ahead, open a second terminal and re-export those lovely prefs
      4. Open a connection to the DB server, and create a second tablespace:

        ./bin/moodle-docker-compose exec db bash
        sqlplus sys/oracle as sysdba
        CREATE USER t2 IDENTIFIED BY "m@0dl3ing";
         
        GRANT CONNECT,RESOURCE,DBA TO t2;
        GRANT CREATE SESSION TO t2 WITH ADMIN OPTION;
        GRANT UNLIMITED TABLESPACE TO t2;
        GRANT EXECUTE ON DBMS_LOCK to t2;
        

      5. When the first phpunit install finishes, modify your config.php and change the username from "moodle" to "t2"
      6. Initialise phpunit against the new database:

        ./bin/moodle-docker-compose exec webserver php admin/tool/phpunit/cli/init.php
        

      7. Edit your config.php and add the following line just before the call to setup.php:

        $CFG->prefix = $CFG->phpunit_prefix;
        

      8. Copy the attached test-46520.php file to your root, and run it
        1. Confirm a distinct lack of errors

      Note: You can only run the script once. If you want to run it again, you'll need to change the field + index being dropped

      Show
      Use http://github.com/moodlehq/moodle-docker Start up the docker set: export MOODLE_DOCKER_WEB_PORT=0 export MOODLE_DOCKER_WWWROOT=/path/to/your/integration/clone export MOODLE_DOCKER_DB=oracle Initialise phpunit: ./bin/moodle-docker-compose exec webserver php admin/tool/phpunit/cli/init.php While that goes ahead, open a second terminal and re-export those lovely prefs Open a connection to the DB server, and create a second tablespace: ./bin/moodle-docker-compose exec db bash sqlplus sys/oracle as sysdba CREATE USER t2 IDENTIFIED BY "m@0dl3ing";   GRANT CONNECT,RESOURCE,DBA TO t2; GRANT CREATE SESSION TO t2 WITH ADMIN OPTION; GRANT UNLIMITED TABLESPACE TO t2; GRANT EXECUTE ON DBMS_LOCK to t2; When the first phpunit install finishes, modify your config.php and change the username from " moodle " to " t2 " Initialise phpunit against the new database: ./bin/moodle-docker-compose exec webserver php admin/tool/phpunit/cli/init.php Edit your config.php and add the following line just before the call to setup.php: $CFG->prefix = $CFG->phpunit_prefix; Copy the attached test-46520.php file to your root, and run it Confirm a distinct lack of errors Note: You can only run the script once. If you want to run it again, you'll need to change the field + index being dropped
    • Affected Branches:
      MOODLE_26_STABLE
    • Pull Master Branch:
      MDL-46520-master

      Description

      During upgrade from 2.4.6 to 2.6.4, mod_assign upgrade failed with:

       Default exception handler: column "assign_grades->mailed" cannot be modified. Dependency found with index "m_assigrad_mai_ix (mailed, mailed, mailed, mailed, mailed, mailed, mailed, mailed, mailed, mailed, mailed, mailed, mailed, mailed, mailed, mailed)" 
      Debug: Error code: ddldependencyerror
      * line 725 of /lib/ddl/database_manager.php: ddl_dependency_exception thrown
      * line 557 of /lib/ddl/database_manager.php: call to database_manager->check_field_dependencies()
      * line 335 of /mod/assign/db/upgrade.php: call to database_manager->drop_field()
      * line 689 of /lib/upgradelib.php: call to xmldb_assign_upgrade()
      * line 418 of /lib/upgradelib.php: call to upgrade_plugins_modules()
      * line 1601 of /lib/upgradelib.php: call to upgrade_plugins()
      * line 438 of /admin/index.php: call to upgrade_noncore(), 
      referer: http://localhost/moodle2/admin/index.php
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              dobedobedoh Andrew Lyons
              Reporter:
              rbon Ray Bon
              Participants:
              Component watchers:
              Andrew Lyons, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Matteo Scaramuccia, Andrew Lyons, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated: