Last modified: 2012-08-04 20:49:04 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 19445 - PostgreSQL FK constraint oldimage_oi_name_fkey_cascade needs "ON UPDATE CASCADE"
PostgreSQL FK constraint oldimage_oi_name_fkey_cascade needs "ON UPDATE CASCADE"
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Database (Other open bugs)
1.16.x
All All
: Normal normal (vote)
: ---
Assigned To: Greg Sabino Mullane
: patch
Depends on:
Blocks: postgres
  Show dependency treegraph
 
Reported: 2009-06-30 16:39 UTC by Robert Fleming
Modified: 2012-08-04 20:49 UTC (History)
0 users

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


Attachments
"svn diff" that adds "ON UPDATE CASCADE" (769 bytes, patch)
2009-06-30 16:39 UTC, Robert Fleming
Details

Description Robert Fleming 2009-06-30 16:39:11 UTC
Created attachment 6285 [details]
"svn diff" that adds "ON UPDATE CASCADE"

It seems to me that the foreign-key constraint "oldimage_oi_name_fkey_cascade" on table "oldimage" needs to have "ON UPDATE CASCADE" in addition to "ON DELETE CASCADE".  Without it, "Move" actions on images break when the image to be moved has old revisions.

To fix current installations:

BEGIN;
ALTER TABLE oldimage DROP CONSTRAINT oldimage_oi_name_fkey_cascade;
ALTER TABLE oldimage ADD  CONSTRAINT oldimage_oi_name_fkey_cascade
  FOREIGN KEY (oi_name) REFERENCES image(img_name)
  ON DELETE CASCADE
  ON UPDATE CASCADE;
COMMIT;

Without this, the failure leaves the database and file repository in an inconsistent state.  I think that this could be fixed by using transactions.
Comment 1 Greg Sabino Mullane 2009-07-20 01:56:38 UTC
Thanks for the report - fixed in r53510

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


Navigation
Links