Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+2 votes
1.6k views
in Q2A Core by
edited by

Tonight I got the following error message (found in error-log-file of my server):

[11-Sep-2012 00:29:02] PHP Question2Answer MySQL query error 1247: Reference '(null)' not supported (reference to group function) - Query: UPDATE qa_posts AS x, (SELECT parents.postid, parents.created AS qcreated, COALESCE(MAX(children.created), parents.created) as acreated, COUNT(children.postid) AS acount, parents.netvotes, parents.views FROM qa_posts AS parents LEFT JOIN qa_posts AS children ON parents.postid=children.parentid AND children.type='A' WHERE parents.postid>=388 AND parents.postid<=388 AND LEFT(parents.type, 1)='Q' GROUP BY postid) AS a SET x.hotness=(((TO_DAYS(a.qcreated)-734138)*86400.0+TIME_TO_SEC(a.qcreated))*100 + ((TO_DAYS(a.acreated)-734138)*86400.0+TIME_TO_SEC(a.acreated))*100 + (a.acount+0.0)*16000000 + (a.netvotes+0.0)*16000000 + (a.views+0.0+1)*400000), x.views=x.views+1, x.lastviewip=INET_ATON('79.234.237.160') WHERE x.postid=a.postid
 

What could that be? A bug?

Or a hacking attempt?

--

In the mysql query I see postid=388 and parentid=388, so these are the according db-entries:

postid type parentid  categoryid catidpath1 catidpath2 catidpath3 acount amaxvote selchildid closedbyid userid cookieid createip lastuserid lastip upvotes downvotes netvotes lastviewip views hotness flagcount format created updated updatetype title content tags notify
388 Q NULL NULL NULL NULL NULL 2 0 NULL NULL 34 NULL 1340490754 NULL NULL 0 0 0 1340492965 74 1,43E+15 0   02.04.2012 15:48 NULL NULL Wie kürzt man Brüche? Wie kürzt man Brüche? Was muss ich dazu wissen? brüche,bruch,kürzen @
391 A 388 NULL NULL NULL NULL 0 0 NULL NULL 20 NULL 1437786209 NULL NULL 0 0 0 NULL 0 NULL 0   02.04.2012 16:08 NULL NULL NULL indem du zähler und nenner durch dieselbe zahl tei... NULL @
393 A 388 NULL NULL NULL NULL 0 0 NULL NULL 1 NULL 1340490754 1 1340490754 0 0 0 NULL 0 NULL 0 html 02.04.2012 16:57 ########## E NULL <p> NULL @
   <strong>Video Brüche: Eine einfache Einführun...

 

Q2A version: 1.5.1
by
The mysql query can be found in q2a-function qa_db_hotness_update (file qa-db-hotness.php).
by
Looks odd. Most likely a MySQL bug - similar to this though of course it's not in a stored procedure: http://bugs.mysql.com/bug.php?id=8817
by
Thanks for your help gid, much appreciated.
So if it is a mysql-bug we cannot do anything about it. Well then...

Please log in or register to answer this question.

...