Last modified: 2012-08-04 20:48:47 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 14989 - batchAntiSpoof.php fails with Postgres
batchAntiSpoof.php fails with Postgres
Product: MediaWiki extensions
Classification: Unclassified
AntiSpoof (Other open bugs)
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: ---

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

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

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

#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.