Last modified: 2014-11-14 23:28:06 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 T74834, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 72834 - PostgreSQL install fails on INSERT IGNORE INTO "mediawiki"."updatelog" in update_keys.sql
PostgreSQL install fails on INSERT IGNORE INTO "mediawiki"."updatelog" in upd...
Status: PATCH_TO_REVIEW
Product: MediaWiki
Classification: Unclassified
Database (Other open bugs)
1.25-git
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
: 73434 (view as bug list)
Depends on:
Blocks: postgres 73174
  Show dependency treegraph
 
Reported: 2014-10-31 20:27 UTC by Jeff Janes
Modified: 2014-11-14 23:28 UTC (History)
9 users (show)

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


Attachments

Description Jeff Janes 2014-10-31 20:27:59 UTC
This the PostgreSQL equivalent to bug 71040 for Oracle.
Comment 1 Gerrit Notification Bot 2014-10-31 20:28:35 UTC
Change 170395 had a related patch set uploaded by Jjanes:
PostgreSQL: Port update-keys.sql to PostgreSQL

https://gerrit.wikimedia.org/r/170395
Comment 2 Marcin Cieślak 2014-11-07 21:42:43 UTC
What error message are you getting with PostgreSQL (Oracle needs "FROM DUAL" after "SELECT"...)
Comment 3 Marcin Cieślak 2014-11-07 22:06:33 UTC
Ok, I managed to reproduce it finally:

Query: INSERT IGNORE INTO "mediawiki"."updatelog"
 SELECT 'filearchive-fa_major_mime-patch-fa_major_mime-chemical.sql' AS ul_key, null as ul_value
 UNION SELECT 'image-img_major_mime-patch-img_major_mime-chemical.sql', null
 UNION SELECT 'oldimage-oi_major_mime-patch-oi_major_mime-chemical.sql', null
 UNION SELECT 'user_groups-ug_group-patch-ug_group-length-increase-255.sql', null
 UNION SELECT 'user_former_groups-ufg_group-patch-ufg_group-length-increase-255.sql', null
 UNION SELECT 'user_properties-up_property-patch-up_property.sql', null

Function: DatabaseBase::sourceFile( /usr/home/saper/public_html/pg/w/maintenance/update-keys.sql )
Error: 42601 ERROR:  syntax error at or near "IGNORE"
LINE 1: ...l/pg/w/maintenance/update-keys.sql ) 127.0.0.1 */ IGNORE INT...
Comment 4 Jeff Janes 2014-11-07 22:09:21 UTC
The IGNORE in "INSERT IGNORE" from the default version of the file (for MySQL and sqlite) is not valid syntax in PostgreSQL.   

ERROR:  syntax error at or near "IGNORE" at character 115
STATEMENT:  INSERT /* DatabaseBase::sourceFile( /usr/local/apache2/htdocs/wiki_git/maintenance/update-keys.sql ) 127.0.0.1 */ IGNORE INTO "public"."updatelog"
...

The fix for the bug against Oracle claims the IGNORE is not needed because this file is only run against fresh installs so there cannot be primary key violations.
Comment 5 Marcin Cieślak 2014-11-07 22:27:51 UTC
This bug was caused by change d315c3bdb34bce9327a494e9edf5fe3774b81d7b which added INSERT IGNORE. 

So there are two issues:

1) Missing "FROM tablename" for Oracle (we can add "FROM revision" just for sanity)

2) Updating updatelog table by hand in a funny way.

We have already "LoggedUpdateMaintenance" to deal with those....
Comment 6 Tim Landscheidt 2014-11-12 03:12:01 UTC
Do we want to wait for the issues from Gerrit change #135756 to get fixed for all databases?  I'd rather have Jeff's patch merged now as this bug is a blocker for PostgreSQL and leave the clean-up for later as that is a (minor) pain point for all databases.
Comment 7 Andre Klapper 2014-11-14 23:28:06 UTC
*** Bug 73434 has been marked as a duplicate of this bug. ***

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


Navigation
Links