HomePhabricator

PostgreSQL: Fix magic-value code for AbuseFilter

Authored by Jjanes.

Description

PostgreSQL: Fix magic-value code for AbuseFilter

When importing filters, the code is using the magic value
of 'new' for the af_id field, which is of type bigint, to
indicate a not-yet-inserted record.

In MySQL, comparing a bigint to 'new' is legal but always false,
while in PostgreSQL it is illegal, and led to errors when checking
if the filter is hidden.

Fix this by adding special-case code to filterHidden so that it
always returns false for 'new' records. In PostgreSQL this fixes
the error, and in MySQL it avoids a pointless trip to the database.

Should be back patched to 1.23 and 1.24

Bug: T89514
Change-Id: Ib4b5585ac9889a1760ec930c555e7809a424538e

Details

Committed
hooMar 25 2015, 10:07 PM
Parents
rEABFaaf02aae643a: Localisation updates from https://translatewiki.net.
Branches
Unknown
Tags
Unknown
ChangeId
Ib4b5585ac9889a1760ec930c555e7809a424538e