Last modified: 2009-07-21 03:31:49 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 14990 - r37313 broke parser tests for alternative databases.
r37313 broke parser tests for alternative databases.
Product: MediaWiki
Classification: Unclassified
Maintenance scripts (Other open bugs)
All All
: Normal enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
: patch
: 14991 (view as bug list)
Depends on:
Blocks: postgres
  Show dependency treegraph
Reported: 2008-07-31 00:59 UTC by OverlordQ
Modified: 2009-07-21 03:31 UTC (History)
4 users (show)

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

Horrible patch (2.61 KB, patch)
2008-07-31 00:59 UTC, OverlordQ
parser tests patch (1016 bytes, patch)
2009-03-15 13:39 UTC, OverlordQ
re-upping patch last one broken? (669 bytes, patch)
2009-03-15 14:09 UTC, OverlordQ

Description OverlordQ 2008-07-31 00:59:29 UTC
Created attachment 5110 [details]
Horrible patch

r37313 changed a bunch of stuff around but hard coded using backticks for delimiters which is (afaik) MySQL specific. So I created this rough patch.

It works on PG, untested on others.
Comment 1 Greg Sabino Mullane 2008-07-31 16:34:29 UTC
I found this problem too but it's more than just backticks - the script makes some hacks to table prefixes that just won't work on PG, at least without a lot of trouble (I tried). But removing the backticks would be a nice first step to getting it compatible again.
Comment 2 Greg Sabino Mullane 2008-07-31 16:36:39 UTC
Just looked at the patch, and I don't think we need to add specific table delimiters, we can just remove the backticks entirely. While they are needed if your table contains weird characters or MixedCase, everything in tables.sql is sane and standard, so the raw names should be fine, as far as I can tell.
Comment 3 Aryeh Gregor (not reading bugmail, please e-mail directly) 2008-07-31 17:08:39 UTC
The correct solution for the table delimiters is to use Database::tableName().  Due to the changing prefix, this is a little tricky, but I've done it in r38310.

It still probably will not work on pgsql, because pgsql appears not to support DB prefixes, judging by DatabasePostgres::tableName().  If pgsql doesn't *want* to support DB prefixes, we could add a $prefix argument to tableName() as an alternative solution.
Comment 4 OverlordQ 2008-08-01 00:25:12 UTC
PG shouldn't/doesn't use table prefixes, it uses schemas.


Query: DROP TABLE page
Error: 1 ERROR:  cannot drop table page because other objects depend on it
HINT:  Use DROP ... CASCADE to drop the dependent objects too.

The only real problem now is the supposed 'cleanup' from aborted runs. From the docs of both PG and MySQL they mention that temp tables are dropped at the end of the connection which should drop them after normal script termination or somebody hitting ctrl-c. 

Or I could be completely off-base here in assuming this is all done with one connection.

After changing the if on line 516 to include
$wgDBtype != 'postgres'

in the conditional, the tests run spitting out the usual parser test errors

Running test Bug 6200: paragraphs inside blockquotes (extra line break on open)... FAILED!
Running test Bug 6200: paragraphs inside blockquotes (extra line break on close)... FAILED!
Running test Bug 6200: paragraphs inside blockquotes (extra line break on open and close)... FAILED!
Passed 505 of 524 tests (96.37%)... 19 tests failed!
Comment 5 OverlordQ 2008-08-01 00:27:37 UTC
*** Bug 14991 has been marked as a duplicate of this bug. ***
Comment 6 Siebrand Mazeland 2008-08-11 07:46:25 UTC
So doing what will get this issue resolved? Any takers?
Comment 7 OverlordQ 2009-03-15 13:39:30 UTC
Created attachment 5932 [details]
parser tests patch

The workaround in bug r15892 

Warning: pg_query(): Query failed: ERROR:  relation "mwuser" already exists in /var/www/wiki/includes/db/DatabasePostgres.php on line 580
A database error has occurred
Error: 1 ERROR:  relation "mwuser" already exists

#0 /var/www/wiki/includes/db/Database.php(616): DatabasePostgres->reportQueryError('ERROR:  relatio...', 1, 'CREATE  TABLE m...', '', false)
#1 /var/www/wiki/maintenance/ Database->query('CREATE  TABLE m...')
#2 /var/www/wiki/maintenance/ ParserTest->setupDatabase()
#3 /var/www/wiki/maintenance/parserTests.php(73): ParserTest->runTestsFromFiles(Array)
#4 {main}

Since PG doesn't use table prefixes not putting TEMPORARY in the table creation statements will just try to create duplicates.

After fixing bug 17992, I made the following changes (will attach as patch), and parser tests work fine with PG.
Comment 8 OverlordQ 2009-03-15 13:40:22 UTC
Meant to say:

The workaround in bug r15892 similarly irritates this same issue.
Comment 9 OverlordQ 2009-03-15 14:09:10 UTC
Created attachment 5933 [details]
re-upping patch last one broken?

FWIW, I didn't test this with multi-servers && PG, YMMV.
Comment 10 Alexandre Emsenhuber [IAlex] 2009-03-16 21:07:30 UTC
Applied in r48455.
Comment 11 OverlordQ 2009-07-21 03:31:49 UTC
Closing as fixed, works now.

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