Queries with boolean values not working

Wappler Version : 4.4.5
Operating System : Windows 10
Server Model: PHP
Database Type: MySQL
Hosting Type: Custom

Expected behavior

It should be possible to use a value of 1 in a query including a column defined as a TINYINT (ie as a boolean field)

Actual behavior

The query fails. The ‘1’ entered in Query Builder is converted to ‘True’. This causes the query to fail.

How to reproduce

Create a query comparing the value of the boolean field to 1. The ‘1’ is changed to ‘True’ and the query will fail:

image

When Query Builder is reopened the problem is more apparent:

image

I was testing a local project, having updated the Wappler files. I was about to update the live site before I noticed some queries were returning no results. The problem was the due to this issue.

This bug has appeared off and on ever since Database Manager was added to Wappler. Running the query in DM works as expected, which is not very helpful. The query it executes (in this case using ‘not equal’) uses this condition:
where hide != true
However, when the query is run in the browser it fails. The SELECT statement is prepared but not executed. In previous versions of the bug, I think the query seemed to run correctly, but used the value of ‘true’ instead of ‘1’. In either the case, the query failed.

As before, one workaround is to create a variable with a value of 1 to use in the query. Unfortunately, after this bug was fixed before, I removed some of these workarounds; I should have left them in place.

(I’m not sure in which version of Wappler this bug was reintroduced. Probably not the current version.)

Community Page
Last updated: