Closed (fixed)
Project:
Subscriptions
Version:
7.x-1.1
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
2 Jan 2013 at 22:09 UTC
Updated:
27 Sep 2013 at 00:01 UTC
I found this line causing a problem when trying to use PostgreSQL in subscription_content.admin.inc. Basically, pgSQL doesn't like IF, would rather use CASE, in 7.x-1.1 it's line 145.
$query->addExpression('IF(s.send_updates = 0, n.created, n.changed)', 'latest_activity');
I replaced it with this and it seems to work better:
$query->addExpression('CASE WHEN s.send_updates = 0 THEN n.created
ELSE n.changed END', 'latest_activity');
This would be helpful to make this latest version PGSQL compatible.
Comments
Comment #1
salvisDo we have evidence that CASE works with MySQL, SQLite, etc., too?
Comment #2
dandaman commentedHmmm, I have not tested that. I may try to do so if I have time, but I guess maybe we should do it just for Postgres?
Comment #3
salvisWe do separate code paths if pgsql requires a less efficient implementation. But in general, we try to avoid this, because pgsql does not receive adequate testing.
Comment #4
salvisFixed in #2065531: Pages/Threads throws PDOException when core Comments module is disabled in the -dev version.