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

question_has_capability_on - memory bloat

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.1, 2.2, 2.3
    • 2.1.5, 2.2.2
    • Questions
    • MOODLE_21_STABLE, MOODLE_22_STABLE, MOODLE_23_STABLE
    • MOODLE_21_STABLE, MOODLE_22_STABLE
    • MDL-31876-question_has_capability_on-memory-bloat
    • Hide

      Go into the question bank, and perform a number of operations, and make sure there are no notices or other PHP errors.

      When I say a number of operations, I mean:

      1. Create a question,
      2. Edit a question,
      3. Move some questions to another category,
      4. Create a category,
      5. Edit a category,
      6. Export some questions,
      7. Import some questions.

      If you want to make it a really stringent test, create a role with a restricted set of question permissions (e.g. use, useall, view, viewall and editmine) and then repeat the tests you can with the custom role.

      Show
      Go into the question bank, and perform a number of operations, and make sure there are no notices or other PHP errors. When I say a number of operations, I mean: Create a question, Edit a question, Move some questions to another category, Create a category, Edit a category, Export some questions, Import some questions. If you want to make it a really stringent test, create a role with a restricted set of question permissions (e.g. use, useall, view, viewall and editmine) and then repeat the tests you can with the custom role.

    Description

      The funciton "question_has_capability_on", has a third parameter called '$cachecat' when used the function fetchs in one query all of the questions in a category.

      The problem is that this query is fetching all columns in the 'question' table, while in the same funciton the query to handle a single record is fetching only 'id,parent,createdby'.

      P.S. In the case I encountered this php itself wasn't the fault, but the db engine (mysqli) was temporarily requiring a huge amount of memory (fetching ~60000 questions took more then 256M).
      but I believe this has to be fixed anyhow.

      Attachments

        Activity

          People

            dhg David Hai Gootvilig
            dhg David Hai Gootvilig
            Tim Hunt Tim Hunt
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Rajesh Taneja Rajesh Taneja
            Safat Shahin, Tim Hunt, Amaia Anabitarte, Bas Brands, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Kevin Percy, Laurent David, Mathew May, Mihail Geshoski, Sabina Abellan, Sara Arjona (@sarjona), Shamim Rezaie
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              12/Mar/12