61

When I search on Stackoverflow with the following parameters:

is:q isaccepted:yes

I get three results: (link)

results

Trying on different browsers (Chrome, IE) I get the same result and seemingly the same questions showing. All the questions are from October 9th 2010.

I realise this is an edge case -- but I'm curious as to how a question can be an accepted answer?

I also tried this on the next two biggest sites in the network (SuperUser and AskUbuntu) and got the expected 0 results.

10
  • 11
    Umm.... that last one doesn't even have an answer...
    – Jon Clements Mod
    Commented Aug 21, 2015 at 7:25
  • 8
    @JonClements I know... I thought I'd ask a question not about the 10 million questions milestone for a change around here. :)
    – TZHX
    Commented Aug 21, 2015 at 7:25
  • 6
    That's a hilarious bug. I wonder how that happened.
    – user4639281
    Commented Aug 21, 2015 at 7:27
  • 12
    Interestingly (maybe) - extending that query to also include deleted posts returns another three -- all of which are also on that date...
    – Jon Clements Mod
    Commented Aug 21, 2015 at 7:28
  • 3
    Remnants of a previously "fixed" bug?
    – user4639281
    Commented Aug 21, 2015 at 7:36
  • 3
    See meta.stackexchange.com/questions/67114/stack-overflow-outage and the noted wonkiness implied in some of the answers as a result.
    – A. Webb
    Commented Aug 21, 2015 at 14:23
  • 8
    @Barry hasaccepted matches questions which have an accepted answer, and isaccepted matches answers which are accepted. So the problem is that is:q isaccepted:yes should produce 0 results.
    – Oriol
    Commented Aug 21, 2015 at 14:36
  • 1
    @Oriol Ahhh yes of course. Sorry brain not quite engaged there.. Commented Aug 21, 2015 at 14:46
  • 2
    This is not a bug in the search per-se, but database inconsistency, since Posts.Id=2 PostId should not be used in the AcceptedAnswerId column.
    – Braiam
    Commented Aug 21, 2015 at 20:26
  • 1
    Seems to be 2 results now, the answerless one is gone Commented Aug 23, 2015 at 14:15

2 Answers 2

6

There were exactly 6 such questions in the database (4 deleted), all of which were posted on the 9th of October 2010, so there was probably a bug present on that day that caused some questions to get marked as being accepted answers...

I have updated that field in the database directly.

2
  • Data fixes are the best fixes. :)
    – TZHX
    Commented Jul 13, 2016 at 16:39
  • 2
    Until one deletes the DB by mistake ;)
    – Oded StaffMod
    Commented Jul 13, 2016 at 16:47
19

This question interested me so I did some digging in SEDE and found that somehow the Question Ids of those questions (3896320,3896444,3896217) have ended up in the AcceptedAnswerId column on some other questions:


From this I would presume that the back end SQL Query being produced by that search is something like this:

SELECT [A].*
FROM [Posts] AS [Q]
INNER JOIN [Posts] AS [A] ON ([Q].[AcceptedAnswerId] = [A].[Id])
WHERE [A].[PostTypeId] = 1; -- Type 1 = Question

^ SEDE Link

4
  • 6
    Speculation for why 2 only show up in SEDE where as 3 show up in the search could be that one of the questions which attributes those other questions as their accepted answer might be deleted (and deleted posts aren't exported into SEDE)
    – AeroX
    Commented Aug 21, 2015 at 17:42
  • 1
    post history inconsistencies: meta.stackoverflow.com/questions/302943/… Commented Aug 22, 2015 at 4:01
  • 1
    So, is the consensus that we need a developer to sort this out?
    – AStopher
    Commented Aug 23, 2015 at 22:37
  • 1
    @cybermonkey yes, someone with direct database access would need to null the column for those two answers or possibly the question OPs would need to select new accepted answers
    – AeroX
    Commented Aug 23, 2015 at 22:40

You must log in to answer this question.

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