Query builder "not equal true" yields wrong results

Wappler Version : 7.3.6
Operating System :
Server Model: node
Database Type: msql 8
Hosting Type:

Expected behavior

What do you think should happen?

These 2 groupings should return the same results.

Actual behavior

What actually happens?

The 2nd one… not equal true… does not return nulls.

How to reproduce

  • Detail a step by step guide to reproduce the issue
  • A screenshot or short video indicating the problem
  • A copy of your code would help. Include: JS, HTML.
  • Test your steps on a clean page to see if you still have an issue

It should replicate the behavior of mysql where both of these return identical resultsets

select *
from mpp_members
where mp_internal is false or mp_internal is null

select * 
from mpp_members
where mp_internal is not true

Are you sure the groupings are correct. The second condition looks to be outside the "or"

I don’t use both of those, only the first (with the Or). The second was to show the condition that is incorrect.

Is the value in this field a string or a boolean?

Bool

Does it make any difference if you use {{true}} instead?

No change.

Could it be related to mysql not actually having a bool type.

What if you replace true and false with 1 and 0?

Wappler reverts those back to true/false.

I don’t need a solution, my OR grouping works as a workaround. Just a bug.

It looks like the word true is not working the second and third picture show the wrong posts.

MySQL uses TRUE/FALSE as an alias for 1/0. Just use 1 for true and 0 for false.

1 Like

Wappler reverts 1/0 to true/false

Edit: I see the disconnect here. If 1 or 0 is enter directly in the expression (my first screenshot), Wappler reverts it to true or false. But if entered in the expression building (after clicking the lightning bolt), it retains the 1 as {{1}}

I would still see this as a bug, but that’s for you guys to decide.

It seems that the query builder indeed translate the values to booleans when the column type is Boolean. The driver should however correctly handle the boolean value and convert it back to 1/0 for the database.