[Mediawiki-l] 1.4.12 -> 1.5.2 update failing

David J. Biesack David.Biesack at sas.com
Fri Dec 2 21:43:15 UTC 2005


I am getting a failure trying to upgrade from 1.4.12 to 1.5.2. I have problems running update.php :

   from update.php:

   ...converting from cur/old to page/revision/text DB structure.
   1133553182......checking for duplicate entries.
   1133553182......Creating tables.
   1133553182......Locking tables.
   1133553182......maxold is 6155
   1133553182......Moving text from cur.
   1133553182......Setting up revision table.
   1133553182......Setting up page table.
   1133553182......Unlocking tables.
   1133553182......Renaming old.
   1133553182...done.
   revision timestamp indexes already up to 2005-03-13
   Adding rev_text_id field... Query "UPDATE revision SET rev_text_id=rev_id" failed with error code "".

Note that my page and revision tables exist at this point but both are empty:

    mysql> show tables;
    +--------------------------+
    | Tables_in_saspediadb_dev |
    +--------------------------+
    | archive                  |
    | blobs                    |
    | brokenlinks              |
    | categorylinks            |
    | cur                      |
    | hitcounter               |
    | image                    |
    | imagelinks               |
    | interwiki                |
    | ipblocks                 |
    | links                    |
    | linkscc                  |
    | logging                  |
    | math                     |
    | objectcache              |
    | oldimage                 |
    | page                     |
    | querycache               |
    | recentchanges            |
    | revision                 |
    | searchindex              |
    | site_stats               |
    | text                     |
    | trackbacks               |
    | transcache               |
    | user                     |
    | user_newtalk             |
    | user_rights              |
    | validate                 |
    | watchlist                |
    +--------------------------+
    30 rows in set (0.00 sec)

    mysql> select * from page;
    Empty set (0.00 sec)

    mysql> select * from revision;
    Empty set (0.00 sec)

I have narrowed this down to execution of the following query from updaters.inc near line 390:

        $wgDatabase->query( "INSERT INTO $revision (rev_id, rev_page, rev_comment, rev_user, rev_user_text, rev_timestamp,
                                rev_minor_edit)
                        SELECT old_id, cur_id, old_comment, old_user, old_user_text,
                                old_timestamp, old_minor_edit
                        FROM $old,$cur WHERE old_namespace=cur_namespace AND old_title=cur_title", $fname );

If I run this query directly via mysql

INSERT INTO revision (rev_id, rev_page, rev_comment, rev_user, rev_user_text, rev_timestamp,
                                rev_minor_edit)
                        SELECT old_id, cur_id, old_comment, old_user, old_user_text,
                                old_timestamp, old_minor_edit
                        FROM old,cur WHERE old_namespace=cur_namespace AND old_title=cur_title;

I get the following error:

  ERROR 1062 (23000): Duplicate entry '5-1' for key 1

How do I correct this so I can convert from 1.4.12 to 1.5?

(Possibly relevant: MySQL bug http://bugs.mysql.com/bug.php?id=12695 but I don't know how it may apply)

We're running (Special:Version) :

    MediaWiki (http://wikipedia.sf.net/): 1.4.12 
    PHP (http://www.php.net/): 4.4.1 (apache) 
    MySQL (http://www.mysql.com/): 4.1.7-standard-log

here is what update.php showed before trying to convert the tables:

   # php update.php
   X-Powered-By: PHP/4.1.2
   Content-type: text/html

   Going to run database updates for saspediadb_dev
   Depending on the size of your database this may take a while!
   Abort with control-c in the next five seconds... 5 4 3 2 1 0
   ...hitcounter table already exists.
   ...querycache table already exists.
   ...objectcache table already exists.
   ...categorylinks table already exists.
   ...logging table already exists.
   Creating validate table...ok
   ...user_newtalk table already exists.
   Creating transcache table...ok
   Creating trackbacks table...ok
   ...have ipb_id field in ipblocks table.
   ...have ipb_expiry field in ipblocks table.
   ...have rc_type field in recentchanges table.
   ...have rc_ip field in recentchanges table.
   ...have rc_id field in recentchanges table.
   ...have rc_patrolled field in recentchanges table.
   ...have user_real_name field in user table.
   ...have user_token field in user table.
   Adding user_email_token field to table user...ok
   ...have log_params field in logging table.
   Adding ar_rev_id field to table archive...ok
   Adding ar_text_id field to table archive...ok
   ...page table does not exist, skipping new field patch
   ...revision table does not exist, skipping new field patch
   Adding img_width field to table image...ok
   Adding img_metadata field to table image...ok
   Adding img_media_type field to table image...ok
   ...have val_ip field in validate table.
   ...have ss_total_pages field in site_stats table.
   Adding iw_trans field to table interwiki...ok
   ...already have interwiki table
   ...indexes seem up to 20031107 standards
   Converting links table to ID-ID...
   Schema already converted
   ...image primary key already set.
   The watchlist table is already set up for email notification.
   User table contains old email authentication field. Dropping... ok
   Logging table has correct title encoding.

Thanks for any assistance.

-- 
David J. Biesack     SAS Institute Inc.
(919) 531-7771       SAS Campus Drive
http://www.sas.com   Cary, NC 27513




More information about the MediaWiki-l mailing list