Forum > Databases

Lazarus crashes at "Post" after update from 1.8.2 to 2.0.10 and 2.2

(1/2) > >>

xenon1:
I just want to report: After updating Lazarus from 1.8.2 to 2.0.10 (and again after I updated to 2.2, hoping the problem would go away), it regularly crashed at the database command "Post" when posting a string. (Commands: Edit; FieldByName('xxx').AsString := 'xxxx'; Post).

It took me two days to figure out why: Lazarus had given the field length ("Size") as something like 1000 or even 1024, as I finally found in the Object Inspector, although the field length of the database field (firebird) was only 255 [varchar(255)]. When I set the field length in the Object Inspector to the right value (Size: 255) everything went fine.

My operationg system during this problem: MX Linus 21.1., based on Debian 11 (bullseye).

I was surprised that nobody had reported a similar problem on the Internet, as Lazarus 2.0.10 has been released some time ago. I cannot imagine to be the first person to have experienced this. Whatever, I post this here so that someone else might not have to search days for a solution.

I do not know if this counts as an official bug, and I would not know where to report it anyway.

MarkMLl:

--- Quote from: xenon1 on June 21, 2022, 06:54:37 pm ---I do not know if this counts as an official bug, and I would not know where to report it anyway.

--- End quote ---

There's a link to the bugtracker at the left of the forum page, i.e. somewhere

<===== OVER THERE :-)

MarkMLl

af0815:

--- Quote from: xenon1 on June 21, 2022, 06:54:37 pm ---I do not know if this counts as an official bug, and I would not know where to report it anyway.

--- End quote ---
And it is good to have a program/demo code to show this bug. It make it easier for the developer to analyse the bug. Reports with demo code often fixed very fast.

bum_bum:

--- Quote from: xenon1 on June 21, 2022, 06:54:37 pm ---It took me two days to figure out why: Lazarus had given the field length ("Size") as something like 1000 or even 1024, as I finally found in the Object Inspector, although the field length of the database field (firebird) was only 255 [varchar(255)]. When I set the field length in the Object Inspector to the right value (Size: 255) everything went fine.

--- End quote ---
Maybe the problem is related to the encoding? In UNICODE, a character can take 4 bytes, then 255 characters will be 1020 bytes long.

Thaddy:
How much is 256 X 4 ?
.... It is NOT 1020, but

1024

But you are correct that you advise is to reserve 4 per byte in all cases except strict Ansi or shortstring.

My other advice would be to do everything on a network in BYTES and not any string type.

Navigation

[0] Message Index

[#] Next page

Go to full version