Last modified: 2014-04-22 19:38:48 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 T63318, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 61318 - Postgres installation fails (null value in column "rc_cur_time" violates not-null constraint)
Postgres installation fails (null value in column "rc_cur_time" violates not-...
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Installer (Other open bugs)
1.23.0
All All
: High normal (vote)
: 1.23.0 release
Assigned To: Jeff Janes
:
Depends on:
Blocks: postgres
  Show dependency treegraph
 
Reported: 2014-02-13 16:14 UTC by Ocean behind ears
Modified: 2014-04-22 19:38 UTC (History)
6 users (show)

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


Attachments
proposed and tested fix (1.86 KB, patch)
2014-04-17 04:37 UTC, Jeff Janes
Details

Description Ocean behind ears 2014-02-13 16:14:39 UTC
While trying to install Mediawiki through Postgres the installer constantly failed, throwing the error:
Could not insert main page: A database error has occurred. Did you forget to run maintenance/update.php after upgrading? See: https://www.mediawiki.org/wiki/Manual:Upgrading#Run_the_update_script Query: INSERT INTO "recentchanges" (rc_timestamp,rc_namespace,rc_title,rc_type,rc_source,rc_minor,rc_cur_id,rc_user,rc_user_text,rc_comment,rc_this_oldid,rc_last_oldid,rc_bot,rc_ip,rc_patrolled,rc_new,rc_old_len,rc_new_len,rc_deleted,rc_logid,rc_log_type,rc_log_action,rc_params,rc_id) VALUES ('2014-02-13 16:13:55 GMT','0','Main_Page','1','mw.new','0','2','0','MediaWiki default','','2','0','0','10.0.2.2','0','1','0','524','0','0',NULL,'','','2') Function: RecentChange::save Error: 23502 ERROR: null value in column "rc_cur_time" violates not-null constraint
even though databases were cleared out.
Comment 1 Ocean behind ears 2014-02-13 16:19:47 UTC
This was found using postgres 9.1.11
Comment 2 Ocean behind ears 2014-02-13 17:42:30 UTC
Git bisect found commit 974562aee92a78be82cf8e1416ef44648bb7dbb7 to be the cause of the bug
Comment 3 Jeff Janes 2014-04-17 04:37:15 UTC
Created attachment 15127 [details]
proposed and tested fix

For mysql this column is not null but now defaults to some magic value which means the same as NULL.  For PostgreSQL, I'd recommend just dropping the NOT NULL constraint and letting new entries default to null.  This patch does that for both new installs and upgrades.
Comment 4 Andre Klapper 2014-04-17 10:07:38 UTC
Hi! Thanks for your patch!

You are welcome to use Developer access
  https://www.mediawiki.org/wiki/Developer_access
to submit this as a Git branch directly into Gerrit:
  https://www.mediawiki.org/wiki/Git/Tutorial

Putting your branch in Git makes it easier to review it quickly. If you don't want to set up Git/Gerrit, you can also use https://tools.wmflabs.org/gerrit-patch-uploader/
Thanks again! We appreciate your contribution.
Comment 5 Gerrit Notification Bot 2014-04-20 22:27:33 UTC
Change 127586 had a related patch set uploaded by Jjanes:
PostgreSQL: Allow rc_cur_time field to be null.

https://gerrit.wikimedia.org/r/127586
Comment 6 Gerrit Notification Bot 2014-04-22 16:57:52 UTC
Change 128946 had a related patch set uploaded by Jjanes:
PostgreSQL: Allow rc_cur_time field to be null.

https://gerrit.wikimedia.org/r/128946
Comment 7 Gerrit Notification Bot 2014-04-22 18:59:38 UTC
Change 128946 merged by jenkins-bot:
PostgreSQL: Allow rc_cur_time field to be null.

https://gerrit.wikimedia.org/r/128946
Comment 8 Gerrit Notification Bot 2014-04-22 19:36:18 UTC
Change 127586 merged by jenkins-bot:
PostgreSQL: Allow rc_cur_time field to be null.

https://gerrit.wikimedia.org/r/127586
Comment 9 Bartosz Dziewoński 2014-04-22 19:38:48 UTC
Merged into master and backported to 1.23 release.

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


Navigation
Links