Special:Import creates revisions with rev_user > 0 (unverified attribution of edits)
Open, HighPublic

Description

Originally reported at https://meta.wikimedia.org/w/index.php?title=Talk:Single_User_Login_finalisation_announcement&oldid=13592989#Renames_over_imported_edits.27_usernames

Steps to reproduce:
0) Get import rights on wiki A.

  1. Look for a page X on wiki B whose history contains a user named Y as an account on wiki A.
  2. Import X from B to A.

I. Expected: all revisions imported should have rev_user = 0.
II. Observed: several revisions have rev_user > 0, as they get assigned to the local User:Y's user_id.
III. Observed: such revisions are shown in [[Special:Contributions/Y]] and even moved to a new rev_user_text if Y is renamed, because MediaWiki no longer knows they were imported.

I noted the bug on https://www.mediawiki.org/w/index.php?title=Manual%3ARevision_table&action=historysubmit&type=revision&diff=1880709&oldid=1656147

Test case: https://test.wikipedia.org/w/index.php?title=Amin_Jensen&action=history , see result (here I actually overwrote an existing page, created on purpose, to verify the rev_parent_id; no idea whether it's correct that they all have the latest "indigenous" revision as parent):

MariaDB [testwiki_p]> select rev_id, rev_user_text, rev_user, rev_parent_id, rev_timestamp from revision where rev_page = 83779;
+--------+-------------------------+----------+---------------+----------------+
| rev_id | rev_user_text           | rev_user | rev_parent_id | rev_timestamp  |
+--------+-------------------------+----------+---------------+----------------+
| 241727 | 83.88.105.112           |        0 |        241726 | 20051117174704 |
| 241728 | Heelgrasper             |        0 |        241726 | 20051117175030 |
| 241729 | Palnatoke               |     1288 |        241726 | 20051118114155 |
| 241730 | Årstallet               |        0 |        241726 | 20051118114746 |
| 241731 | Årstallet               |        0 |        241726 | 20051118115424 |
| 241732 | 85.81.2.34              |        0 |        241726 | 20051121194633 |
| 241733 | Malene                  |        0 |        241726 | 20051127134638 |
| 241734 | Malene                  |        0 |        241726 | 20051127141042 |
| 241735 | 80.160.75.134           |        0 |        241726 | 20060328085615 |
| 241736 | Wegge~dewiki            |        0 |        241726 | 20060328085925 |
| 241737 | 195.215.170.201         |        0 |        241726 | 20060425084135 |
| 241738 | Scm                     |        0 |        241726 | 20060516205349 |
| 241739 | 62.61.132.51            |        0 |        241726 | 20060806202525 |
| 241740 | 62.61.132.51            |        0 |        241726 | 20060806210227 |
| 241741 | 62.61.132.51            |        0 |        241726 | 20060806210514 |
| 241742 | 80.160.75.134           |        0 |        241726 | 20060922082510 |
| 241743 | Barklund                |        0 |        241726 | 20060922082555 |
| 241744 | Mons1957                |        0 |        241726 | 20061125114608 |
| 241745 | 212.88.94.130           |        0 |        241726 | 20070115105443 |
| 241746 | Danielle~dewiki         |        0 |        241726 | 20070115110426 |
| 241747 | 87.49.153.152           |        0 |        241726 | 20070920140252 |
| 241748 | 87.49.153.152           |        0 |        241726 | 20070920140537 |
| 241749 | 195.249.208.150         |        0 |        241726 | 20070928084145 |
| 241750 | Pardy                   |        0 |        241726 | 20070928084436 |
| 241751 | 195.249.208.150         |        0 |        241726 | 20070928085636 |
| 241752 | Amjaabc                 |        0 |        241726 | 20070928104927 |
| 241753 | 90.185.35.245           |        0 |        241726 | 20071016122138 |
| 241754 | 90.185.35.245           |        0 |        241726 | 20071016122217 |
| 241755 | EPO                     |    12377 |        241726 | 20071016144502 |
| 241756 | 87.54.10.196            |        0 |        241726 | 20071210093550 |
| 241757 | UfB-LP                  |        0 |        241726 | 20080113232404 |
| 241758 | UfB-LP                  |        0 |        241726 | 20080113232427 |
| 241759 | 80.163.164.222          |        0 |        241726 | 20080113234108 |
| 241760 | 80.163.164.222          |        0 |        241726 | 20080113234354 |
| 241761 | 80.163.164.222          |        0 |        241726 | 20080113234424 |
| 241762 | 80.163.164.222          |        0 |        241726 | 20080113234547 |
| 241763 | Broadbeer               |    10638 |        241726 | 20080113234638 |
| 241764 | Broadbeer               |    10638 |        241726 | 20080113234834 |
| 241765 | Koalamissen             |        0 |        241726 | 20080120130713 |
| 241766 | EPO                     |    12377 |        241726 | 20080120133216 |
| 241767 | Koalamissen             |        0 |        241726 | 20080122155839 |
| 241768 | Jørgen~dewiki           |        0 |        241726 | 20080122160338 |
| 241769 | 85.24.43.114            |        0 |        241726 | 20080222190610 |
| 241770 | Amindjensen             |        0 |        241726 | 20080304075255 |
| 241771 | PenguinPower            |        0 |        241726 | 20080304075826 |
| 241772 | CactusWriter            |    12403 |        241726 | 20080501135751 |
| 241773 | CactusWriter            |    12403 |        241726 | 20080501150623 |
| 241774 | Palnatoke               |     1288 |        241726 | 20080505112123 |
| 241775 | 217.209.200.157         |        0 |        241726 | 20080607023855 |
| 241776 | 77.213.90.116           |        0 |        241726 | 20080628151124 |
| 241777 | 82.143.207.232          |        0 |        241726 | 20080920144004 |
| 241778 | 82.143.207.232          |        0 |        241726 | 20080920144802 |
| 241779 | EmilieDuus              |        0 |        241726 | 20080920214049 |
| 241780 | EmilieDuus              |        0 |        241726 | 20081010094132 |
| 241781 | 85.24.45.215            |        0 |        241726 | 20081013160832 |
| 241782 | UfB-LP                  |        0 |        241726 | 20081201143441 |
| 241783 | Optimus Pred            |        0 |        241726 | 20090124162708 |
| 241784 | MGA73bot                |    11722 |        241726 | 20090203140803 |
| 241785 | MGA73bot                |    11722 |        241726 | 20090203142330 |
| 241786 | MGA73bot                |    11722 |        241726 | 20090206185412 |
| 241787 | MGA73bot                |    11722 |        241726 | 20090206201209 |
| 241788 | Botindustrien           |        0 |        241726 | 20090223111444 |
| 241789 | 87.54.8.210             |        0 |        241726 | 20090303105527 |
| 241790 | Kaare                   |     4180 |        241726 | 20090303164711 |
| 241791 | 87.72.16.92             |        0 |        241726 | 20090310231352 |
| 241792 | Jesse hz                |     9461 |        241726 | 20090310232024 |
| 241793 | Nis Hoff                |    13621 |        241726 | 20090314173951 |
| 241794 | Nis Hoff                |    13621 |        241726 | 20090314174034 |
| 241795 | Obelix                  |        0 |        241726 | 20090606132042 |
| 241796 | Obelix                  |        0 |        241726 | 20090606132106 |
| 241797 | Lisbeth Sandø-pedersen  |        0 |        241726 | 20090612235853 |
| 241798 | Hejsa                   |     7866 |        241726 | 20090613000348 |
| 241799 | Steenthbot              |        0 |        241726 | 20090803080531 |
| 241800 | Christian Giersing      |        0 |        241726 | 20090826101337 |
| 241801 | 123456BB                |        0 |        241726 | 20091020113312 |
| 241802 | 123456BB                |        0 |        241726 | 20091020113331 |
| 241803 | 123456BB                |        0 |        241726 | 20091020113410 |
| 241804 | Knud Winckelmann        |    27923 |        241726 | 20091020113419 |
| 241805 | 80.167.111.197          |        0 |        241726 | 20091023223857 |
| 241806 | 80.167.111.197          |        0 |        241726 | 20091023224009 |
| 241807 | Pixi                    |        0 |        241726 | 20091023224142 |
| 241808 | Hanshans12              |        0 |        241726 | 20091023225210 |
| 241809 | Medic                   |        0 |        241726 | 20091023225302 |
| 241810 | Hanshans12              |        0 |        241726 | 20091023225423 |
| 241811 | Kaare                   |     4180 |        241726 | 20091023225636 |
| 241812 | 194.239.156.141         |        0 |        241726 | 20091104080134 |
| 241813 | Medic                   |        0 |        241726 | 20091104080412 |
| 241814 | Harlekin96              |    11789 |        241726 | 20091109072525 |
| 241815 | Broadbot                |        0 |        241726 | 20091109152521 |
| 241816 | Samoan ass              |        0 |        241726 | 20100105081048 |
| 241817 | Knud Winckelmann        |    27923 |        241726 | 20100105081210 |
| 241818 | 86.52.14.204            |        0 |        241726 | 20100501134234 |
| 241819 | Jørgen~dewiki           |        0 |        241726 | 20100501134833 |
| 241820 | 77.213.157.1            |        0 |        241726 | 20100717160249 |
| 241821 | 62.107.132.242          |        0 |        241726 | 20101006181431 |
| 241822 | 62.107.132.242          |        0 |        241726 | 20101006181610 |
| 241823 | 62.107.132.242          |        0 |        241726 | 20101006181704 |
| 241824 | Andreas Müller~dewiki   |        0 |        241726 | 20101006185333 |
| 241825 | Andreas Müller~dewiki   |        0 |        241726 | 20101006185341 |
| 241826 | Andreas Müller~dewiki   |        0 |        241726 | 20101006185439 |
| 241827 | Andreas Müller~dewiki   |        0 |        241726 | 20101006185557 |
| 241828 | 85.80.132.214           |        0 |        241726 | 20101023194012 |
| 241829 | 85.80.132.214           |        0 |        241726 | 20101023194357 |
| 241830 | 85.80.132.214           |        0 |        241726 | 20101023194427 |
| 241831 | 87.48.37.108            |        0 |        241726 | 20101208180530 |
| 241832 | Knud Winckelmann        |    27923 |        241726 | 20101208180640 |
| 241833 | 80.197.100.250          |        0 |        241726 | 20110202191741 |
| 241834 | 82.143.241.187          |        0 |        241726 | 20110220220456 |
| 241835 | Rekf                    |        0 |        241726 | 20110714092453 |
| 241836 | 46.32.152.150           |        0 |        241726 | 20110723210200 |
| 241837 | Coffins                 |        0 |        241726 | 20110901222019 |
| 241838 | Danyan                  |        0 |        241726 | 20120112235146 |
| 241839 | Heb~dewiki              |        0 |        241726 | 20120113094659 |
| 241840 | Palnatoke               |     1288 |        241726 | 20120530085548 |
| 241841 | EosKøge                 |        0 |        241726 | 20120602194202 |
| 241842 | 87.52.27.69             |        0 |        241726 | 20120719233322 |
| 241843 | 87.52.27.69             |        0 |        241726 | 20120719233442 |
| 241844 | Mulvany                 |        0 |        241726 | 20120719234028 |
| 241845 | MGA73bot                |    11722 |        241726 | 20121005172351 |
| 241846 | Toxophilus~dewiki       |        0 |        241726 | 20121121180222 |
| 241847 | Toxophilus~dewiki       |        0 |        241726 | 20121121180622 |
| 241848 | C960657                 |        0 |        241726 | 20121125133005 |
| 241849 | Brackenheim             |    11631 |        241726 | 20130101235500 |
| 241850 | Brackenheim             |    11631 |        241726 | 20130101235545 |
| 241851 | Coffins                 |        0 |        241726 | 20130103154254 |
| 241852 | Coffins                 |        0 |        241726 | 20130104173825 |
| 241853 | Coffins                 |        0 |        241726 | 20130104173853 |
| 241854 | Coffins                 |        0 |        241726 | 20130104175352 |
| 241855 | Coffins                 |        0 |        241726 | 20130104181449 |
| 241856 | Bergfalke2              |        0 |        241726 | 20130121094717 |
| 241857 | JuTe CLZ                |        0 |        241726 | 20130209161333 |
| 241858 | KLBot2                  |        0 |        241726 | 20130327061406 |
| 241859 | Don Magnifico           |        0 |        241726 | 20140213220534 |
| 241860 | JobuBot                 |        0 |        241726 | 20150515131346 |
| 241861 | Coffins                 |        0 |        241726 | 20150624201615 |
| 241862 | Coffins                 |        0 |        241726 | 20150624202147 |
| 241863 | Aka                     |      488 |        241726 | 20150706122829 |
| 241726 | Nemo bis                |     5105 |             0 | 20150912144341 |
| 241864 | Nemo bis                |     5105 |        241726 | 20150912144413 |
+--------+-------------------------+----------+---------------+----------------+
139 rows in set (0.00 sec)

See also:

Nemo_bis created this task.Sep 12 2015, 3:10 PM
Nemo_bis updated the task description. (Show Details)
Nemo_bis raised the priority of this task from to High.
Nemo_bis added a subscriber: Nemo_bis.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptSep 12 2015, 3:10 PM
Nemo_bis updated the task description. (Show Details)Sep 12 2015, 3:15 PM
Nemo_bis set Security to None.
Nemo_bis updated the task description. (Show Details)Sep 12 2015, 3:19 PM
Nemo_bis updated the task description. (Show Details)
TTO added a subscriber: TTO.Nov 23 2015, 9:11 AM
Scott added a subscriber: Scott.Feb 9 2016, 9:20 PM