MyBB.de Forum
[NG] SQL Error 1064 bei View Unread Posts oder anderswo seit Upgrade 1.8.19 - Druckversion

+- MyBB.de Forum (https://www.mybb.de/forum)
+-- Forum: MyBB 1.8.x (https://www.mybb.de/forum/forum-87.html)
+--- Forum: Bugs (https://www.mybb.de/forum/forum-90.html)
+---- Forum: Gemeldete/Nicht gemeldete Bugs (https://www.mybb.de/forum/forum-92.html)
+---- Thema: [NG] SQL Error 1064 bei View Unread Posts oder anderswo seit Upgrade 1.8.19 (/thread-36061.html)



[NG] SQL Error 1064 bei View Unread Posts oder anderswo seit Upgrade 1.8.19 - schauan - 19.11.2018

Hallo,
wir bekommen in unserem Forum seit dem Upgrade auf die 19 einen SQL-Fehler:

SQL Error: 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')
AND p.dateline > IFNULL(fr.dateline,)
AN' at line 8
Query: SELECT 1
FROM mybb_posts p
INNER JOIN mybb_threads t ON (p.tid = t.tid)
LEFT JOIN mybb_threadsread tr ON (tr.uid = 0 AND t.tid = tr.tid)
LEFT JOIN mybb_forumsread fr ON (fr.uid = 0 AND t.fid = fr.fid)
WHERE p.visible = 1
AND t.visible = 1 AND t.fid NOT IN ('34','14','17','9','41','51','50','45','44','36','10','52','12','11','27','28','29','15','13','19','18','26','5','24','35','48','47','43','42','46','49') AND t.fid NOT IN (48)
AND p.dateline > IFNULL(tr.dateline,)
AND p.dateline > IFNULL(fr.dateline,)
AND p.dateline >
LIMIT 501

Diesen Teil der Fehlermeldung

AND p.dateline > IFNULL(fr.dateline,)

finde ich nur im Plugin (unreadPosts.php) , in Zeile 280 und 568, hier mal die komplette Abfrage:

$sql = "SELECT 1
FROM " . TABLE_PREFIX . "posts p
INNER JOIN " . TABLE_PREFIX . "threads t ON (p.tid = t.tid)
LEFT JOIN " . TABLE_PREFIX . "threadsread tr ON (tr.uid = {$mybb->user['uid']} AND t.tid = tr.tid)
LEFT JOIN " . TABLE_PREFIX . "forumsread fr ON (fr.uid = {$mybb->user['uid']} AND t.fid = fr.fid)
WHERE p.visible = 1
AND " . self::$where . "
AND p.dateline > IFNULL(tr.dateline,{$mybb->user['lastmark']})
AND p.dateline > IFNULL(fr.dateline,{$mybb->user['lastmark']})
AND p.dateline > {$mybb->user['lastmark']}
LIMIT " . self::buildSQLLimit();
$result = $db->query($sql);



PS:

ist das so gewollt das man im Forum in die mobile Ansicht wechselt? Ich habs nicht gewollt ...


RE: SQL Error 1064 bei View Unread Posts oder anderswo seit Upgrade 1.8.19 - StefanT - 19.11.2018

Wenn es von einem Plugin verursacht wird, ist es offensichtlich kein Bug im MyBB.


RE: SQL Error 1064 bei View Unread Posts oder anderswo seit Upgrade 1.8.19 - schauan - 19.11.2018

Hallo Stefan,

ja, dann schauen wir mal was sich ergibt. Ich hab hier nochmal die Abfrage wie sie dann im error.log aussieht. Irgendwie kann irgendwer das Feld Lastmark nicht auflösen.
({$mybb->user['lastmark']}) Der Inhalt fehlt unten in den Zeilen mit den 3 p.dateline
Ich habe das Plugin jetzt nochmal deinstalliert und installiert, mal schauen, was sich ergibt.

<error>
<dateline>1526992681</dateline>
<script></script>
<line>0</line>
<type>20</type>
<friendly_type>MyBB SQL Error</friendly_type>
<message>SQL Error: 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')
AND p.dateline > IFNULL(fr.dateline,)
AN' at line 8
Query: SELECT 1
FROM mybb_posts p
INNER JOIN mybb_threads t ON (p.tid = t.tid)
LEFT JOIN mybb_threadsread tr ON (tr.uid = 0 AND t.tid = tr.tid)
LEFT JOIN mybb_forumsread fr ON (fr.uid = 0 AND t.fid = fr.fid)
WHERE p.visible = 1
AND t.visible = 1 AND t.fid NOT IN ('34','14','17','9','41','51','50','45','44','36','10','52','12','11','27','28','29','15','13','19','18','26','5','24','35','48','47','43','42','46','49') AND t.fid NOT IN (48)
AND p.dateline > IFNULL(tr.dateline,)
AND p.dateline > IFNULL(fr.dateline,)
AND p.dateline >
LIMIT 501</message>
</error>