FirebirdSQL / firebird

Firebird server, client and tools
https://www.firebirdsql.org/
1.26k stars 216 forks source link

Incorrect record size when using computed fields [CORE3165] #3540

Open firebird-automations opened 14 years ago

firebird-automations commented 14 years ago

Submitted by: Maxim Kuzmin (cybermax)

Is related to CORE374

CREATE TABLE TABLE1 ( ID INTEGER, COMP1 COMPUTED BY (cast('' as varchar(25000))), COMP2 COMPUTED BY (cast('' as varchar(25000))), COMP3 COMPUTED BY (cast('' as varchar(25000))) );

1. When "SELECT * FROM TABLE1", get error: "Implementation limit exceeded. block size exceeds implementation restriction". 2. Backup executed succesfully. But when restore database, get error: gbak: committing metadata gbak: ERROR:unsuccessful metadata update gbak: ERROR: new record size of 75014 byte gbak: ERROR: TABLE TABLE1 gbak:Exiting before completion due to errors

firebird-automations commented 14 years ago

Commented by: Smirnoff Serg (wildsery)

3. When "SELECT COMP1, COMP2 FROM TABLE1" then OK.

firebird-automations commented 14 years ago

Commented by: Bert Herngreen (bertherngreen)

The block size exceeds implementation restriction means in this case that the maximum rowsize has been exceeded. 3 x 25000 is larger than the Maximum row size of 64k, 2 x 25000 isn't.

So "SELECT COMP1, COMP2 FROM TABLE1" is OK, but "SELECT COMP1, COMP2, COMP3 FROM TABLE1" then fails.

See http://www.firebirdfaq.org/faq61/

firebird-automations commented 14 years ago

Commented by: Maxim Kuzmin (cybermax)

Bert Herngreen, i know the cause of the error. The idea is that Firebird allows to create such a situation, including unrestorable backup.

firebird-automations commented 13 years ago
Modified by: @dyemanov summary: Inrorrect record size when using computed fields =\> Incorrect record size when using computed fields
firebird-automations commented 13 years ago
Modified by: @dyemanov Link: This issue is related to [CORE374](https://github.com/FirebirdSQL/firebird/issues?q=CORE374+in%3Atitle) \[ [CORE374](https://github.com/FirebirdSQL/firebird/issues?q=CORE374+in%3Atitle) \]
firebird-automations commented 13 years ago

Commented by: @dyemanov

This is a regression introduced when fixing inability to restore computed fields based on other metadata. The solution was to restore computed fields as regular ones (just without data) and then alter them to be computed. Unfortunately, the record length check fires for the first table format because of that.

firebird-automations commented 13 years ago
Modified by: @dyemanov Version: 3\.0 Initial \[ 10301 \] Version: 2\.1\.3 \[ 10302 \] Version: 2\.1\.2 \[ 10270 \] Version: 2\.1\.1 \[ 10223 \] Version: 2\.1\.0 \[ 10041 \] Component: GBAK \[ 10006 \]