Search returns no result. Postgresql logs contains :

ERROR: operator does not exist: integer || integer at character 153

I trace this back in node.module on line 1238 :

$ranking[] = '%d * POW(2, (GREATEST(MAX(n.created), MAX(n.changed), MAX(c.last_comment_timestamp) || 1) - %d) * 6.43e-8)';

I suggest :

if($GLOBALS['db_type']=='pgsql') {
$ranking[] = '%d * POW(2, (GREATEST(MAX(n.created), MAX(n.changed), MAX(c.last_comment_timestamp) # 1) - %d) * 6.43e-8)';
} else {
$ranking[] = '%d * POW(2, (GREATEST(MAX(n.created), MAX(n.changed), MAX(c.last_comment_timestamp) || 1) - %d) * 6.43e-8)';
}

Comments

rbroberts’s picture

StatusFileSize
new829 bytes

I'm not sure what the oldest version of MySQL is that has to be supported, but MySQL and PostgreSQL both can use the standard COALESCE function instead of the "max(...) || 1" syntax. Attached is a patch that does that and fixes the search problem on my site.

damien tournoud’s picture

Status: Active » Closed (duplicate)

See [#488166}.

rbroberts’s picture

Status: Closed (duplicate) » Needs review
StatusFileSize
new829 bytes

Changed status and rerolled patch with -w switch.

damien tournoud’s picture

Status: Needs review » Closed (duplicate)