#1 2025-10-31 12:19:24

dcoun
Member
From: Crete, Greece
Registered: 2020-02-18
Posts: 476

adding a Torm in a mysql table does not return an error as it should

Today,  I noticed that when adding a new Tormmyorm in an external mysql database, the record was not added in the database table.
The result from add was Ok, with the ID number, no exception somewhere
Trying to debug it, I found from ZEOS log that one field of the Tormmyorm had a value that was bigger that the allowed range in the database.
Zeos returned that no record was added and an error like the following:
'2025-10-31 14:08:44.386' cat: Execute, proto: mariadb, msg: Statement 903 : insert into myorm (ID,xxxx,xxxx,labo,xxxx) values (?,?,?,?,?,?,?,?,?,?,?,?), errcode: 1264, error: Out of range value for column 'labo' at row 1
I know that the table's field were changed to a smaller integer type and that was not caught in orm's object, but should I expect an error in such a case from mormot?
Thank you in advance

Offline

#2 2025-11-01 13:32:38

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 15,259
Website

Re: adding a Torm in a mysql table does not return an error as it should

The ORM has no way of actually knowing the range in the database.
At the ORM level, it handles 64-bit signed integers.

It is up to the user code to ensure the value is in the correct range.

Offline

#3 2025-11-01 14:43:28

dcoun
Member
From: Crete, Greece
Registered: 2020-02-18
Posts: 476

Re: adding a Torm in a mysql table does not return an error as it should

ab wrote:

The ORM has no way of actually knowing the range in the database.
At the ORM level, it handles 64-bit signed integers.

It is up to the user code to ensure the value is in the correct range.

I agree, my question was about the error that was not reported.
The response from Trestbatch.send was 200

Offline

Board footer

Powered by FluxBB