Details

    • Type: Sub-task
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.9
    • Fix Version/s: 1.9
    • Component/s: Roles / Access
    • Labels:
      None
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE

      Description

      build_context_path(true) is called from the upgrade to populate the context table.

      This sort of SQL breaks MySQL:

      (mysql): UPDATE mdl_context SET depth=it.pdepth+1, path=CONCAT(it.ppath,'/',id) FROM (SELECT c.id AS instanceid, pctx.path AS ppath, pctx.depth as pdepth FROM mdl_course c JOIN mdl_context pctx ON (c.category=pctx.instanceid AND pctx.contextlevel=40) WHERE c.id != 1) it WHERE contextlevel=50 AND mdl_context.instanceid=it.instanceid 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM (SELECT c.id AS instanceid, pctx.path AS ppath, ' at line 3

      adodb_mysql._execute(UPDATE mdl_context
      SET depth=it.pdepth+1, path=CONCAT(it.ppath,'/',id)
      FROM (SELECT c.id AS in..., false) % line 891, file: adodb.inc.php
      adodb_mysql.execute(UPDATE mdl_context
      SET depth=it.pdepth+1, path=CONCAT(it.ppath,'/',id)
      FROM (SELECT c.id AS in...) % line 89, file: dmllib.php
      execute_sql(UPDATE mdl_context
      SET depth=it.pdepth+1, path=CONCAT(it.ppath,'/',id)
      FROM (SELECT c.id AS in..., true) % line 4479, file: accesslib.php
      build_context_path(true) % line 8, file: test.php

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              martinlanghoff Martín Langhoff
              Reporter:
              dougiamas Martin Dougiamas
              Tester:
              Nobody
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
              Votes:
              2 Vote for this issue
              Watchers:
              8 Start watching this issue

                Dates

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