MySQL & .NET - Insert Identity & Boolean Values Incorrect

Wappler Version : 1.9.9
Operating System : Windows 10

Expected behavior

Identity returned after insert should be something like 123, 13 etc.
Setting boolean type value in insert/updpate query action should treat value as numeric - 0, 1

Actual behavior

Identity returned after insert is 123.0, 13.0 etc.
Setting boolean type value in insert/updpate query action is treated as - '0', '1'

How to reproduce

Open a .NET/IIS project. Create a new insert query for a database in MySQL. Connect with Driver 8.0. Insert boolean value in a table and retrieve its last inserted ID using identity option in server action.

@patrick @George Still awaiting fix for this. Have again encountered this with the latest version.
It was not fixed in any of the versions since 1.9.9.

Are you sure you have chosen the right database field types for the insert and Boolean Sid? Which types have you used?

Field type in DB is BIT(1). The value accepted is in the format b'0' or 0 for false (and 1 for true).
Wappler is inserting the value as a string - "0" which fails.

Hmm I see that is wrong indeed.
And the identity?

@patrick will check it out

Btw why don’t you use php with MySQL?

it’s a client project. legacy systems. we’ve joined in mid way. hence must work with this setup.

Identity I haven’t tested again will check and update you on Monday.

The client has IIS servers, and MySQL DB.
Their existing projects are all in Visual Studio etc… so he wanted to keep it ASP.NET I think.

Although, Windows IIS servers support PHP, there might be other reasons.

I’ve always had problems with Wappler MS SQL connections and Table queries/inserts/updates.

My projects are Classic ASP with IIS and Connections to SQL Server 2012+.
My tables have ID’s that are INT’s (int, null) and Wappler defines them as double.

e.g

“table”: “Quotations”,
“wheres”: {
“condition”: “AND”,
“rules”: [
{
“id”: “QuoteID”,
“field”: “QuoteID”,
“type”: “double”,
“operator”: “equal”,
“value”: “{{$_GET.quoteid}}”,

I have to manually change the type to “number” which fixes a few issue I get.

Identity seems to be working fine now. Although, I do see that its treated as a string value rather than a number.

@George @patrick Any update on this? Is it getting resolved in this week’s update?

@George / @patrick Any update on this? This BIT bug is still present in the latest version of Wappler.
Its been more than 3 months since this bug was reported.

Hi Sid,

Did you try the latest Wappler 2.1.7
We have a lot of asp.net fixes in it.

Do save a server action first so that the files get updated.

Hi,
The change log did not have any mention of this bug, so did not try anything.

Tried re-saving the server action as you suggested, but did not make a difference. Issue still exists.

Sid,

Seems the MySQL driver for ASP.NET just returns the wrong data types…

Could you check your connection file and see the metadata for your table that is saved there?

In ASP.NET the connection file is store in:

/App_Data/ServerConnect/modules/Connections/your_db_connection.json

you should see a json structure in it, try to beautify it, and search for with something like:

Options … meta … tables …your_table_name: {…}

then paste here your_table_name structure

The queries are using ADO parameters, there is no way to change it from ‘0’ to b’0’. What type is the value used for the bit field, is that a string? Convert it to a number or boolean first, then it should work.

This is what I see in the DB connection json, which has correct data type:

image

@patrick The type of the field is BIT. There is no need of conversion.

The field doesn’t, but the input value does. It probably comes from a form which submits all data as strings. In most cases the database is smart enough to do the conversion, but sometimes you have to do it yourself.

Oh, now got your point. So how do I convert it to be compatible with BIT?
I already have it set to active.toNumber().round() and it does not work.