MySQL/MariaDB BigInt Primary Key ID not working in Where

Wappler Version : 3.6.1
Operating System : W10
Server Model: PHP
Database Type: MariaDB
Hosting Type: Self

Expected behavior

Running a query on this table returns value correctly on the SQL Server

select id from tbl_x where id = 4659555762231;

Actual behavior

Running the same query via Wappler returns empty result set.

image

How to reproduce

Create a fresh new table in MariaDB

CREATE TABLE slashash_nh.tbl_test (
	id BIGINT NOT NULL,
	CONSTRAINT tbl_test_PK PRIMARY KEY (id)
)
ENGINE=InnoDB
DEFAULT CHARSET=latin1
COLLATE=latin1_swedish_ci;

Insert a row with id as 4659555762231.
Setup query builder like so:

It should return a blank data set. Even though it returns 1 row when same query is run directly on sql server.

Running the query without the condition returns this:
image
ID being in double quotes is a bit weird since its supposed to be a number.

Tested this on a MySQL server also. Same result.

Interestingly, if I use a custom query, it returns me the row with that ID correctly. So something is wrong with the query builder?

I will investigate it. The double quotes around the number is normal, the problem is that JS and PHP do not support 64bit integers and that is why these numbers are stored as strings.

1 Like