Last modified: 2012-08-04 20:48:47 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 T16989, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 14989 - batchAntiSpoof.php fails with Postgres
batchAntiSpoof.php fails with Postgres
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
AntiSpoof (Other open bugs)
unspecified
All All
: Normal minor (vote)
: ---
Assigned To: Nobody - You can work on this!
: patch
Depends on:
Blocks: postgres
  Show dependency treegraph
 
Reported: 2008-07-30 22:59 UTC by OverlordQ
Modified: 2012-08-04 20:48 UTC (History)
1 user (show)

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


Attachments
Fixer-upper (704 bytes, patch)
2008-07-30 22:59 UTC, OverlordQ
Details

Description OverlordQ 2008-07-30 22:59:39 UTC
Created attachment 5108 [details]
Fixer-upper

Don't know when the problem cropped up but it might have been when the split to add in the PG patch happened.  Anyways:

===
# php batchAntiSpoof.php
DB connection error: Unknown database 'wikidb' (localhost)
===

Probably because it's using new Database, instead of DatabasePostgres. 
So lets fix that up and run it again:

==
Warning: pg_query(): Query failed: ERROR:  argument of WHERE must be type boolean, not type integer in /var/www/w/includes/db/DatabasePostgres.php on line 549
A database error has occurred
Query: SELECT  user_name  FROM mwuser  WHERE 1
Function: batchAntiSpoof.php
Error: 1 ERROR:  argument of WHERE must be type boolean, not type integer

Backtrace:
#0 /var/www/w/includes/db/Database.php(561): DatabasePostgres->reportQueryError('ERROR:  argumen...', 1, 'SELECT  user_na...', 'batchAntiSpoof....', false)
#1 /var/www/w/includes/db/Database.php(969): Database->query('SELECT  user_na...', 'batchAntiSpoof....')
#2 /var/www/w/extensions/AntiSpoof/batchAntiSpoof.php(13): Database->select('user', 'user_name', '1', 'batchAntiSpoof....')
#3 {main}
==

Well at least it ran, is there a purpose to WHERE 1 when it is the only where? I'm not to hot with MySQL quirks.

So, lets fix that and run again:

==
# php batchAntiSpoof.php
wikidb 1
wikidb 3 done.
==

Dont know if this will break MySQL or not, no place to test.
Comment 1 Greg Sabino Mullane 2008-07-31 16:49:13 UTC
Looks good to me, committed in 38309. Also changed dbr to dbw.

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


Navigation
Links