[aur-dev][PATCH 1/3] fix broken SQL query that always failed
Due to missing whitespace at the end of strings during joining, we ended
up with the query fragment
"DelTS IS NULLAND NOT PinnedTS"
which should be
"DelTS IS NULL AND NOT PinnedTS"
So the check for pinned comments > 5 likely always failed.
In php 7, a completely broken query that raises exceptions in the
database engine was silently ignored... in php 8, it raises
Uncaught PDOException: SQLSTATE[HY000]: General error: 1 near "PinnedTS": syntax error in <file>
and aborts the page building. End result: users with permission to pin
comments cannot see any comments, or indeed page content below the first
comment header
Signed-off-by: Eli Schwartz
We usually guard such queries and have both mysql and sqlite branches.
But I have not implemented the sqlite branch. Given sqlite is typically
used for local dev setups, the fact that "users with more than the
configured max simultaneous logins" can avoid getting some logins
annulled is probably not a huge risk.
And this always *used* to fail on sqlite, silently. Now, in php 8, it
raises PDOException, which prevents running the test server
Document this as a FIXME for now, until someone reimplements the query
for sqlite.
Signed-off-by: Eli Schwartz
Signed-off-by: Eli Schwartz
Merged all three patches (and closed merge request on GitLab). Thanks!
On 20/02/2021 17:33, Lukas Fleischer via aur-dev wrote:
Merged all three patches (and closed merge request on GitLab). Thanks!
Thanks for merging, will this be available in the live branch soon? Thanks in advance, Jelle
participants (3)
-
Eli Schwartz
-
Jelle van der Waa
-
Lukas Fleischer