cosmocode/tagging

Error in SQL Syntax for nonexistent pages

sandos187 opened this issue · 5 comments

I get the attached error message when trying to open the tagging management page (HY000 1 no such column: FALSE:)
image

According to the SQLLite documentation, there is no such thing as TRUE and FALSE but integers 0 and 1 are used (https://www.sqlite.org/datatype3.html)

If i change FALSE to 0 in line 1006 of helper.php everything seems fine.

WHERE PAGEEXISTS(pid) IS FALSE

If i change FALSE to 0 in line 1006 of helper.php everything seems fine.

better to change the line to just:
WHERE NOT PAGEEXISTS(pid)

Sorry, bad bugreporting on my end. There is a second occurence of
WHERE PAGEEXISTS(pid) IS FALSE which i haven't seen, and i didn't tested the deleting of nonexitent entry.

In line 585, there should also be a WHERE NOT PAGEEXISTS(pid) instead of a WHERE PAGEEXISTS(pid) IS FALSE

My fault, sorry for that!

WHERE PAGEEXISTS(pid) IS FALSE

annda commented

@sandos187 What is your system setup?

When you look closely at the specification https://www.sqlite.org/lang_select.html , the query WHERE expr IS expr was valid all along, because the literal value of FALSE is a valid expression in itself.

Also, I was not able to reproduce the error on two different OSs running different servers and PHP (Arch Linux and MacOS, Apache and nginx, PHP ~7.3 on both).

I'm on a shared host on uberspace.de, it uses CentOS7, Apache and also php7.3. And it's using the sqlite3 engine.

I got my conclusion from here: https://stackoverflow.com/questions/580668/how-do-i-use-a-boolean-field-in-a-where-clause-in-sqlite#580690

If the problem is on my end, i apologize in advance :-)

Ok, I think I found the problem.
According to https://www.sqlite.org/lang_expr.html#booleanexpr the feature, that SQLite recognizes the identifiers "TRUE" and "FALSE" as boolean literals is "quite" new (SQLite 3.23.0 (2018-04-02)).
On my shared host there is still sqlite 3.7.17 installed. That would explain, why it won't recognize the "FALSE".