Boolean fields used in Query Builder cause queries to fail

No errors? What does the server connect action return?

Thats what I get:

HTTP ERROR 500

Then there is a PHP error, could you turn on debug, it should then return the error.

Already see the error, here an update. Sorry for that.

Connection.zip (1.7 KB)

I still get the following error:

"message":"Undefined index: isRead","trace"

Is the isRead the database fieldname with the boolean?

Yes

Which database version do you use?

Sorry for the delay:

This seems to work for me. If I enter 1 for the value, it’s still converted to ‘true’ as displayed in query builder but the query works now. The query which is actually executed is:
WHERE (`tinyint_col` = 1)

Which database version are you using?

MySQL 5.7.21 (this is on my local machine, with Windows 10)

I’ve been testing now with MariaDB 10.4 and MySQL 5.7 together with PHP 7.4 and PHP 5.6. I get no errors and even with the original code it is working.

I found my issue. I had a Set Value Action with

{{repKalAktNr.where('isRead', '==', 0).count()}}

After changing it to

{{repKalAktNr.where('isRead', '==', false).count()}}

it worked. I didn’t have to do that before. Should it be like that now?

Your error was Undefined index: isRead, which means it didn’t find the isRead property on the collection. Is repKalAktNr recordset? It should normally not matter if you compare with 0 or false, at least it should not return with an error.

It is a Repeat

This problem has cropped up again, in 3.9.9. I thought it was fixed after 3.9.5. It’s exactly the same problem as before, eg:

image

true/false will evaluate as 1/0 on the server, the query shown in the Query Builder is not the actual query being executed on the server. Are you getting any error in your action?

I remember now that the query that’s executed is not what’s displayed - and it’s been working fine. I thought I was getting the same problem again and it seemed to be necessary to use a variable instead of ‘1’ in the query. I can’t reproduce it now so perhaps the problem was me, but I’ll let you know if I can reproduce it. I’m sorry about that.