MDL-51836 mod_forum: Fix CASE statement breaking mssql & oracle.