Page MenuHomePhabricator

parserTests.php doesn't run on PostgreSQL
Closed, ResolvedPublic

Description

The temporary table creation is currently MySQL-specific.


Version: 1.12.x
Severity: normal

Details

Reference
bz585

Related Objects

View Standalone Graph
This task is connected to more than 200 other tasks. Only direct parents and subtasks are shown here. Use View Standalone Graph to show more of the graph.
StatusSubtypeAssignedTask
InvalidNone
ResolvedNone

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 6:56 PM
bzimport set Reference to bz585.
bzimport added a subscriber: Unknown Object (MLST).

wmahan_04 wrote:

Should be fixed now, but I haven't tested it since I don't have PostgreSQL
installed.

PHP Warning: pg_query(): Query failed: ERROR: syntax error at or near "LIKE"
at character 39 in /var/www/html/gres/includes/DatabasePostgreSQL.php on line 99

Warning: pg_query(): Query failed: ERROR: syntax error at or near "LIKE" at
character 39 in /var/www/html/gres/includes/DatabasePostgreSQL.php on line 99
A database error has occurred
Query: CREATE TEMPORARY TABLE parsertestuser LIKE user
Function:
Error: 1 ERROR: syntax error at or near "LIKE" at character 39

Backtrace:
DatabasePostgreSQL.php line 415 calls wfDebugDieBacktrace()
Database.php line 297 calls DatabasePostgreSQL::reportQueryError()
parserTests.php line 316 calls DatabasePostgreSQL::query()
parserTests.php line 280 calls ParserTest::setupDatabase()
parserTests.php line 483 calls ParserTest::setupGlobals()
parserTests.php line 118 calls ParserTest::addArticle()
parserTests.php line 505 calls ParserTest::runTestsFromFile()

With a couple more tweaks it's running now.

overlordq wrote:

Broken again in r28547:

This is MediaWiki version 1.12alpha (r28547).

Reading tests from "maintenance/parserTests.txt"...
Warning: pg_query(): Query failed: ERROR: relation "searchindex" does not exist in /home/wiki/includes/DatabasePostgres.php on line 542
A database error has occurred
Query: CREATE TEMPORARY TABLE searchindex (LIKE searchindex INCLUDING DEFAULTS)
Function:
Error: 1 ERROR: relation "searchindex" does not exist

Backtrace:
#0 /home/wiki/includes/Database.php(795): DatabasePostgres->reportQueryError('ERROR: relatio...', 1, 'CREATE TEMPORAR...', '', false)
#1 /home/wiki/maintenance/parserTests.inc(476): Database->query('CREATE TEMPORAR...')
#2 /home/wiki/maintenance/parserTests.inc(417): ParserTest->setupDatabase()
#3 /home/wiki/maintenance/parserTests.inc(740): ParserTest->setupGlobals()
#4 /home/wiki/maintenance/parserTests.inc(166): ParserTest->addArticle('Main Page', 'blah blah', 34)
#5 /home/wiki/maintenance/parserTests.inc(130): ParserTest->runFile('/home/wiki/main...')
#6 /home/wiki/maintenance/parserTests.php(68): ParserTest->runTestsFromFiles(Array)

#7 {main}

AFAIK, according to 'maintenance/postgres/compare_schemas.pl' : "searchindex ## We use tsearch2 directly on the page table instead"

Fixed in r28627, thanks for the report.

Jdforrester-WMF subscribed.

Migrating from the old tracking task to a tag for PostgreSQL-related tasks.