Last modified: 2012-08-04 20:48:42 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 T14715, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 12715 - Missing Database Schema update for protected_titles (Was: Protecting Non-Existant Page causes Internal Error)
Missing Database Schema update for protected_titles (Was: Protecting Non-Exis...
Status: RESOLVED INVALID
Product: MediaWiki
Classification: Unclassified
Database (Other open bugs)
1.12.x
All All
: Normal minor (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks: postgres
  Show dependency treegraph
 
Reported: 2008-01-20 19:45 UTC by OverlordQ
Modified: 2012-08-04 20:48 UTC (History)
1 user (show)

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


Attachments

Description OverlordQ 2008-01-20 19:45:12 UTC
When trying to protect a non-existent page mediawiki throws an error:

===
Notice: Undefined index: edit in /home/wiki/includes/ProtectionForm.php on line 189

Warning: pg_query() [function.pg-query]: Query failed: ERROR: column "pt_user" of relation "protected_titles" does not exist LINE 1: ...ce,pt_title,pt_create_perm,pt_timestamp,pt_expiry,pt_user,pt... ^ in /home/wiki/includes/DatabasePostgres.php on line 542
===

Further Exception handling:

===
A database error has occurred Query: INSERT INTO protected_titles (pt_namespace,pt_title,pt_create_perm,pt_timestamp,pt_expiry,pt_user,pt_reason) VALUES ('0','Doesnt_Exist','sysop','2008-01-20 19:34:49 GMT','infinity','1','') Function: Title::updateTitleProtection Error: 1 ERROR: column "pt_user" of relation "protected_titles" does not exist LINE 1: ...ce,pt_title,pt_create_perm,pt_timestamp,pt_expiry,pt_user,pt... ^

Backtrace:

#0 /home/wiki/includes/Database.php(799): DatabasePostgres->reportQueryError('ERROR: column ...', 1, 'INSERT INTO pro...', 'Title::updateTi...', false)
#1 /home/wiki/includes/DatabasePostgres.php(873): Database->query('INSERT INTO pro...', 'Title::updateTi...')
#2 /home/wiki/includes/Title.php(1309): DatabasePostgres->replace('protected_title...', Array, Array, 'Title::updateTi...')
#3 /home/wiki/includes/ProtectionForm.php(198): Title->updateTitleProtection('sysop', '', 'infinity')
#4 /home/wiki/includes/ProtectionForm.php(84): ProtectionForm->save()
#5 /home/wiki/includes/Article.php(1680): ProtectionForm->execute()
#6 /home/wiki/includes/Wiki.php(404): Article->protect()
#7 /home/wiki/includes/Wiki.php(48): MediaWiki->performAction(Object(StubObject), Object(Article), Object(Title), Object(User), Object(WebRequest))
#8 /home/wiki/index.php(89): MediaWiki->initialize(Object(Title), Object(StubObject), Object(User), Object(WebRequest))
#9 {main}
===

This might be related to not having a correct Database, and if so then this would depend on bug 12714
Comment 1 OverlordQ 2008-01-20 20:12:04 UTC
grep'ing through the patch files there isn't a updater that alters the protected_titles table to add in the pt_user column, the only script is one to create the table.
Comment 2 OverlordQ 2008-01-21 20:14:42 UTC
Between revision 28541 and revision 28574, it appears the table for protected_titles was changed:

==
-  pt_by          INTEGER     NOT NULL,
-  pt_reason      TEXT,
+  pt_user        INTEGER         NULL  REFERENCES mwuser(user_id) ON DELETE SET NULL,
+  pt_reason      TEXT            NULL,
==

If people had installed version between 28541 and 28574, their table would be incorrect and would throw the above error as the updater only checks to see if the table exists and not if it has the correct schema.

So new SVN installs or people updating from 1.11 should not be affected. I'll change this to minor, correct me if I'm wrong.
Comment 3 Aaron Schulz 2008-01-21 20:21:25 UTC
(In reply to comment #2)
> Between revision 28541 and revision 28574, it appears the table for
> protected_titles was changed:
> 
> ==
> -  pt_by          INTEGER     NOT NULL,
> -  pt_reason      TEXT,
> +  pt_user        INTEGER         NULL  REFERENCES mwuser(user_id) ON DELETE
> SET NULL,
> +  pt_reason      TEXT            NULL,
> ==
> 
> If people had installed version between 28541 and 28574, their table would be
> incorrect and would throw the above error as the updater only checks to see if
> the table exists and not if it has the correct schema.
> 
> So new SVN installs or people updating from 1.11 should not be affected. I'll
> change this to minor, correct me if I'm wrong.
> 

OK, this is a matter of just fixing it on individual installs that used unsupported developmental trunk versions of the software. Works fine now.

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


Navigation
Links