From: skodak Date: Wed, 19 Sep 2007 17:40:20 +0000 (+0000) Subject: MDL-11347 fixed context c in update which Tim's pg did not like much X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=554bda05389777425d1d5ba9940dc1c468532dfb;p=moodle.git MDL-11347 fixed context c in update which Tim's pg did not like much --- diff --git a/lib/accesslib.php b/lib/accesslib.php index 9e33a00530..f51a177a76 100755 --- a/lib/accesslib.php +++ b/lib/accesslib.php @@ -4451,11 +4451,11 @@ function build_context_path($force=false) { $emptyclause = ''; } - $upathsql = "UPDATE {$CFG->prefix}context c - SET path = COALESCE((SELECT ct.path FROM {$CFG->prefix}$temptable ct WHERE c.id=ct.id), c.path)"; + $upathsql = "UPDATE {$CFG->prefix}context + SET path = COALESCE((SELECT ct.path FROM {$CFG->prefix}$temptable ct WHERE {$CFG->prefix}context.id=ct.id), {$CFG->prefix}context.path)"; - $udepthsql = "UPDATE {$CFG->prefix}context c - SET depth = COALESCE((SELECT ct.depth FROM {$CFG->prefix}$temptable ct WHERE c.id=ct.id), c.depth)"; + $udepthsql = "UPDATE {$CFG->prefix}context + SET depth = COALESCE((SELECT ct.depth FROM {$CFG->prefix}$temptable ct WHERE {$CFG->prefix}context.id=ct.id), {$CFG->prefix}context.depth)"; /* * TODO: following code complains: Can't reopen table: 'ct' when using temporary teables, why?