Last modified: 2014-06-30 13:43:44 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T42757, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 40757 - Joins on INTEGER and TEXT fail with PostgreSQL
Joins on INTEGER and TEXT fail with PostgreSQL
Status: NEW
Product: MediaWiki extensions
Classification: Unclassified
AbuseFilter (Other open bugs)
master
All All
: Normal blocker (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks: postgres
  Show dependency treegraph
 
Reported: 2012-10-04 02:32 UTC by Tim Landscheidt
Modified: 2014-06-30 13:43 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Tim Landscheidt 2012-10-04 02:32:44 UTC
SpecialAbuseLog does three "LEFT JOIN"s on "af_id=afl_filter" with af_id being INTEGER and afl_filter being TEXT.  These fail on PostgreSQL.

MySQL is very forgiving on such joins and for example matches 4711 with "4711 mysql sucks", but PostgreSQL does not.  For AbuseFilter, afl_filter seems to be either a reference to af_id or a reference to af_id with "global-" prepended, so there shouldn't be a need for complete imitation.  There is no explanation for this data model which must make JOINs even on MySQL very expensive and the needed storage unnecessarily huge.

Short term solution would be something like "wfGetDB( DB_MASTER )->getType() == 'mysql' ? 'af_id=afl_filter' : 'af_id::TEXT=afl_filter'" (not the other way round as that fails on non-convertable strings), proper way would be of course to split afl_filter into afl_filter_id and afl_filter_global or similar and let the database do what it's best at.
Comment 1 Quim Gil 2014-04-15 06:42:18 UTC
High + Blocker, but no progress since it was reported, a year and half ago?

Is anybody currently planning to work on this?
Comment 2 Andre Klapper 2014-06-30 13:43:44 UTC
Lowering priority - PostgreSQL support is maintained by volunteers and patches are welcome...

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links