2

I'm working on the data dump of Stack Overflow and I might have found a bug in it.

The post (link1) has been merged with the post (link2) but in the data dump there is this:

Id post1 = 1406604 with AcceptedAnswersId = 1406611

Id post2 = 784929 with AcceptedAnswersId = 784946

And Id answer = 1406611 have ParentId = 784929

The problem is that the AcceptedAnswerId of the post1 is still here.

In an other post I remark that the post for which its AcceptedAnswer has been removed keep a value for its AcceptedAnswerId. link3

Maybe a modification can be made.

6
  • 1
    Data dump is always old data (from 1 day to 3 months), sure that's not the problem? – Ben Brocka Jul 25 '12 at 11:45
  • The data dump reflects the state of those questions at a specific point in time, not now. – Aaron Bertrand Jul 25 '12 at 11:47
  • @BenBrocka No it's not this exemple is retrieved from the data dump and not from a comparison between the site and the data dump. – AnthonyMaia Jul 25 '12 at 11:48
  • @AaronBertrand Yes I know. But still, some Post with an AcceptedAnswerId have not a Accepted Answer. Just in looking in the data dump. – AnthonyMaia Jul 25 '12 at 11:50
  • Just curious, are you using a local copy of the data dump to view this, or the Stack Exchange Data Explorer? – Josh Darnell Jul 25 '12 at 12:53
  • @jadarnel27 I'm using a local copy. But I don't think that this problem come to a synchronization between the site and the data dump. – AnthonyMaia Jul 25 '12 at 15:13
2

Yes, there are a couple of those inconsistencies. I've created the following query to find those cases where the acceptedanswerid on the question links to an answer that has a different parentid.

select q.id as [Post Link]
     , q.creationdate
     , (select count(*) 
        from posthistory 
        where postid = q.id and posthistorytypeid = 37) as [Source migrated]
     , a.id as [Post Link]
     , a.creationdate
     , (select count(*) 
        from posthistory 
        where postid = a.id and posthistorytypeid = 38) as [Dest migrated]
     , case 
       when a.deletiondate is not null 
       then a.deletiondate 
       else null 
       end [deleted]
from posts q
inner join postswithdeleted a on a.id = q.acceptedanswerid
where q.id <> a.parentid

The query outputs the following columns:

  • Question Link
  • Question Creationdate
  • # Merge Source events in Posthistory
  • Answer Link
  • Answer CreationDate
  • # Merge Destination events in Posthistory.

When you glance over the results you see the following patterns:

anomalies

  • Merge source present and Merge Destination present.
  • Merge source present and deleted answer
  • Merge source absent and deleted answer
  • Merge source absent and active answer, Merge destination absent

For the cases where the merge source is present it always means the question was merged into another question. In those cases I tend to disagree that the record for the question should be fixed. It kind of keeps track of what the original OP choose as the accepted answer, which is valuable info in some sense.

For the cases where the merge source is absent we see the left overs of a race condition that once existed. It becomes manifest when one Q/A has multiple accepted questions or where answers have an accept vote in their history but isn't shown.

Here are the bug reports that describe the issue:

Answer accepted twice
Accepted answer reward +15 awarded twice!
Bug: Awarded double rep for accepted answer
Multiple accepted answers to a question?

For the above cases where I was sure a moderator could rectify the issue I've flagged or will be flagging the question or answer. I delete voted one question because it was about PHP.

tl;dr; The merge stubs shouldn't be fixed, the remaining errors can be rectified with flags and a moderator action.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .