Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
1.1k views
in Q2A Core by
Hi,

I have installed the script but when i click in the question i have (Question not found). When i am connected admin its ok... I dont have hidden questions. (No hidden questions, answers or comments found).

Thank you for answer...

Nicolas
by
Can you please post a link so I can take a look?

2 Answers

0 votes
by
 
Best answer
Summarized answer since this seems to be a common problem:

This is due to a bug in MySQL 5.1.46 and 5.1.47:

http://bugs.mysql.com/bug.php?id=53334

(The LEFT JOIN using a condition that is definitely false (=NULL) makes the results empty, when it should simply create a NULL column.)

For now the solution is to change this line in qa-db-selects.php:

$selectspec['source'].=' LEFT JOIN ^uservotes ON ^posts.postid=^uservotes.postid AND ^uservotes.userid=$';

... to ...

$selectspec['source'].=' LEFT JOIN ^uservotes ON ^posts.postid=^uservotes.postid AND ^uservotes.userid=COALESCE($,0)';

The next version of Q2A will work around this a different way.
by
MySQL 5.1.47 and Q2A 1.0 has this issue
MySQL 5.1.47 and Q2A 1.2 Preview 5 has this issue
but MySQL 5.1.47 and Q2A 1.0.1 is working fine. why is so?
by
The bug only appears if you're not logged in, but I assuming that was the case when you tested with 1.0.1? If so, I don't know the reason - it's a bug, so by its nature, it might only appear under certain circumstances.
by
I agree with you, but even without login everything works fine.
I'm still running Q2A 1.0.1 version with MySQL 5.1.47 on http://answers.prothoughts.com, pls have a look.
0 votes
by
by
Version MySQL 5.1.46
by
Thanks - as I thought. Here's the MySQL bug that's causing this:

http://bugs.mysql.com/bug.php?id=53334

Here are a couple of workarounds to try by modifying qa-db-selects.php.

Original line of code:

$selectspec['source'].=' LEFT JOIN ^uservotes ON ^posts.postid=^uservotes.postid AND ^uservotes.userid=$';

New version:

$selectspec['source'].=' LEFT JOIN ^uservotes ON ^posts.postid=^uservotes.postid AND ^uservotes.userid<=>$';

Or try:

$selectspec['source'].=' LEFT JOIN ^uservotes ON ^posts.postid=^uservotes.postid AND ^uservotes.userid=COALESCE($,0)';

Please let me know if either of these works.
by
Ok nice, thank you now its ok :)

This :

$selectspec['source'].=' LEFT JOIN ^uservotes ON ^posts.postid=^uservotes.postid AND ^uservotes.userid=COALESCE($,0)';

Nicolas
by
Thanks alot! that fixed the problem perfectly!
...