Skip to content

Commit

Permalink
MDL-17492 Reset flag did not work in PostgreSQL. Merged from 1.9
Browse files Browse the repository at this point in the history
Postgres does not seem to support table alias in UPDATE statement.
Therefore the SQL like
 UPDATE mdl_tag tg SET tg.flag = 0, tg.timemodified = 1236027984 WHERE tg.id IN (4)
ends with an ERROR: column "tg" of relation "mdl_tag" does not exist
The fix is quite easy - just do not use table alias as it makes no sense
here anyway.
  • Loading branch information
mudrd8mz committed Mar 2, 2009
1 parent 932bba0 commit cef5304
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tag/lib.php
Expand Up @@ -1026,7 +1026,7 @@ function tag_unset_flag($tagids) {
$tagids = implode(',', $tagids);
}
$timemodified = time();
return $DB->execute("UPDATE {tag} tg SET tg.flag = 0, tg.timemodified = ? WHERE tg.id IN ($tagids)", array($timemodified));
return $DB->execute("UPDATE {tag} SET flag = 0, timemodified = ? WHERE id IN ($tagids)", array($timemodified));
}

?>

0 comments on commit cef5304

Please sign in to comment.