Page MenuHomePhabricator

MySQL Specific SQL in SpecialRecentchanges
Closed, ResolvedPublic

Description

Author: overlordq

Description:
The SQL starting on line 162:

$sql2 = "SELECT * FROM $recentchanges $forceclause".

($uid ? "LEFT OUTER JOIN $watchlist ON wl_user={$uid} AND wl_title=rc_title AND wl_namespace=rc_namespace " : "") .
"WHERE rc_timestamp >= '{$cutoff}' {$hidem} " .
"ORDER BY rc_timestamp DESC";

Does not work in current versions of PostgreSQL and will not work in future versions.


Version: 1.12.x
Severity: normal

Details

Reference
bz12910

Related Objects

View Standalone Graph
This task is connected to more than 200 other tasks. Only direct parents and subtasks are shown here. Use View Standalone Graph to show more of the graph.
StatusSubtypeAssignedTask
InvalidNone
ResolvedNone
ResolvedNone

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:05 PM
bzimport set Reference to bz12910.
bzimport added a subscriber: Unknown Object (MLST).

overlordq wrote:

This is due to the fact that in the recentchanges table rc_bot is a character(1) field, and you're trying to compare it to a 1 or a 0.

This can either be rectified by

A) Using an actual integer datatype for the table in PG
-or-
B) Using a cast

Without digging deeper, option A would require no code changes here, but might elsewhere, while option B would require changing code.

You're using a 1-character text string for boolean fields? Ok, you guys can stop making fun of us for our funny timestamp format now. ;)

overlordq wrote:

I believe this was fixed in r30800 and Greg just forgot to close this bug.

(In reply to comment #2)

You're using a 1-character text string for boolean fields? Ok, you guys can
stop making fun of us for our funny timestamp format now. ;)

We only did that because you guys don't have a real boolean field, and assign 1 and 0 to your pseudo-booleans in the code. :) No worries, PG is using smallint everywhere mysql is using bool/tinyint now, so everyone should be happy.

Jdforrester-WMF subscribed.

Migrating from the old tracking task to a tag for PostgreSQL-related tasks.