Hallo, Gast! (Registrieren)

Wir wünschen allen Besuchern frohe Ostern!

Letzte Ankündigung: MyBB 1.8.37 veröffentlicht (04.11.23)


Benutzer, die gerade dieses Thema anschauen: 1 Gast/Gäste
[NG] SQL Error 1064 bei View Unread Posts oder anderswo seit Upgrade 1.8.19
#1
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 ...
PHP Version 7.4.30
MySQL Version 5.7.42
Mybb Version 1.8.37
(Stand 01/2024)

Grüße, André
Zitieren
#2
Wenn es von einem Plugin verursacht wird, ist es offensichtlich kein Bug im MyBB.
[Bild: banner.png]

Bitte die Foren-Regeln beachten und im Profil die verwendete MyBB-Version angeben.
Zitieren
#3
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>
PHP Version 7.4.30
MySQL Version 5.7.42
Mybb Version 1.8.37
(Stand 01/2024)

Grüße, André
Zitieren