https://bugzilla.wikimedia.org/show_bug.cgi?id=40757
Web browser: ---
Bug #: 40757
Summary: Joins fail with PostgreSQL
Product: MediaWiki extensions
Version: master
Platform: All
OS/Version: All
Status: NEW
Severity: blocker
Priority: Unprioritized
Component: AbuseFilter
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected]
Classification: Unclassified
Mobile Platform: ---
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.
--
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l