Wappler Version : 3.9.2
Operating System : Windows 10
Server Model: PHP
Database Type: MySQL
Hosting Type: custom
Expected behavior
What do you think should happen?
Having defined a column as tinyint, it should be possible to include this column in a query - eg with a condition such tinyintColumn = 1
Actual behavior
What actually happens?
Having enter '1' in the query condition, Wappler converts this to 'true' and the query fails.
How to reproduce
Create a column and define it as Boolean (using Wappler's Database Manager) or as a tinyint (eg in Navicat). The result is the same in either case. Include the column in a query, comparing the value to 1. Wappler converts this to 'true' and the query will fail. Wappler seems to treat the field as a text field.
This issue has been raised quite a few times. Although some changes/fixes have been made, the issue seems the same as raised here in v.3.7.8. (I think it was working in some versions since then.)
There are various ways round this, eg editing the code and changing 'true' to '1':
.. but Wappler will change this back if the Save button is used (not with Ctrl+S), or if the SA is edited.
Just to clarify, entering ‘1’ in a query is changed to ‘true’:
If for example, you’re using a tinyint column in MySQL for a boolean field, this query will fail. This wasn’t a problem until a few versions ago. I raised the issue in relation to 3.7.8.
Given this causes queries to fail, I would have thought this would be quite an important bug. I hope it can be fixed soon. It’s easy to reproduce. There are workarounds - perhaps defining a variable with a value of 1 is the most reliable.